Sha256: 24135448854b2044598cb95918b83608583cc373c28f94859527fa3aff276a2e

Contents?: true

Size: 1.01 KB

Versions: 8

Compression:

Stored size: 1.01 KB

Contents

module PageflowScrolled
  module Generators
    # @api private
    class InstallGenerator < Rails::Generators::Base
      desc 'Installs Pageflow Scrolled entry type.'

      def install_webpacker
        require 'webpacker'
        gemfile = File.expand_path('../../../../../../Gemfile', __dir__)
        rake "webpacker:install BUNDLE_GEMFILE=#{gemfile}"
      end

      def webpack_environment
        inject_into_file('config/webpack/environment.js',
                         before: "module.exports = environment\n") do
          "const pageflowConfig = require('pageflow/config/webpack')\n" \
          "environment.config.merge(pageflowConfig)\n\n"
        end
      end

      def editor_pack
        create_file 'app/javascript/packs/pageflow-scrolled-editor.js', <<-JS
          import 'pageflow-scrolled/editor';
        JS
      end

      def frontend_pack
        create_file 'app/javascript/packs/pageflow-scrolled-frontend.js', <<-JS
          import 'pageflow-scrolled/frontend';
        JS
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pageflow-15.1.2 entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb
pageflow-15.1.1 entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb
pageflow-15.1.0 entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb
pageflow-15.1.0.rc0 entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb
pageflow-15.1.0.beta6 entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb
pageflow-15.1.0.beta5 entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb
pageflow-15.1.0.beta4 entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb
pageflow-15.1.0.beta3 entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb