Sha256: ca0821292f3b25890f5c842a739b7faf5e4b4ad433ec52455db6e68c6dac8443

Contents?: true

Size: 503 Bytes

Versions: 12

Compression:

Stored size: 503 Bytes

Contents

require 'headhunter'
require 'headhunter/rack/capturing_middleware'

if ENV['HEADHUNTER'] == 'true'
  module Headhunter
    module Rails
      class Railtie < ::Rails::Railtie
        initializer "headhunter.hijack" do |app|
          head_hunter = Runner.new(::Rails.root)

          at_exit do
            head_hunter.report
            head_hunter.clean_up!
          end

          app.middleware.insert(0, Headhunter::Rack::CapturingMiddleware, head_hunter)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
headhunter-0.1.7 lib/headhunter/rails.rb
headhunter-0.1.6 lib/headhunter/rails.rb
headhunter-0.1.5 lib/headhunter/rails.rb
headhunter-0.1.4 lib/headhunter/rails.rb
headhunter-0.1.3 lib/headhunter/rails.rb
headhunter-0.1.2 lib/headhunter/rails.rb
headhunter-0.1.1 lib/headhunter/rails.rb
headhunter-0.1.0 lib/headhunter/rails.rb
headhunter-0.0.9 lib/headhunter/rails.rb
headhunter-0.0.8 lib/headhunter/rails.rb
headhunter-0.0.7 lib/headhunter/rails.rb
headhunter-0.0.5 lib/headhunter/rails.rb