class AnchorUi::Webpacker::InstallGenerator

Public Instance Methods

copy_assets() click to toggle source
# File lib/generators/anchor_ui/webpacker/install_generator.rb, line 34
def copy_assets
  empty_directory packs_path
  filename = 'application.js'
  copy_file filename, packs_path.join(filename)

  empty_directory src_path
  %w(application _variables _coreui).each do |name|
    filename = "#{name}.scss"
    copy_file filename, src_path.join(filename)
  end
end
install_coreui() click to toggle source
# File lib/generators/anchor_ui/webpacker/install_generator.rb, line 17
def install_coreui
  # Versions referenced from https://github.com/coreui/coreui-free-bootstrap-admin-template/blob/v2.1.10/package.json
  yarn 'add @coreui/coreui@^2.1.3'
  yarn 'add @coreui/coreui-plugin-chartjs-custom-tooltips@1.2.0'
  yarn 'add @coreui/icons@0.3.0'
  yarn 'add popper.js@^1.14.5'
  yarn 'add simple-line-icons@2.4.1'
  yarn 'add perfect-scrollbar@1.4.0'
  yarn 'add pace@^0.0.4'
  yarn 'add pace-progress@1.0.2'
  yarn 'add jquery@3.3.1'
  yarn 'add font-awesome@4.7.0'
  yarn 'add flag-icon-css@^3.2.1'
  yarn 'add core-js@^2.5.7'
  yarn 'add chart.js@2.7.3'
end
install_railties() click to toggle source
# File lib/generators/anchor_ui/webpacker/install_generator.rb, line 12
def install_railties
  yarn 'add rails-ujs'
  yarn 'add turbolinks'
end
install_webpacker() click to toggle source
# File lib/generators/anchor_ui/webpacker/install_generator.rb, line 8
def install_webpacker
  rake 'webpacker:install'
end
override_layout() click to toggle source
# File lib/generators/anchor_ui/webpacker/install_generator.rb, line 46
def override_layout
  generate_layout 'pack', 'pack', 'style'
end

Private Instance Methods

javascript_path() click to toggle source
# File lib/generators/anchor_ui/webpacker/install_generator.rb, line 52
def javascript_path
  Pathname.new 'app/javascript'
end
packs_path() click to toggle source
# File lib/generators/anchor_ui/webpacker/install_generator.rb, line 56
def packs_path
  javascript_path.join 'packs'
end
src_path() click to toggle source
# File lib/generators/anchor_ui/webpacker/install_generator.rb, line 60
def src_path
  javascript_path.join 'src'
end