Skip to content

Commit

Permalink
Standard
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoroth committed Apr 26, 2024
1 parent 6521d0f commit 35fee91
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/stimulus_reflex/dataset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(data = {})
@attrs = build_data_attrs(regular_dataset, datasets["datasetAll"] || {})
@data_attrs = @attrs.transform_keys { |key| key.delete_prefix "data-" }

super build_underscored(@data_attrs)
super(build_underscored(@data_attrs))
end

def signed
Expand Down
2 changes: 1 addition & 1 deletion lib/stimulus_reflex/element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def initialize(data = {})
@dataset = StimulusReflex::Dataset.new(data)

all_attributes = @attrs.merge(@dataset.attrs)
super build_underscored(all_attributes)
super(build_underscored(all_attributes))
end

def attributes
Expand Down
6 changes: 3 additions & 3 deletions lib/stimulus_reflex/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def complete_step(step)
create_file "tmp/stimulus_reflex_installer/#{step}", verbose: false
end

def create_or_append(path, *args, &block)
def create_or_append(path, *, &)
FileUtils.touch(path)
append_file(path, *args, &block)
append_file(path, *, &)
end

def current_template
Expand Down Expand Up @@ -303,7 +303,7 @@ def options_path
end

def options
@options ||= YAML.safe_load(File.read(options_path))
@options ||= YAML.safe_load_file(options_path)
end

def working
Expand Down
2 changes: 1 addition & 1 deletion test/configuration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def revert_config_changes(key)

yield

StimulusReflex.config.send("#{key}=", previous_value)
StimulusReflex.config.send(:"#{key}=", previous_value)
end

class MyLogger
Expand Down
5 changes: 2 additions & 3 deletions test/html/document_fragment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class StimulusReflex::HTML::DocumentFragmentTest < ActiveSupport::TestCase
assert_nil fragment.match("body").inner_html
end


test "should handle string" do
fragment = StimulusReflex::HTML::DocumentFragment.new("Some String")

Expand Down Expand Up @@ -267,8 +266,8 @@ class StimulusReflex::HTML::DocumentFragmentTest < ActiveSupport::TestCase
)
fragment = StimulusReflex::HTML::DocumentFragment.new(html)

assert_equal %(<div> <label>X</label> <div> <input type=\"text\"> <span>After Input</span> </div> </div>), fragment.to_html.squish
assert_equal %(<div> <label>X</label> <div> <input type=\"text\"> <span>After Input</span> </div> </div>), fragment.outer_html.squish
assert_equal %(<div> <label>X</label> <div> <input type="text"> <span>After Input</span> </div> </div>), fragment.to_html.squish
assert_equal %(<div> <label>X</label> <div> <input type="text"> <span>After Input</span> </div> </div>), fragment.outer_html.squish
end

test "non-closing <input> tag with -> in attribute" do
Expand Down

0 comments on commit 35fee91

Please sign in to comment.