Class: Teaspoon::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Teaspoon::Generators::InstallGenerator
- Defined in:
- lib/generators/teaspoon/install/install_generator.rb
Instance Method Summary collapse
- #copy_environment ⇒ Object
- #copy_partials ⇒ Object
- #copy_spec_helper ⇒ Object
- #create_structure ⇒ Object
- #display_readme ⇒ Object
- #validate_framework ⇒ Object
Instance Method Details
#copy_environment ⇒ Object
35 36 37 38 |
# File 'lib/generators/teaspoon/install/install_generator.rb', line 35 def copy_environment source = [:no_comments] ? "env.rb" : "env_comments.rb" copy_file "templates/#{framework}/#{source}", "#{framework_type}/teaspoon_env.rb" end |
#copy_partials ⇒ Object
49 50 51 52 53 |
# File 'lib/generators/teaspoon/install/install_generator.rb', line 49 def copy_partials return unless [:partials] copy_file "templates/_boot.html.erb", "/#{framework_type}/javascripts/fixtures/_boot.html.erb" copy_file "templates/_body.html.erb", "/#{framework_type}/javascripts/fixtures/_body.html.erb" end |
#copy_spec_helper ⇒ Object
45 46 47 |
# File 'lib/generators/teaspoon/install/install_generator.rb', line 45 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
40 41 42 43 |
# File 'lib/generators/teaspoon/install/install_generator.rb', line 40 def create_structure empty_directory "#{framework_type}/javascripts/support" empty_directory "#{framework_type}/javascripts/fixtures" end |
#display_readme ⇒ Object
55 56 57 |
# File 'lib/generators/teaspoon/install/install_generator.rb', line 55 def display_readme readme "POST_INSTALL" if behavior == :invoke end |
#validate_framework ⇒ Object
29 30 31 32 33 |
# File 'lib/generators/teaspoon/install/install_generator.rb', line 29 def validate_framework return if frameworks.include?([:framework]) puts "Unknown framework -- available #{frameworks.join(", ")}" exit(1) end |