Sha256: 8ff4d1596b37fbc171650cf23789814024263d44576342678fcb80f592cea205

Contents?: true

Size: 955 Bytes

Versions: 2

Compression:

Stored size: 955 Bytes

Contents

require 'active_support'

module ActiveAssets
  module ActiveSprites
    extend ActiveSupport::Autoload

    autoload :SpritePiece
    autoload :Sprite
    autoload :Sprites
    autoload :Configurable
    autoload :SpriteStylesheet
    autoload_under "runners" do
      autoload :AbstractRunner
      autoload :RmagickRunner
      autoload :MiniMagickRunner
      autoload :ChunkyPngRunner
    end

    def self.load_engine_tasks(engine_class)
      desc "Generate sprites"
      task :sprites do
        require 'rails'
        require 'rails/active_sprites'

        Rails.application ||= Class.new(Rails::Application)
        Rails.application.extend Rails::ActiveSprites

        engine = engine_class.new
        sprite_path = File.join(engine.config.paths.config.paths.first, 'sprites.rb')

        if File.exists?(sprite_path)
          load sprite_path
          Rails.application.sprites.generate!(engine)
        end
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_assets-0.2.5 lib/active_assets/active_sprites.rb
active_assets-0.2.4 lib/active_assets/active_sprites.rb