diff --git a/SUPPORTED_RAILS_VERSIONS b/SUPPORTED_RAILS_VERSIONS index 8a923f7..84b387e 100644 --- a/SUPPORTED_RAILS_VERSIONS +++ b/SUPPORTED_RAILS_VERSIONS @@ -6,4 +6,4 @@ 2.3.2 2.3.4 2.3.5 -3.0.0.beta +3.0.0.beta3 diff --git a/features/rails.feature b/features/rails.feature index fa24f94..0fdfcb7 100644 --- a/features/rails.feature +++ b/features/rails.feature @@ -22,7 +22,7 @@ Feature: Install the Gem in a Rails application When I uninstall the "hoptoad_notifier" gem And I install cached gems And I run "rake hoptoad:test" - Then the command should have run successfully + Then I should see "** [Hoptoad] Success: Net::HTTPOK" And I should receive two Hoptoad notifications Scenario: Configure the notifier by hand diff --git a/features/step_definitions/rails_application_steps.rb b/features/step_definitions/rails_application_steps.rb index 33ca10b..36b2697 100644 --- a/features/step_definitions/rails_application_steps.rb +++ b/features/step_definitions/rails_application_steps.rb @@ -4,22 +4,14 @@ @terminal.cd(TEMP_DIR) version_string = ENV['RAILS_VERSION'] - rails3 = version_string =~ /^3/ - - if rails3 - rails_binary_gem = 'railties' - else - rails_binary_gem = 'rails' - end - load_rails = <<-RUBY - gem '#{rails_binary_gem}', '#{version_string}'; \ - load Gem.bin_path('#{rails_binary_gem}', 'rails', '#{version_string}') + gem 'rails', '#{version_string}'; \ + load Gem.bin_path('rails', 'rails', '#{version_string}') RUBY @terminal.run(%{ruby -rubygems -e "#{load_rails.strip!}" rails_root}) if rails_root_exists? - @terminal.echo("Generated a Rails #{rails_version} application") + @terminal.echo("Generated a Rails #{version_string} application") else raise "Unable to generate a Rails application:\n#{@terminal.output}" end diff --git a/features/support/rails.rb b/features/support/rails.rb index 531d712..fb68d35 100644 --- a/features/support/rails.rb +++ b/features/support/rails.rb @@ -14,7 +14,7 @@ def rails_uses_rack? def rails_version @rails_version ||= begin if bundler_manages_gems? - rails_version = open(gemfile_path).read.match(/gem.*rails".*"(.+)"/)[1] + rails_version = open(gemfile_path).read.match(/gem.*rails["'].*["'](.+)["']/)[1] else environment_file = File.join(RAILS_ROOT, 'config', 'environment.rb') rails_version = `grep RAILS_GEM_VERSION #{environment_file}`.match(/[\d.]+/)[0] diff --git a/lib/hoptoad_notifier/railtie.rb b/lib/hoptoad_notifier/railtie.rb index 1d822a0..0c4486d 100644 --- a/lib/hoptoad_notifier/railtie.rb +++ b/lib/hoptoad_notifier/railtie.rb @@ -7,7 +7,9 @@ class Railtie < Rails::Railtie require "hoptoad_notifier/rails3_tasks" end - config.app_middleware.insert_after "::ActionDispatch::ShowExceptions", "HoptoadNotifier::Rack" + initializer "hoptoad.use_rack_middleware" do |app| + app.config.middleware.insert_after "::ActionDispatch::ShowExceptions", "HoptoadNotifier::Rack" + end config.after_initialize do HoptoadNotifier.configure(true) do |config|