Sha256: f6aacb4b008daef829c0da20d41e580589d72daf9c4d2df4c78ae2f2a2e9f932

Contents?: true

Size: 684 Bytes

Versions: 2

Compression:

Stored size: 684 Bytes

Contents

module Hawkei
  module Plugins
    module Rails
      class Railtie < ::Rails::Railtie

        initializer 'hawkei.middleware' do |app|
          app.config.middleware.use(Hawkei::Plugins::Rack::Middleware)

          if ActiveSupport.const_defined?(:Reloader) && ActiveSupport::Reloader.respond_to?(:to_complete)
            ActiveSupport::Reloader.to_complete do
              Hawkei::Store.clear!
            end
          elsif ActionDispatch.const_defined?(:Reloader) && ActionDispatch::Reloader.respond_to?(:to_cleanup)
            ActionDispatch::Reloader.to_cleanup do
              Hawkei::Store.clear!
            end
          end
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hawkei-1.1.0 lib/hawkei/plugins/rails/railtie.rb
hawkei-1.0.0 lib/hawkei/plugins/rails/railtie.rb