class Kiqr::Frontend::Generators::InstallGenerator

Public Instance Methods

check_webpacker_installed() click to toggle source
# File lib/generators/kiqr/frontend/install_generator.rb, line 9
def check_webpacker_installed
  return if Object.const_defined?('Webpacker')

  say 'Please install webpacker first.', :red
  exit
end
install_helpers() click to toggle source
# File lib/generators/kiqr/frontend/install_generator.rb, line 31
def install_helpers
  directory 'app/helpers', 'app/helpers'
end
install_initializers() click to toggle source
# File lib/generators/kiqr/frontend/install_generator.rb, line 35
def install_initializers
  directory 'config/initializers', 'config/initializers'
end
install_locales() click to toggle source
# File lib/generators/kiqr/frontend/install_generator.rb, line 39
def install_locales
  directory 'config/locales', 'config/locales'
end
install_tailwindcss() click to toggle source
# File lib/generators/kiqr/frontend/install_generator.rb, line 16
def install_tailwindcss
  rails_command('tailwindcss:install')
end
install_view_files() click to toggle source
# File lib/generators/kiqr/frontend/install_generator.rb, line 27
def install_view_files
  directory 'app/views', 'app/views'
end
replace_stylesheets() click to toggle source
# File lib/generators/kiqr/frontend/install_generator.rb, line 20
def replace_stylesheets
  stylesheets_path = Webpacker.config.source_path.join('stylesheets')
  run "rm -rf #{stylesheets_path}/application.scss"
  run "rm -rf #{stylesheets_path}/tailwind.config.js"
  directory 'lib/generators/templates/stylesheets', stylesheets_path
end