Sha256: 065ff0a1f08501508bb4db7edda37a38ed58983822f6c91e38dc63b6c2645bc4

Contents?: true

Size: 983 Bytes

Versions: 8

Compression:

Stored size: 983 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/cms/'
        custom_js_folder = 'app/assets/javascripts/kuhsaft/cms/'

        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"
        copy_file 'ck-config.js.coffee', "#{custom_js_folder}/ck-config.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 kuhsaft/cms/ck-config.js )"
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
kuhsaft-2.4.0 lib/generators/kuhsaft/assets/install_generator.rb
kuhsaft-2.3.6 lib/generators/kuhsaft/assets/install_generator.rb
kuhsaft-2.3.5 lib/generators/kuhsaft/assets/install_generator.rb
kuhsaft-2.3.4 lib/generators/kuhsaft/assets/install_generator.rb
kuhsaft-2.3.3 lib/generators/kuhsaft/assets/install_generator.rb
kuhsaft-2.3.2 lib/generators/kuhsaft/assets/install_generator.rb
kuhsaft-2.3.1 lib/generators/kuhsaft/assets/install_generator.rb
kuhsaft-2.3.0 lib/generators/kuhsaft/assets/install_generator.rb