File tree Expand file tree Collapse file tree 7 files changed +13
-11
lines changed
generators/solidus_promotions/install Expand file tree Collapse file tree 7 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ def generate_test_dummy
4646 opts [ :skip_javascript ] = true
4747 opts [ :skip_action_cable ] = true
4848
49- puts "Generating dummy Rails application..."
49+ say "Generating dummy Rails application..."
5050 invoke Rails ::Generators ::AppGenerator ,
5151 [ File . expand_path ( dummy_path , destination_root ) ] , opts
5252 end
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ class CommonRakeTasks
66 include Rake ::DSL
77
88 def initialize
9+ Rails . logger ||= Logger . new ( $stdout)
910 namespace :common do
1011 task :test_app , :user_class do |_t , args |
1112 args . with_defaults ( user_class : "Spree::LegacyUser" )
@@ -45,19 +46,19 @@ def initialize
4546 sh "bin/rails g solidus_frontend:install --auto-accept"
4647 end
4748
48- puts "Setting up dummy database..."
49+ Rails . logger . info "Setting up dummy database..."
4950
5051 sh "bin/rails db:environment:set RAILS_ENV=test"
5152 sh "bin/rails db:drop db:create db:migrate VERBOSE=false RAILS_ENV=test"
5253
5354 if extension_installation_generator_exists?
54- puts 'Running extension installation generator...'
55+ Rails . logger . info 'Running extension installation generator...'
5556 sh "bin/rails generate #{ rake_generator_namespace } :install --auto-run-migrations"
5657 end
5758 end
5859
5960 task :seed do |_t , _args |
60- puts "Seeding ..."
61+ Rails . logger . info "Seeding ..."
6162
6263 sh "bundle exec rake db:seed RAILS_ENV=test"
6364 end
Original file line number Diff line number Diff line change 1010require 'active_storage/engine'
1111
1212Rails . env = 'test'
13+ Rails . logger ||= Logger . new ( $stdout)
1314
1415require 'solidus_core'
1516
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ module Migrations
66
77 def auto_migrate
88 if needs_migration?
9- puts "Configuration changed. Re-running migrations"
9+ Rails . logger . info "Configuration changed. Re-running migrations"
1010
1111 # Disconnect to avoid "database is being accessed by other users" on postgres
1212 ActiveRecord ::Base . remove_connection
@@ -29,7 +29,7 @@ def needs_migration?
2929 end
3030
3131 def sh ( cmd )
32- puts cmd
32+ Rails . logger . info cmd
3333 system cmd
3434 end
3535 end
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ module Translations
66 def check_missing_translations ( page , example )
77 missing_translations = page . body . scan ( /translation missing: #{ I18n . locale } \. (.*?)[\s <\" &]/ )
88 if missing_translations . any?
9- puts "Found missing translations: #{ missing_translations . inspect } "
10- puts "In spec: #{ example . location } "
9+ Rails . logger . info "Found missing translations: #{ missing_translations . inspect } "
10+ Rails . logger . info "In spec: #{ example . location } "
1111 end
1212 end
1313 end
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def run_migrations
4141 if run_migrations
4242 run "bin/rails db:migrate"
4343 else
44- puts "Skipping bin/rails db:migrate, don't forget to run it!"
44+ Rails . logger . info "Skipping bin/rails db:migrate, don't forget to run it!"
4545 end
4646 end
4747
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def copy_promotion(old_promotion)
7878 def generate_new_benefits ( old_promotion_action )
7979 promo_action_config = promotion_map [ :actions ] [ old_promotion_action . class ]
8080 if promo_action_config . nil?
81- puts ( "#{ old_promotion_action . class } is not supported" )
81+ Rails . logger . info ( "#{ old_promotion_action . class } is not supported" )
8282 return nil
8383 end
8484 promo_action_config . call ( old_promotion_action )
@@ -87,7 +87,7 @@ def generate_new_benefits(old_promotion_action)
8787 def generate_new_promotion_conditions ( old_promotion_rule )
8888 new_promo_condition_class = promotion_map [ :conditions ] [ old_promotion_rule . class ]
8989 if new_promo_condition_class . nil?
90- puts ( "#{ old_promotion_rule . class } is not supported" )
90+ Rails . logger . info ( "#{ old_promotion_rule . class } is not supported" )
9191 [ ]
9292 elsif new_promo_condition_class . respond_to? ( :call )
9393 new_promo_condition_class . call ( old_promotion_rule )
You can’t perform that action at this time.
0 commit comments