diff --git a/core/lib/generators/solidus/update/update_generator.rb b/core/lib/generators/solidus/update/update_generator.rb index 5be71edb82e..7d428d1e3af 100644 --- a/core/lib/generators/solidus/update/update_generator.rb +++ b/core/lib/generators/solidus/update/update_generator.rb @@ -10,23 +10,23 @@ class UpdateGenerator < ::Rails::Generators::Base source_root File.expand_path('templates', __dir__) class_option :from, - type: :string, - banner: 'The version your are updating from. E.g. 2.11.10' + type: :string, + banner: 'The version your are updating from. E.g. 2.11.10' class_option :initializer_basename, - type: :string, - default: 'new_solidus_defaults', - banner: 'The name for the new initializer' + type: :string, + default: 'new_solidus_defaults', + banner: 'The name for the new initializer' class_option :to, - type: :string, - default: Spree.solidus_version, - hide: true + type: :string, + default: Spree.solidus_version, + hide: true class_option :initializer_directory, - type: :string, - default: 'config/initializers/', - hide: true + type: :string, + default: 'config/initializers/', + hide: true def create_new_defaults_initializer from = options[:from] @@ -38,7 +38,7 @@ def create_new_defaults_initializer @api_changes = api_changes_template(from, to) template 'config/initializers/new_solidus_defaults.rb.tt', - File.join(options[:initializer_directory], "#{options[:initializer_basename]}.rb") + File.join(options[:initializer_directory], "#{options[:initializer_basename]}.rb") end private diff --git a/core/spec/lib/generators/solidus/update/update_generator_spec.rb b/core/spec/lib/generators/solidus/update/update_generator_spec.rb index ab76a83d35a..90e0fc01fe6 100644 --- a/core/spec/lib/generators/solidus/update/update_generator_spec.rb +++ b/core/spec/lib/generators/solidus/update/update_generator_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Solidus::UpdateGenerator do let(:initializer_directory) { Rails.root.join('tmp') } let(:initializer) { File.join(initializer_directory, 'new_solidus_defaults.rb') } - let(:delete_initializer) { proc { File.delete(initializer) if File.exists?(initializer) }} + let(:delete_initializer) { proc { File.delete(initializer) if File.exist?(initializer) } } let(:invoke) do lambda do |from, to| Rails::Generators.invoke('solidus:update', [ @@ -32,10 +32,10 @@ expect(File.read(initializer)).to include( <<~RUBY - Spree.config do |config| - config.load_defaults('2.0') - # config.foo = false - end + Spree.config do |config| + config.load_defaults('2.0') + # config.foo = false + end RUBY ) end @@ -48,9 +48,9 @@ expect(File.read(initializer)).to include( <<~RUBY - Spree.config do |config| - # No changes - end + Spree.config do |config| + # No changes + end RUBY ) end @@ -69,10 +69,10 @@ expect(File.read(initializer)).to include( <<~RUBY - Spree::Frontend::Config.configure do |config| - config.load_defaults('2.0') - # config.foo = false - end + Spree::Frontend::Config.configure do |config| + config.load_defaults('2.0') + # config.foo = false + end RUBY ) end @@ -85,9 +85,9 @@ expect(File.read(initializer)).to include( <<~RUBY - Spree::Frontend::Config.configure do |config| - # No changes - end + Spree::Frontend::Config.configure do |config| + # No changes + end RUBY ) end @@ -106,10 +106,10 @@ expect(File.read(initializer)).to include( <<~RUBY - Spree::Backend::Config.configure do |config| - config.load_defaults('2.0') - # config.foo = false - end + Spree::Backend::Config.configure do |config| + config.load_defaults('2.0') + # config.foo = false + end RUBY ) end @@ -122,9 +122,9 @@ expect(File.read(initializer)).to include( <<~RUBY - Spree::Backend::Config.configure do |config| - # No changes - end + Spree::Backend::Config.configure do |config| + # No changes + end RUBY ) end @@ -143,10 +143,10 @@ expect(File.read(initializer)).to include( <<~RUBY - Spree::Api::Config.configure do |config| - config.load_defaults('2.0') - # config.foo = false - end + Spree::Api::Config.configure do |config| + config.load_defaults('2.0') + # config.foo = false + end RUBY ) end @@ -159,9 +159,9 @@ expect(File.read(initializer)).to include( <<~RUBY - Spree::Api::Config.configure do |config| - # No changes - end + Spree::Api::Config.configure do |config| + # No changes + end RUBY ) end