Class: Engineyard::Recipes::CLI
- Defined in:
- lib/engineyard-recipes/cli.rb
Instance Method Summary collapse
-
#clone(folder_path) ⇒ Object
TODO support git URIs.
- #definition(recipe_name, definition_name) ⇒ Object
- #gem(recipe_name) ⇒ Object
- #init ⇒ Object
- #init_sm ⇒ Object
- #package(recipe_name) ⇒ Object
- #sm(uri, *commands) ⇒ Object
- #timezone(timezone) ⇒ Object
- #version ⇒ Object
Instance Method Details
#clone(folder_path) ⇒ Object
TODO support git URIs
76 77 78 79 80 81 82 83 84 |
# File 'lib/engineyard-recipes/cli.rb', line 76 def clone(folder_path) # TODO support git URIs require 'engineyard-recipes/generators/local_recipe_clone_generator' generator = Engineyard::Recipes::Generators::LocalRecipeCloneGenerator _, recipe_name = FetchUri.fetch_recipe(folder_path, generator.source_root, ["name"]) generator.start([recipe_name]) rescue Engineyard::Recipes::FetchUri::UnknownPath => e error "No recipe found at #{e.}" end |
#definition(recipe_name, definition_name) ⇒ Object
61 62 63 64 |
# File 'lib/engineyard-recipes/cli.rb', line 61 def definition(recipe_name, definition_name) require 'engineyard-recipes/generators/definition_generator' Engineyard::Recipes::Generators::DefinitionGenerator.start([recipe_name, definition_name]) end |
#gem(recipe_name) ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/engineyard-recipes/cli.rb', line 52 def gem(recipe_name) recipe_type ||= ["helper"] ? "helper" : "recipe" repo_name ||= ["repo"] || "eycloud-#{recipe_type}-#{recipe_name}" require 'engineyard-recipes/generators/gem_generator' Engineyard::Recipes::Generators::GemGenerator.start([recipe_name, repo_name, recipe_type]) end |
#init ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/engineyard-recipes/cli.rb', line 14 def init on_deploy = ["on-deploy"] || false bundled_chef = ["chef"] || false if bundled_chef require 'engineyard-recipes/generators/init_bundled_chef_generator' Engineyard::Recipes::Generators::InitGenerator.start([{:on_deploy => on_deploy}]) else require 'engineyard-recipes/generators/init_resin_chef_generator' Engineyard::Recipes::Generators::InitGenerator.start([{:on_deploy => on_deploy}]) end init_sm if [:sm] end |
#init_sm ⇒ Object
29 30 31 32 |
# File 'lib/engineyard-recipes/cli.rb', line 29 def init_sm require 'engineyard-recipes/generators/init_sm_generator' Engineyard::Recipes::Generators::InitSmGenerator.start end |
#package(recipe_name) ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/engineyard-recipes/cli.rb', line 38 def package(recipe_name) package = ["package"] || "UNKNOWN/#{recipe_name}" version = ["version"] || '1.0.0' unmasked = ["unmasked"] || false require 'engineyard-recipes/generators/package_generator' Engineyard::Recipes::Generators::PackageGenerator.start([ recipe_name, package, version, {:unmasked => unmasked} ]) end |
#sm(uri, *commands) ⇒ Object
88 89 90 91 92 93 |
# File 'lib/engineyard-recipes/cli.rb', line 88 def sm(uri, *commands) require 'engineyard-recipes/generators/sm_generator' recipe_name = ["name"] Engineyard::Recipes::Generators::SmGenerator.start([recipe_name, uri, commands]) end |
#timezone(timezone) ⇒ Object
67 68 69 70 71 72 |
# File 'lib/engineyard-recipes/cli.rb', line 67 def timezone(timezone) require 'engineyard-recipes/generators/timezone_generator' Engineyard::Recipes::Generators::TimezoneGenerator.start([timezone]) rescue Engineyard::Recipes::Generators::TimezoneGenerator::InvalidTimezone => e error "#{e.} is not a known timezone." end |
#version ⇒ Object
96 97 98 99 |
# File 'lib/engineyard-recipes/cli.rb', line 96 def version require 'engineyard-recipes/version' shell.say Engineyard::Recipes::VERSION end |