Class: Hazetug::Tug
- Inherits:
-
Object
- Object
- Hazetug::Tug
- Includes:
- NetSSH::Mixin, UI::Mixin
- Defined in:
- lib/hazetug/tug.rb,
lib/hazetug/tug/solo.rb,
lib/hazetug/tug/knife.rb,
lib/hazetug/tug/knife_base.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Knife, KnifeBase, Solo
Constant Summary collapse
- LOGDIR =
"#{Dir.pwd}/logs"
Constants included from NetSSH::Mixin
NetSSH::Mixin::NET_SSH_OPTIONS
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #bootstrap(options = {}) ⇒ Object
-
#initialize(config = {}) ⇒ Tug
constructor
A new instance of Tug.
- #tug_name ⇒ Object
Methods included from UI::Mixin
Constructor Details
#initialize(config = {}) ⇒ Tug
Returns a new instance of Tug.
16 17 18 |
# File 'lib/hazetug/tug.rb', line 16 def initialize(config={}) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
12 13 14 |
# File 'lib/hazetug/tug.rb', line 12 def config @config end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/hazetug/tug.rb', line 12 def @options end |
Class Method Details
.[](symbol_or_string) ⇒ Object
44 45 46 47 |
# File 'lib/hazetug/tug.rb', line 44 def [](symbol_or_string) klass = Hazetug.camel_case_name(symbol_or_string) const_get(klass) end |
Instance Method Details
#bootstrap(options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/hazetug/tug.rb', line 24 def bootstrap(={}) @options = ip = config[:public_ip_address] ui.msg "[#{tug_name}] bootstraping server #{config[:name]}, ip: #{ip}" exit_status = bootstrap_server if exit_status.is_a?(Fixnum) && exit_status != 0 ui.error "[#{tug_name}] bootstraping server #{config[:name]} failed." else ui.msg "[#{tug_name}] bootstraping server #{config[:name]} done." end rescue Hazetug::Exception => e ui.error "[#{config[:compute_name]}] #{e.}" end |
#tug_name ⇒ Object
20 21 22 |
# File 'lib/hazetug/tug.rb', line 20 def tug_name @tug_name ||= self.class.name.split('::').last end |