Sha256: 8577f20109f0d84284f0e8dbd2d3990b4fde726ccfb1928e51022f9f4c0d026e
Contents?: true
Size: 1.28 KB
Versions: 56
Compression:
Stored size: 1.28 KB
Contents
module ActiveAdmin module Generators class AssetsGenerator < Rails::Generators::Base 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" def self.source_root @_active_admin_source_root ||= File.expand_path("../templates", __FILE__) end def install_assets require 'rails' require 'active_admin' if ActiveAdmin.use_asset_pipeline? template '3.1/active_admin.js', 'app/assets/javascripts/active_admin.js' template '3.1/active_admin.css.scss', 'app/assets/stylesheets/active_admin.css.scss' else template '3.0/active_admin.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 private def install_bourbon rake "bourbon:install" create_file "public/stylesheets/sass/_bourbon.scss", '@import "bourbon/bourbon"' end end end end
Version data entries
56 entries across 56 versions & 2 rubygems