Class: Elrte::Generators::AssetsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Elrte::Generators::AssetsGenerator
- Defined in:
- lib/generators/elrte/assets/assets_generator.rb
Class Method Summary collapse
-
.source_root ⇒ Object
class_option :bourbon, :type => :boolean, :default => true, :desc => “Generate Bourbon scss files if using Rails 3.0.x”.
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
class_option :bourbon, :type => :boolean, :default => true,
:desc => "Generate Bourbon scss files if using Rails 3.0.x"
class_option :jquery, :type => :boolean, :default => true,
:desc => "Generate jQuery js files if using Rails 3.0.x"
11 12 13 |
# File 'lib/generators/elrte/assets/assets_generator.rb', line 11 def self.source_root @_elrte_source_root ||= File.("../templates", __FILE__) end |
Instance Method Details
#install_assets ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/generators/elrte/assets/assets_generator.rb', line 15 def install_assets require 'rails' require 'elrte' if Elrte.use_asset_pipeline? template '3.1/elrte.js', 'app/assets/javascripts/elrte.js' template '3.1/elrte.css.scss', 'app/assets/stylesheets/elrte.css.scss' else #template '../../../../../app/assets/javascripts/active_admin/application.js', 'public/javascripts/active_admin.js' #directory '../../../../../app/assets/images/active_admin', 'public/images/active_admin' #generate "jquery:install --ui" if options.jquery? #install_bourbon if options.bourbon? end end |