Sha256: 0335263d3fa4c275f275a39e8e4d601ce3bdcfa74b559f71558e6e8dfca4564d

Contents?: true

Size: 1.09 KB

Versions: 21

Compression:

Stored size: 1.09 KB

Contents

module Pageflow
  module Generators
    class AssetsGenerator < Rails::Generators::Base
      desc "Install the pageflow assets."

      source_root File.expand_path("../templates", __FILE__)

      def create_assets
        template 'editor.js', 'app/assets/javascripts/pageflow/editor.js'
        template 'editor.css.scss', 'app/assets/stylesheets/pageflow/editor.css.scss'

        template 'application.js', 'app/assets/javascripts/pageflow/application.js'
        template 'application.css.scss', 'app/assets/stylesheets/pageflow/application.css.scss'

        append_to_file 'app/assets/javascripts/active_admin.js.coffee' do
          "#= require pageflow/admin\n"
        end

        append_to_file 'app/assets/stylesheets/active_admin.css.scss' do
          "@import \"pageflow/admin\";\n"
        end
      end

      def initialize_on_precompile
        inject_into_file 'config/application.rb', after: "class Application < Rails::Application\n" do
          "    # required for i18n-js gem\n" +
          "    config.assets.initialize_on_precompile = true\n\n"
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
pageflow-0.10.0 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.9.2 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.9.1 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.9.0 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.8.2 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.8.1 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.8.0 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.7.2 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.7.1 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.7.0 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.6.0 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.5.0 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.4.0 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.3.0 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.2.1 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.2.0 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.1.0 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.0.5 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.0.4 lib/generators/pageflow/assets/assets_generator.rb
pageflow-0.0.3 lib/generators/pageflow/assets/assets_generator.rb