lib/tasks.rb in heroku_san-2.1.0 vs lib/tasks.rb in heroku_san-2.1.1

- old
+ new

@@ -18,11 +18,11 @@ end desc "Creates the Heroku app" task :create do each_heroku_app do |stage| - stage.create + puts "#{stage.name}: Created #{stage.create}" end end #desc "Generate the Heroku gems manifest from gem dependencies" task :gems => 'gems:base' do @@ -80,20 +80,20 @@ end desc 'Add config:vars to each application.' task :config do each_heroku_app do |stage| - stage.push_config + puts y(stage.push_config) end end desc 'Creates an example configuration file' task :create_config do filename = %Q{#{@heroku_san.config_file.to_s}} if @heroku_san.create_config puts "Copied example config to #{filename.inspect}" - if ENV['EDITOR'].present? + if ENV['EDITOR'] && ENV['EDITOR'] != '' sh "#{ENV['EDITOR']} #{filename}" else puts "Please edit #{filename.inspect} with your application's settings." end else @@ -107,39 +107,38 @@ each_heroku_app do |stage| command = "heroku config --app #{stage.app}" puts command config = Hash[`#{command}`.scan(/^(.+?)\s*=>\s*(.+)$/)] if config['RACK_ENV'] != stage.name - stage.push_config RACK_ENV: stage.name + puts stage.push_config RACK_ENV: stage.name end end end desc "Lists config variables as set on Heroku" task :list do each_heroku_app do |stage| puts "#{stage.name}:" - stage.long_config + puts y(stage.long_config) end end namespace :list do desc "Lists local config variables without setting them" task :local do each_heroku_app do |stage| - (stage.config).each do |var, value| - puts "#{stage.name} #{var}: '#{value}'" - end + puts "#{stage.name}:" + puts y(stage.config) end end end end desc 'Runs a rake task remotely' task :rake, [:task] do |t, args| each_heroku_app do |stage| - stage.run 'rake', args.task + puts stage.rake args.task end end desc "Pushes the given commit (default: HEAD)" task :push, :commit do |t, args| @@ -159,24 +158,27 @@ desc "Enable maintenance mode" task :maintenance do each_heroku_app do |stage| stage.maintenance :on + puts "#{stage.name}: Maintenance mode enabled." end end desc "Enable maintenance mode" task :maintenance_on do each_heroku_app do |stage| stage.maintenance :on + puts "#{stage.name}: Maintenance mode enabled." end end desc "Disable maintenance mode" task :maintenance_off do each_heroku_app do |stage| stage.maintenance :off + puts "#{stage.name}: Maintenance mode disabled." end end desc "Pushes the given commit, migrates and restarts (default: HEAD)" task :deploy, [:commit] => [:before_deploy] do |t, args| @@ -225,9 +227,10 @@ desc "Restarts remote servers" task :restart do each_heroku_app do |stage| stage.restart + puts "#{stage.name}: Restarted." end end namespace :logs do task :default do \ No newline at end of file