Sha256: c87477ee9fe29de60a0658243c62b16601db527983b42dd6907cbdfc582569c2

Contents?: true

Size: 990 Bytes

Versions: 12

Compression:

Stored size: 990 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'

        ENV['VERBOSE'] ||= 'true'

        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

12 entries across 12 versions & 1 rubygems

Version Path
active_assets-1.1.3 lib/active_assets/active_sprites.rb
active_assets-1.1.2 lib/active_assets/active_sprites.rb
active_assets-1.1.1 lib/active_assets/active_sprites.rb
active_assets-1.0.3 lib/active_assets/active_sprites.rb
active_assets-1.1.0 lib/active_assets/active_sprites.rb
active_assets-1.0.2 lib/active_assets/active_sprites.rb
active_assets-1.0.1 lib/active_assets/active_sprites.rb
active_assets-1.0.0 lib/active_assets/active_sprites.rb
active_assets-1.0.0.rc1 lib/active_assets/active_sprites.rb
active_assets-0.2.8 lib/active_assets/active_sprites.rb
active_assets-0.2.7 lib/active_assets/active_sprites.rb
active_assets-0.2.6 lib/active_assets/active_sprites.rb