Skip to content

Commit 11cf3c9

Browse files
authored
Merge pull request #2532 from ViewComponent/fix-ci
Fix ci
2 parents 13de693 + a6ab1ee commit 11cf3c9

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

Gemfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ GEM
141141
websocket-driver (~> 0.7)
142142
globalid (1.3.0)
143143
activesupport (>= 6.1)
144-
haml (7.1.0)
144+
haml (7.2.0)
145145
temple (>= 0.8.2)
146146
thor
147147
tilt
@@ -211,13 +211,13 @@ GEM
211211
nokogiri (1.19.0-x86_64-linux-musl)
212212
racc (~> 1.4)
213213
parallel (1.27.0)
214-
parser (3.3.10.0)
214+
parser (3.3.10.1)
215215
ast (~> 2.4.1)
216216
racc
217217
pp (0.6.3)
218218
prettyprint
219219
prettyprint (0.2.0)
220-
prism (1.7.0)
220+
prism (1.8.0)
221221
propshaft (1.3.1)
222222
actionpack (>= 7.0.0)
223223
activesupport (>= 7.0.0)
@@ -269,7 +269,7 @@ GEM
269269
zeitwerk (~> 2.6)
270270
rainbow (3.1.1)
271271
rake (13.3.1)
272-
rdoc (7.0.3)
272+
rdoc (7.1.0)
273273
erb
274274
psych (>= 4.0.0)
275275
tsort
@@ -301,15 +301,15 @@ GEM
301301
rspec-mocks (~> 3.13)
302302
rspec-support (~> 3.13)
303303
rspec-support (3.13.6)
304-
rubocop (1.81.7)
304+
rubocop (1.82.1)
305305
json (~> 2.3)
306306
language_server-protocol (~> 3.17.0.2)
307307
lint_roller (~> 1.1.0)
308308
parallel (~> 1.10)
309309
parser (>= 3.3.0.2)
310310
rainbow (>= 2.2.2, < 4.0)
311311
regexp_parser (>= 2.9.3, < 3.0)
312-
rubocop-ast (>= 1.47.1, < 2.0)
312+
rubocop-ast (>= 1.48.0, < 2.0)
313313
ruby-progressbar (~> 1.7)
314314
unicode-display_width (>= 2.4.0, < 4.0)
315315
rubocop-ast (1.49.0)
@@ -353,10 +353,10 @@ GEM
353353
actionpack (>= 6.1)
354354
activesupport (>= 6.1)
355355
sprockets (>= 3.0.0)
356-
standard (1.52.0)
356+
standard (1.53.0)
357357
language_server-protocol (~> 3.17.0.2)
358358
lint_roller (~> 1.0)
359-
rubocop (~> 1.81.7)
359+
rubocop (~> 1.82.0)
360360
standard-custom (~> 1.0.0)
361361
standard-performance (~> 1.8)
362362
standard-custom (1.0.2)

Rakefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ namespace :docs do
6969
.get("ViewComponent::Base")
7070
.meths
7171
.select do |method|
72-
!method.tag(:private) &&
73-
method.path.include?("ViewComponent::Base") &&
74-
method.visibility == :public &&
75-
!method[:name].to_s.start_with?("_") # Ignore methods we mark as internal by prefixing with underscores
72+
!method.tag(:private) &&
73+
method.path.include?("ViewComponent::Base") &&
74+
method.visibility == :public &&
75+
!method[:name].to_s.start_with?("_") # Ignore methods we mark as internal by prefixing with underscores
7676
end.sort_by { |method| method[:name] }
7777

7878
instance_methods_to_document = meths.select { |method| method.scope != :class }
@@ -83,8 +83,8 @@ namespace :docs do
8383
.meths
8484
.sort_by { |method| method[:name] }
8585
.select do |method|
86-
!method.tag(:private) &&
87-
method.visibility == :public
86+
!method.tag(:private) &&
87+
method.visibility == :public
8888
end
8989

9090
require "rails"

lib/view_component/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ def inherited(child)
577577
# eager loading is disabled and the parent component is rendered before the child. In
578578
# such a scenario, the parent will override ViewComponent::Base#render_template_for,
579579
# meaning it will not be called for any children and thus not compile their templates.
580-
if !child.instance_methods(false).include?(:render_template_for) && !child.__vc_compiled?
580+
if !child.method_defined?(:render_template_for, false) && !child.__vc_compiled?
581581
child.class_eval <<~RUBY, __FILE__, __LINE__ + 1
582582
def render_template_for(requested_details)
583583
# Force compilation here so the compiler always redefines render_template_for.
@@ -600,7 +600,7 @@ def render_template_for(requested_details)
600600
# Set collection parameter to the extended component
601601
child.with_collection_parameter(__vc_provided_collection_parameter)
602602

603-
if instance_methods(false).include?(:render_template_for)
603+
if method_defined?(:render_template_for, false)
604604
vc_ancestor_calls = defined?(@__vc_ancestor_calls) ? @__vc_ancestor_calls.dup : []
605605

606606
vc_ancestor_calls.unshift(instance_method(:render_template_for))

lib/view_component/compiler.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ def template_errors
115115
.tally
116116
.select { |_, count| count > 1 }
117117
.each do |tally|
118-
variant, this_format = tally.first
118+
variant, this_format = tally.first
119119

120-
variant_string = " for variant `#{variant}`" if variant.present?
120+
variant_string = " for variant `#{variant}`" if variant.present?
121121

122-
errors << "More than one #{this_format.upcase} template found#{variant_string} for #{@component}. "
122+
errors << "More than one #{this_format.upcase} template found#{variant_string} for #{@component}. "
123123
end
124124

125125
default_template_types = @templates.each_with_object(Set.new) do |template, memo|
@@ -190,11 +190,11 @@ def gather_templates
190190
).flat_map { |ancestor| ancestor.instance_methods(false).grep(/^call(_|$)/) }
191191
.uniq
192192
.each do |method_name|
193-
templates << Template::InlineCall.new(
194-
component: @component,
195-
method_name: method_name,
196-
defined_on_self: component_instance_methods_on_self.include?(method_name)
197-
)
193+
templates << Template::InlineCall.new(
194+
component: @component,
195+
method_name: method_name,
196+
defined_on_self: component_instance_methods_on_self.include?(method_name)
197+
)
198198
end
199199

200200
templates

lib/view_component/slotable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def __vc_register_polymorphic_slot(slot_name, types, collection:)
259259

260260
setter_method_name = :"with_#{poly_slot_name}"
261261

262-
if instance_methods.include?(setter_method_name)
262+
if method_defined?(setter_method_name)
263263
raise AlreadyDefinedPolymorphicSlotSetterError.new(setter_method_name, poly_slot_name)
264264
end
265265

0 commit comments

Comments
 (0)