Class: Transponder::Generators::InstallGenerator
- Inherits:
-
Base
- Object
- Rails::Generators::NamedBase
- Base
- Transponder::Generators::InstallGenerator
show all
- Defined in:
- lib/generators/transponder/install/install_generator.rb
Instance Method Summary
collapse
Methods inherited from Base
banner, #javascripts_path, source_root
Instance Method Details
#add_manifest ⇒ Object
21
22
23
|
# File 'lib/generators/transponder/install/install_generator.rb', line 21
def add_manifest
template "manifest.coffee", base_path('initializers/manifest.coffee') unless options[:shared]
end
|
#add_module_file ⇒ Object
29
30
31
32
|
# File 'lib/generators/transponder/install/install_generator.rb', line 29
def add_module_file
module_file = File.join(javascripts_path, "#{file_name.downcase}.coffee")
template "application.coffee", module_file unless options[:shared]
end
|
#add_setup ⇒ Object
17
18
19
|
# File 'lib/generators/transponder/install/install_generator.rb', line 17
def add_setup
template "#{options[:type].downcase}_setup.coffee", base_path('initializers/setup.coffee')
end
|
#add_shared ⇒ Object
25
26
27
|
# File 'lib/generators/transponder/install/install_generator.rb', line 25
def add_shared
template "#{options[:type].downcase}_shared.coffee", base_path('loader.coffee')
end
|
#base_path(path = nil) ⇒ Object
9
10
11
|
# File 'lib/generators/transponder/install/install_generator.rb', line 9
def base_path(path = nil)
File.join([javascripts_path, file_name, path].compact)
end
|
#create_module ⇒ Object
13
14
15
|
# File 'lib/generators/transponder/install/install_generator.rb', line 13
def create_module
directory "#{options[:type].downcase}", base_path
end
|