Sha256: 6199a7e5fb0fe02dbabb9428675b19958ec23598510eef835c10fd48a4f955a5

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 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.call.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

1 entries across 1 versions & 1 rubygems

Version Path
dashing-rails-2.4.0 lib/dashing/railtie.rb