Class: Teabag::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Teabag::Generators::InstallGenerator
- Defined in:
- lib/generators/teabag/install/install_generator.rb
Instance Method Summary collapse
- #copy_initializers ⇒ Object
- #copy_spec_helper ⇒ Object
- #create_structure ⇒ Object
- #display_readme ⇒ Object
- #validate_framework ⇒ Object
Instance Method Details
#copy_initializers ⇒ Object
29 30 31 32 |
# File 'lib/generators/teabag/install/install_generator.rb', line 29 def copy_initializers copy_file "templates/#{framework}/initializer.rb", "config/initializers/teabag.rb" copy_file "templates/env.rb", "#{framework_type}/teabag_env.rb" if [:env] end |
#copy_spec_helper ⇒ Object
39 40 41 |
# File 'lib/generators/teabag/install/install_generator.rb', line 39 def copy_spec_helper copy_file "templates/#{framework}/#{framework_type}_helper.#{helper_ext}", "#{framework_type}/javascripts/#{framework_type}_helper.#{helper_ext}" end |
#create_structure ⇒ Object
34 35 36 37 |
# File 'lib/generators/teabag/install/install_generator.rb', line 34 def create_structure empty_directory "#{framework_type}/javascripts/support" empty_directory "#{framework_type}/javascripts/fixtures" end |
#display_readme ⇒ Object
43 44 45 |
# File 'lib/generators/teabag/install/install_generator.rb', line 43 def display_readme readme "POST_INSTALL" if behavior == :invoke end |
#validate_framework ⇒ Object
23 24 25 26 27 |
# File 'lib/generators/teabag/install/install_generator.rb', line 23 def validate_framework return if frameworks.include?([:framework]) puts "Unknown framework -- Known: #{frameworks.join(', ')}" exit end |