Module: KittyGen::Helpers
- Defined in:
- lib/kitty_gen/helpers.rb
Instance Attribute Summary collapse
-
#current_recipe ⇒ Object
Returns the value of attribute current_recipe.
Instance Method Summary collapse
- #introduce_yourself ⇒ Object
-
#recipe(thing_to_do) ⇒ Object
Importantly, this runs each recipe in its own exclusive scope.
- #tell_thor_where_your_files_will_go ⇒ Object
- #tell_those_where_you_keep_your_recipes ⇒ Object
Instance Attribute Details
#current_recipe ⇒ Object
Returns the value of attribute current_recipe.
7 8 9 |
# File 'lib/kitty_gen/helpers.rb', line 7 def current_recipe @current_recipe end |
Instance Method Details
#introduce_yourself ⇒ Object
9 10 11 |
# File 'lib/kitty_gen/helpers.rb', line 9 def introduce_yourself title "Welcome To Kitty Gen. Lets Make You an App" end |
#recipe(thing_to_do) ⇒ Object
Importantly, this runs each recipe in its own exclusive scope. This means symbols from one recipe cannot pollute the namespace
17 18 19 20 21 22 23 |
# File 'lib/kitty_gen/helpers.rb', line 17 def recipe(thing_to_do) thing_to_do = thing_to_do.to_s self.current_recipe = thing_to_do log_recipe_name thing_to_do apply "#{thing_to_do}_recipe.rb" end |
#tell_thor_where_your_files_will_go ⇒ Object
25 26 27 |
# File 'lib/kitty_gen/helpers.rb', line 25 def tell_thor_where_your_files_will_go self.destination_root = Dir.pwd end |
#tell_those_where_you_keep_your_recipes ⇒ Object
29 30 31 |
# File 'lib/kitty_gen/helpers.rb', line 29 def tell_those_where_you_keep_your_recipes self.source_paths << File.("../recipes/", __FILE__) end |