Sha256: 4e2e844d9e8328eab43bfdd7d25fef7490bb82c311f46e93512582d4b74709c9

Contents?: true

Size: 876 Bytes

Versions: 2

Compression:

Stored size: 876 Bytes

Contents

require 'rails/generators'

module Kuhsaft
  module Assets
    class Install < Rails::Generators::Base
      source_root(File.join(Kuhsaft::Engine.root, '/lib/templates/kuhsaft/assets'))

      def copy_customizations
        custom_css_folder = 'app/assets/stylesheets/kuhsaft/foo/'
        custom_js_folder = 'app/assets/javascripts/kuhsaft/foo/'
        empty_directory custom_css_folder
        empty_directory custom_js_folder
        copy_file 'customizations.css.sass', "#{custom_css_folder}/customizations.css.sass"
        copy_file 'customizations.js.coffee', "#{custom_js_folder}/customizations.js.coffee"
        inject_into_file 'config/environments/production.rb', :after => /config\.assets\.precompile.*$/ do
          "\n  config.assets.precompile += %w( kuhsaft/cms/customizations.css kuhsaft/cms/customizations.js )"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kuhsaft-1.2.7 lib/generators/kuhsaft/assets/install_generator.rb
kuhsaft-1.2.6 lib/generators/kuhsaft/assets/install_generator.rb