Class: Integral::Generators::AssetsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/integral/assets_generator.rb

Overview

Generates a copy of Integral assets

Examples:

Generate all Integral assets

rails g integral:assets --assets 'backend frontend email'

Instance Method Summary collapse

Instance Method Details

#copy_backend_assetsObject

Copies over backend assets



14
15
16
17
18
19
20
# File 'lib/generators/integral/assets_generator.rb', line 14

def copy_backend_assets
  return unless options['asset_list'].include?('backend')

  file 'javascripts/integral/backend.js'
  file 'stylesheets/integral/backend.sass'
  directory 'stylesheets/integral/backend'
end

#copy_frontend_assetsObject

Copies over frontend assets



23
24
25
26
27
28
29
# File 'lib/generators/integral/assets_generator.rb', line 23

def copy_frontend_assets
  return unless options['asset_list'].include?('frontend')

  file 'javascripts/integral/frontend.js'
  file 'stylesheets/integral/frontend.scss'
  directory 'stylesheets/integral/frontend'
end

#copy_mailer_assetsObject

Copies over mailer assets



32
33
34
35
36
37
# File 'lib/generators/integral/assets_generator.rb', line 32

def copy_mailer_assets
  return unless options['asset_list'].include?('email')

  file 'stylesheets/integral/emails.scss'
  directory 'stylesheets/integral/emails'
end