Module: KittyGen::Helpers

Defined in:
lib/kitty_gen/helpers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_recipeObject

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_yourselfObject



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" 
  git_commit_with_message
end

#tell_thor_where_your_files_will_goObject



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_recipesObject



29
30
31
# File 'lib/kitty_gen/helpers.rb', line 29

def tell_those_where_you_keep_your_recipes
  self.source_paths << File.expand_path("../recipes/", __FILE__)
end