Class: Vagabond::Spec
- Inherits:
-
Thor
- Object
- Thor
- Vagabond::Spec
- Includes:
- Thor::Actions, Actions::Status, Helpers
- Defined in:
- lib/vagabond/spec.rb
Class Method Summary collapse
Instance Method Summary collapse
- #destroy(cluster) ⇒ Object
- #init ⇒ Object
-
#initialize(*args) ⇒ Spec
constructor
A new instance of Spec.
- #start(cluster = nil) ⇒ Object
- #status(name = nil) ⇒ Object
Methods included from Actions::Status
Methods included from Helpers
Constructor Details
#initialize(*args) ⇒ Spec
Returns a new instance of Spec.
22 23 24 25 26 |
# File 'lib/vagabond/spec.rb', line 22 def initialize(*args) @name = nil super base_setup(:no_configure, :no_validate) end |
Class Method Details
.basename ⇒ Object
18 19 20 |
# File 'lib/vagabond/spec.rb', line 18 def self.basename 'vagabond spec' end |
Instance Method Details
#destroy(cluster) ⇒ Object
73 74 75 |
# File 'lib/vagabond/spec.rb', line 73 def destroy(cluster) [:node] ? node_destroy(cluster, [:node]) : cluster_destroy(cluster) end |
#init ⇒ Object
83 84 85 86 87 88 |
# File 'lib/vagabond/spec.rb', line 83 def init ui.info "Initializing spec configuration..." make_spec_directory populate_spec_directory ui.info " -> #{ui.color('COMPLETE!', :green)}" end |
#start(cluster = nil) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/vagabond/spec.rb', line 48 def start(cluster=nil) error = nil begin if([:irl]) irl_spec(cluster) else cluster_spec(cluster) cluster_destroy(cluster) if [:auto_destroy] end rescue => error ui.error "Unexpected error encountered: #{error}" debug("#{error.class}: #{error}\n#{error.backtrace.join("\n")}") raise ensure result = error ? ui.color('FAILED', :red, :bold) : ui.color('PASSED', :green, :bold) ui.info "--> Specs for cluster #{cluster}: #{result}" raise VagabondError::SpecFailed.new(error) if error end end |
#status(name = nil) ⇒ Object
78 79 80 |
# File 'lib/vagabond/spec.rb', line 78 def status(name=nil) _status end |