Permalink
Browse files

Heroku is still using HOPTOAD_API_KEY, so expect that for now

  • Loading branch information...
1 parent 13a62f2 commit a956746f9c7cfb95a033aac9fb75fe5024aca22f Harold Giménez committed Aug 26, 2011
View
@@ -140,7 +140,7 @@ Feature: Install the Gem in a Rails application
And I should see the Rails version
And my Airbrake configuration should contain the following line:
"""
- config.api_key = ENV['AIRBRAKE_API_KEY']
+ config.api_key = ENV['HOPTOAD_API_KEY']
"""
Scenario: Support the --app option for the Heroku addon in the generator
@@ -155,7 +155,7 @@ Feature: Install the Gem in a Rails application
And I should see the Rails version
And my Airbrake configuration should contain the following line:
"""
- config.api_key = ENV['AIRBRAKE_API_KEY']
+ config.api_key = ENV['HOPTOAD_API_KEY']
"""
Scenario: Filtering parameters in a controller
@@ -308,14 +308,14 @@ def rails_non_initializer_airbrake_config_file
heroku_script = File.join(heroku_script_bin, "heroku")
single_app_script = <<-SINGLE
#!/bin/bash
- if [[ $1 == 'console' && $2 == 'puts ENV[%{AIRBRAKE_API_KEY}]' ]]; then
+ if [[ $1 == 'console' && $2 == 'puts ENV[%{HOPTOAD_API_KEY}]' ]]; then
echo #{api_key}
fi
SINGLE
multi_app_script = <<-MULTI
#!/bin/bash
- if [[ $1 == 'console' && $2 == '--app' && $4 == 'puts ENV[%{AIRBRAKE_API_KEY}]' ]]; then
+ if [[ $1 == 'console' && $2 == '--app' && $4 == 'puts ENV[%{HOPTOAD_API_KEY}]' ]]; then
echo #{api_key}
fi
MULTI
@@ -42,33 +42,33 @@ def api_key_expression
s = if options[:api_key]
"'#{options[:api_key]}'"
elsif options[:heroku]
- "ENV['AIRBRAKE_API_KEY']"
+ "ENV['HOPTOAD_API_KEY']"
end
end
def determine_api_key
puts "Attempting to determine your API Key from Heroku..."
- ENV['AIRBRAKE_API_KEY'] = heroku_api_key
- if ENV['AIRBRAKE_API_KEY'].blank?
+ ENV['HOPTOAD_API_KEY'] = heroku_api_key
+ if ENV['HOPTOAD_API_KEY'].blank?
puts "... Failed."
puts "WARNING: We were unable to detect the Airbrake API Key from your Heroku environment."
puts "Your Heroku application environment may not be configured correctly."
exit 1
else
puts "... Done."
- puts "Heroku's Airbrake API Key is '#{ENV['AIRBRAKE_API_KEY']}'"
+ puts "Heroku's Airbrake API Key is '#{ENV['HOPTOAD_API_KEY']}'"
end
end
def heroku_api_key
app = options[:app] ? " --app #{options[:app]}" : ''
- `heroku console#{app} 'puts ENV[%{AIRBRAKE_API_KEY}]'`.split("\n").first
+ `heroku console#{app} 'puts ENV[%{HOPTOAD_API_KEY}]'`.split("\n").first
end
def heroku?
options[:heroku] ||
- system("grep AIRBRAKE_API_KEY config/initializers/airbrake.rb") ||
- system("grep AIRBRAKE_API_KEY config/environment.rb")
+ system("grep HOPTOAD_API_KEY config/initializers/airbrake.rb") ||
+ system("grep HOPTOAD_API_KEY config/environment.rb")
end
def use_initializer?
@@ -18,7 +18,7 @@
namespace :heroku do
desc "Install Heroku deploy notifications addon"
task :add_deploy_notification => [:environment] do
- heroku_api_key = `heroku console 'puts ENV[%{AIRBRAKE_API_KEY}]' | head -n 1`.strip
+ heroku_api_key = `heroku console 'puts ENV[%{HOPTOAD_API_KEY}]' | head -n 1`.strip
heroku_rails_env = `heroku console 'puts RAILS_ENV' | head -n 1`.strip
command = %Q(heroku addons:add deployhooks:http url="http://airbrakeapp.com/deploys.txt?deploy[rails_env]=#{heroku_rails_env}&api_key=#{heroku_api_key}")
@@ -49,7 +49,7 @@ def api_key_expression
s = if options[:api_key]
"'#{options[:api_key]}'"
elsif options[:heroku]
- "ENV['AIRBRAKE_API_KEY']"
+ "ENV['HOPTOAD_API_KEY']"
end
end
@@ -59,27 +59,27 @@ def generate_initializer
def determine_api_key
puts "Attempting to determine your API Key from Heroku..."
- ENV['AIRBRAKE_API_KEY'] = heroku_api_key
- if ENV['AIRBRAKE_API_KEY'].blank?
+ ENV['HOPTOAD_API_KEY'] = heroku_api_key
+ if ENV['HOPTOAD_API_KEY'].blank?
puts "... Failed."
puts "WARNING: We were unable to detect the Airbrake API Key from your Heroku environment."
puts "Your Heroku application environment may not be configured correctly."
exit 1
else
puts "... Done."
- puts "Heroku's Airbrake API Key is '#{ENV['AIRBRAKE_API_KEY']}'"
+ puts "Heroku's Airbrake API Key is '#{ENV['HOPTOAD_API_KEY']}'"
end
end
def heroku_api_key
app = options[:app] ? " --app #{options[:app]}" : ''
- `heroku console#{app} 'puts ENV[%{AIRBRAKE_API_KEY}]'`.split("\n").first
+ `heroku console#{app} 'puts ENV[%{HOPTOAD_API_KEY}]'`.split("\n").first
end
def heroku?
options[:heroku] ||
- system("grep AIRBRAKE_API_KEY config/initializers/airbrake.rb") ||
- system("grep AIRBRAKE_API_KEY config/environment.rb")
+ system("grep HOPTOAD_API_KEY config/initializers/airbrake.rb") ||
+ system("grep HOPTOAD_API_KEY config/environment.rb")
end
def api_key_configured?

0 comments on commit a956746

Please sign in to comment.