Sha256: 0e57425e62afa5c50b0a7a64e613d77027aecbec98b2bd3d925f87bea1f4c89a

Contents?: true

Size: 792 Bytes

Versions: 1

Compression:

Stored size: 792 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_config_hauler
        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.1.0 lib/generators/hauler/install_generator.rb