Sha256: 3f5ea0da0209e3a50a23069cfb0513e141d789f724cedd617deb606a9242f512

Contents?: true

Size: 966 Bytes

Versions: 6

Compression:

Stored size: 966 Bytes

Contents

require 'rails'
require 'rails/active_sprites'
require 'active_assets/active_sprites'

module ActiveAssets
  module ActiveSprites
    class Railtie < Rails::Railtie
      rake_tasks do
        Dir[File.expand_path("../../../tasks/active_sprites/*.rake", __FILE__)].each {|f| load f}
      end

      initializer 'active_sprites-extend-application' do
        Rails.application.extend(Rails::ActiveSprites)
      end

      initializer 'active_sprites-load-definitons' do
        Rails.application.config.paths.config.paths.each {|config_path| load_sprite_definition(config_path) }
        Rails.application.railties.engines.map(&:config).map(&:paths).map(&:config).map(&:paths).each do |config_path|
          load_sprite_definition(config_path)
        end
      end

      private
        def load_sprite_definition(config_path)
          load File.join(config_path, 'sprites.rb') if File.exists?(File.join(config_path, 'sprites.rb'))
        end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
active_assets-0.2.1 lib/active_assets/active_sprites/railtie.rb
active_assets-0.2.0 lib/active_assets/active_sprites/railtie.rb
active_assets-0.2.0.rc4 lib/active_assets/active_sprites/railtie.rb
active_assets-0.2.0.rc3 lib/active_assets/active_sprites/railtie.rb
active_assets-0.2.0.rc2 lib/active_assets/active_sprites/railtie.rb
active_assets-0.2.0.rc lib/active_assets/active_sprites/railtie.rb