Sha256: 7f07ea09417653eee34ff9332af70b67bfc34ba87a31f48dff8a8c43ff4ddab0

Contents?: true

Size: 886 Bytes

Versions: 1

Compression:

Stored size: 886 Bytes

Contents

module Hauler
  module Generators
    #:nodoc:
    class InstallGenerator < ::Rails::Generators::Base
      desc 'Copy Hauler configuration files'
      source_root File.expand_path('../templates', __FILE__)

      def copy_hauler_initializer
        template 'config/initializers/hauler.rb'
      end

      def copy_hauler_config
        template 'config/hauler.js'
      end

      def copy_eslintrc
        template 'eslintrc.json', '.eslintrc.json'
      end

      def copy_sass_lint_yml
        template 'sass-lint.yml', '.sass-lint.yml'
      end

      def copy_package_json
        has_package_json = File.exist?(Rails.root.join('package.json'))
        template 'package.json' if !has_package_json
      end

      def copy_webpack_config
        template 'webpack.config.js'
      end

      def install_npm
        generate 'hauler:install_npm'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hauler-0.2.0 lib/generators/hauler/install_generator.rb