Class: Thunderer::Generators::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



4
5
6
# File 'lib/generators/thunderer/install_generator.rb', line 4

def self.source_root
  File.dirname(__FILE__) + '/templates'
end

Instance Method Details

#copy_filesObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/generators/thunderer/install_generator.rb', line 8

def copy_files
  template 'thunderer.yml', 'config/thunderer.yml'
  if ::Rails.version < '3.1'
    copy_file '../../../../app/assets/javascripts/thunderer.js', 'public/javascripts/thunderer.js'
    copy_file '../../../../app/assets/javascripts/thunderer_interceptor.js', 'public/javascripts/thunderer_interceptor.js'
    copy_file '../../../../app/assets/javascripts/thunderer_subscription_service.js', 'public/javascripts/thunderer_subscription_service.js'
  end
  copy_file 'thunderer.ru', 'thunderer.ru'
  copy_file 'thunderer.rb', 'app/config/initializers/thunderer.rb'
end