Class: Engineyard::Recipes::Generators::LocalRecipeCloneGenerator

Inherits:
BaseGenerator
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/engineyard-recipes/generators/local_recipe_clone_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



10
11
12
# File 'lib/engineyard-recipes/generators/local_recipe_clone_generator.rb', line 10

def self.source_root
  @tmpdir ||= Dir.mktmpdir
end

Instance Method Details

#auto_require_packageObject



20
21
22
23
24
25
26
# File 'lib/engineyard-recipes/generators/local_recipe_clone_generator.rb', line 20

def auto_require_package
  file = cookbooks_dir "main/recipes/default.rb"
  require_recipe = "\nrequire_recipe '#{recipe_name}'\n"
  append_to_file file, require_recipe
rescue CookbooksNotFound
  # step not required if no cookbooks/ found
end

#install_cookbooksObject



14
15
16
17
18
# File 'lib/engineyard-recipes/generators/local_recipe_clone_generator.rb', line 14

def install_cookbooks
  directory "cookbooks", cookbooks_destination
rescue CookbooksNotFound
  directory "cookbooks/#{recipe_name}", "."
end