class Integral::Generators::AssetsGenerator

Generates a copy of Integral assets

@example Generate all Integral assets

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

Public Instance Methods

copy_backend_assets() click to toggle source

Copies over backend assets

# 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_assets() click to toggle source

Copies over frontend assets

# 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_assets() click to toggle source

Copies over mailer assets

# 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

Private Instance Methods

directory(source, destination = nil) click to toggle source
Calls superclass method
# File lib/generators/integral/assets_generator.rb, line 41
def directory(source, destination = nil)
  destination = "app/assets/#{source}" if destination.nil?

  super(source, destination)
end
file(source, destination = nil) click to toggle source
# File lib/generators/integral/assets_generator.rb, line 47
def file(source, destination = nil)
  destination = "app/assets/#{source}" if destination.nil?

  copy_file(source, destination)
end