Sha256: 0b160b6063b065962792e7eb8521362c3603d3b8e60595dd02fad3866d4bcb67

Contents?: true

Size: 1.11 KB

Versions: 8

Compression:

Stored size: 1.11 KB

Contents

module Dashing
  class Railtie < ::Rails::Railtie

    initializer 'configure assets' do |app|
      app.configure do
        config.assets.paths.unshift       Dashing::Engine.root.join('vendor', 'assets', 'fonts', 'dashing')
        config.assets.paths.unshift       Dashing::Engine.root.join('vendor', 'assets', 'javascripts', 'dashing')
        config.assets.paths.unshift       Dashing::Engine.root.join('vendor', 'assets', 'stylesheets', 'dashing')
        config.assets.paths.unshift       Dashing.config.widgets_js_path
        config.assets.paths.unshift       Dashing.config.widgets_css_path

        config.assets.precompile << /\.(?:svg|eot|woff|ttf)$/
      end
    end

    initializer 'require dashing jobs' do
      Dir[Dashing.config.jobs_path.join('**', '*.rb')].each { |file| require file }
    end

    initializer 'fix redis child connection' do
      if defined?(::PhusionPassenger)
        ::PhusionPassenger.on_event(:starting_worker_process) do |forked|
          if forked
            ::Dashing.redis.client.disconnect
            ::Dashing.redis.client.connect
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dashing-rails-2.6.1 lib/dashing/railtie.rb
dashing-rails-2.6.0 lib/dashing/railtie.rb
dashing-rails-2.5.0 lib/dashing/railtie.rb
dashing-rails-2.4.5 lib/dashing/railtie.rb
dashing-rails-2.4.4 lib/dashing/railtie.rb
dashing-rails-2.4.3 lib/dashing/railtie.rb
dashing-rails-2.4.2 lib/dashing/railtie.rb
dashing-rails-2.4.1 lib/dashing/railtie.rb