Top Level Namespace

Constant Summary collapse

HEROKU_CONFIG_FILE =
File.join(RAILS_ROOT, 'config', 'heroku.yml')
HEROKU_SETTINGS =
if File.exists?(HEROKU_CONFIG_FILE)
  YAML.load_file(HEROKU_CONFIG_FILE)
else
  {}
end

Instance Method Summary collapse

Instance Method Details

#each_heroku_appObject



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/heroku_san/tasks.rb', line 175

def each_heroku_app
  if @heroku_apps.blank? && HEROKU_SETTINGS['apps'].size == 1
    app = HEROKU_SETTINGS['apps'].keys.first
    puts "Defaulting to #{app} app since only one app is defined"
    @heroku_apps = [app]
  end
  if @heroku_apps.present?
    @heroku_apps.each do |name|
      app = HEROKU_SETTINGS['apps'][name]
      yield(name, app, "[email protected]:#{app}.git")
    end
    puts
  else
    puts "You must first specify at least one Heroku app:
      rake <app> [<app>] <command>
      rake production restart
      rake demo staging deploy"

    puts "\nYou can use also command all Heroku apps for this project:
      rake all heroku:share"

    exit(1)
  end
end

#system_with_echo(*args) ⇒ Object



170
171
172
173
# File 'lib/heroku_san/tasks.rb', line 170

def system_with_echo(*args)
  puts args.join(' ')
  system(*args)
end