Class: Wukong::Deploy::DeployRunner
- Inherits:
-
Runner
- Object
- Runner
- Wukong::Deploy::DeployRunner
- Includes:
- Logging
- Defined in:
- lib/wukong-deploy/deploy_runner.rb
Overview
A Runner class that implements wu-deploy.
Instance Method Summary collapse
-
#action ⇒ String
The action, or first argument given.
-
#directory ⇒ String
The directory, or second argument given.
-
#run ⇒ Object
Run the requested action.
-
#validate ⇒ true
Validate that the requested action is known and that its arguments are valid.
Instance Method Details
#action ⇒ String
The action, or first argument given.
31 32 33 |
# File 'lib/wukong-deploy/deploy_runner.rb', line 31 def action args.first end |
#directory ⇒ String
The directory, or second argument given.
38 39 40 |
# File 'lib/wukong-deploy/deploy_runner.rb', line 38 def directory args[1] end |
#run ⇒ Object
Run the requested action.
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/wukong-deploy/deploy_runner.rb', line 59 def run case action when 'new' require_relative('templater') Templater.new(File.(directory, Dir.pwd), settings).run! when 'console' require_relative('console') Wukong::Deploy::Console.new.run! end end |
#validate ⇒ true
Validate that the requested action is known and that its arguments are valid.
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/wukong-deploy/deploy_runner.rb', line 47 def validate case action when 'new' raise Error.new("Must provide a path to the root of the deploy pack you want to create") if directory.nil? || directory.blank? when 'console' else raise Error.new("Invalid action: <#{action}>.") end true end |