Skip to content

Commit d8a4b94

Browse files
fix rubocop offenses
1 parent 920ed7c commit d8a4b94

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/react_on_rails/pro_features/helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def apply_immediate_hydration_if_supported(component_specification_tag, render_o
2828
return component_specification_tag unless render_options.immediate_hydration && support_pro_features?
2929

3030
# Add data attribute
31-
component_specification_tag.gsub!(/\<script /, '<script data-immediate-hydration="true" ')
31+
component_specification_tag.gsub!("<script ", '<script data-immediate-hydration="true" ')
3232

3333
# Add immediate invocation script
3434
component_specification_tag.concat(
@@ -43,7 +43,7 @@ def apply_store_immediate_hydration_if_supported(store_hydration_data, redux_sto
4343
return store_hydration_data unless redux_store_data[:immediate_hydration] && support_pro_features?
4444

4545
# Add data attribute
46-
store_hydration_data.gsub!(/\<script /, '<script data-immediate-hydration="true" ')
46+
store_hydration_data.gsub!("<script ", '<script data-immediate-hydration="true" ')
4747

4848
# Add immediate invocation script
4949
store_hydration_data.concat(

spec/dummy/spec/helpers/react_on_rails_helper_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ def helper.append_javascript_pack_tag(name, **options)
368368

369369
describe "'immediate_hydration' tag option" do
370370
let(:immediate_hydration_script) do
371-
%(typeof ReactOnRails === 'object' && ReactOnRails.reactOnRailsComponentLoaded('App-react-component-0');).html_safe
371+
%(typeof ReactOnRails === 'object' && ReactOnRails.reactOnRailsComponentLoaded('App-react-component-0');)
372+
.html_safe
372373
end
373374

374375
context "with 'immediate_hydration' == false" do

0 commit comments

Comments
 (0)