features/support/rails.rb in airbrake-4.1.0 vs features/support/rails.rb in airbrake-4.2.0

- old
+ new

@@ -22,20 +22,20 @@ def application_controller_filename controller_filename = File.join(rails_root, 'app', 'controllers', "application_controller.rb") end - def rails3? - rails_version =~ /^3/ + def rails_3_or_4? + rails_version =~ /\A[34]/ end def rails_root LOCAL_RAILS_ROOT end def rails_uses_rack? - rails3? || rails_version =~ /^2\.3/ + rails_3_or_4? || rails_version =~ /^2\.3/ end def rails_version @rails_version ||= begin if ENV["RAILS_VERSION"] @@ -56,18 +56,18 @@ def gemfile_path gemfile = File.join(rails_root, 'Gemfile') end def rails_manages_gems? - rails_version =~ /^2\.[123]/ + rails_version =~ /\A2\.[123]/ end def rails_supports_initializers? - rails3? || rails_version =~ /^2\./ + rails_3_or_4? || rails_version =~ /\A2\./ end def rails_finds_generators_in_gems? - rails3? || rails_version =~ /^2\./ + rails_3_or_4? || rails_version =~ /\A2\./ end def version_string ENV['RAILS_VERSION'] || `tail -n 1 SUPPORTED_RAILS_VERSIONS` # use latest version if ENV["RAILS_VERSION"] is undefined end