Sha256: bc81dd0681201cacac4c669c7876f4bfe53e98f061b34073a52b1095675e1630

Contents?: true

Size: 691 Bytes

Versions: 3

Compression:

Stored size: 691 Bytes

Contents

class GulpAssetsGenerator < Rails::Generators::Base
  desc "Setup up the folder structure for Gulp Assets"
  source_root File.expand_path('../../../template', __FILE__)

  def create_frontend_folder
    directory 'frontend'
    copy_file ".eslintrc"
  end

  def create_webpack_config
    copy_file 'webpack.common.config.js'
    copy_file 'webpack.config.js'
    copy_file 'webpack.hot.config.js' # TODO replace host dynamically
  end

  def create_gulpfile
    copy_file 'gulpfile.js'
  end

  def create_module
    copy_file "package.json"
    gsub_file 'package.json', "gulp-assets", Rails.application.class.parent_name
  end

  def install_dependencies
    run "npm install"
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gulp_assets-1.0.0.pre.5 lib/generators/gulp_assets_generator.rb
gulp_assets-1.0.0.pre.4 lib/generators/gulp_assets_generator.rb
gulp_assets-1.0.0.pre.3 lib/generators/gulp_assets_generator.rb