Sha256: d570e2d04698f339ecd0821bdd0a59d27710054279c4de96867841bd8d8254c5

Contents?: true

Size: 1.08 KB

Versions: 5

Compression:

Stored size: 1.08 KB

Contents

require 'yaml'

module SpotlightSearch
  module Generators
    class InstallGenerator < Rails::Generators::Base
      source_root File.expand_path('templates', __dir__)

      def copy_webpacker_gem_assets
        copy_file 'webpacker_gem_assets.rb', 'config/initializers/webpacker_gem_assets.rb'
        copy_file 'webpacker.yml', 'config/webpacker.yml'
        copy_file 'environment.js', 'config/webpack/environment.js'
        copy_file 'coffee.js', 'config/webpack/loaders/coffee.js'
        copy_file 'spotlight_search.rb', 'config/initializers/spotlight_search.rb'
        copy_file 'application.css.scss', 'app/assets/stylesheets/application.css.scss'
        route "mount SpotlightSearch::Engine => '/spotlight_search'"
      end

      def add_essentials
        system("yarn add jquery coffeescript coffee-loader select2 popper.js daterangepicker bootstrap-datepicker")
        template "application.js", "app/javascript/packs/application.js"
        template 'scaffolds.coffee', "app/javascript/application/coffee_scripts/scaffolds.coffee"
        gem 'kaminari'
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spotlight_search-0.3.4 lib/generators/spotlight_search/install_generator.rb
spotlight_search-0.3.3 lib/generators/spotlight_search/install_generator.rb
spotlight_search-0.3.2 lib/generators/spotlight_search/install_generator.rb
spotlight_search-0.3.1 lib/generators/spotlight_search/install_generator.rb
spotlight_search-0.3.0 lib/generators/spotlight_search/install_generator.rb