Class: CloudStorageSync::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- CloudStorageSync::InstallGenerator
- Defined in:
- lib/generators/cloud_storage_sync/install_generator.rb,
lib/generators/cloud_storage_sync/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #app_name ⇒ Object
- #generate_config ⇒ Object
- #generate_initializer ⇒ Object
- #generate_rake_task ⇒ Object
Class Method Details
.source_root ⇒ Object
6 7 8 |
# File 'lib/generators/cloud_storage_sync/install_generator.rb', line 6 def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end |
Instance Method Details
#app_name ⇒ Object
10 11 12 13 |
# File 'lib/generators/cloud_storage_sync/install_generator.rb', line 10 def app_name @app_name ||= Rails.application.is_a?(Rails::Application) && Rails.application.class.name.sub(/::Application$/, "").downcase end |
#generate_config ⇒ Object
15 16 17 |
# File 'lib/generators/cloud_storage_sync/install_generator.rb', line 15 def generate_config template "cloud_storage_sync.yml", "config/cloud_storage_sync.yml" end |
#generate_initializer ⇒ Object
13 14 15 16 17 |
# File 'lib/generators/cloud_storage_sync/install/install_generator.rb', line 13 def generate_initializer unless [:use_yml] template "cloud_storage_sync.rb", "config/initializers/cloud_storage_sync.rb" end end |
#generate_rake_task ⇒ Object
19 20 21 |
# File 'lib/generators/cloud_storage_sync/install_generator.rb', line 19 def generate_rake_task template "cloud_storage_sync.rake", "lib/tasks/cloud_storage_sync.rake" end |