Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def self.load_engine_tasks(engine_class)
- desc "Generate sprites"
- task :sprites do
- require 'rails'
- require 'rails/active_sprites'
- Rails.module_eval do
- def self.application
- @@application ||= begin
- c = Class.new
- c.extend Rails::ActiveSprites
- # c.new
- end
- end
- end
- 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
Add Comment
Please, Sign In to add comment