Class: Vagabond::Vagabond
- Inherits:
-
Thor
- Object
- Thor
- Vagabond::Vagabond
- Includes:
- Thor::Actions, Helpers
- Defined in:
- lib/vagabond/vagabond.rb
Constant Summary collapse
- CLI_OPTIONS =
lambda do class_option(:debug, :type => :boolean, :default => false ) class_option(:force_solo, :aliases => '--force-configure', :type => :boolean, :default => false, :desc => 'Force configuration of system' ) class_option(:color, :type => :boolean, :default => true, :desc => 'Enable/disable colorized output' ) class_option(:vagabond_file, :aliases => '-f', :type => :string, :desc => 'Provide path to Vagabondfile' ) class_option(:local_server, :type => :boolean, :default => true, :desc => 'Enable/disable local Chef server usage if available' ) end
- COMMANDS =
COMMANDS
lambda do |show_node=true| Actions.constants.find_all do |const| Actions.const_get(const).is_a?(Module) end.map(&:to_s).map(&:downcase).each do |meth| if(self.respond_to?("_#{meth}_desc")) args = self.send("_#{meth}_desc") else args = ["#{meth}#{' NODE' if show_node}", "#{meth.capitalize} instance#{' of NODE' if show_node}"] end desc(*args) if(self.respond_to?("_#{meth}_options")) self.send("_#{meth}_options").each do |opts| method_option(*opts) end end define_method meth do |*args| setup(meth, *args) execute end end end
Constants included from Helpers
Helpers::GEN_NAME_LENGTH, Helpers::RAND_CHARS
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#config ⇒ Object
Returns the value of attribute config.
-
#internal_config ⇒ Object
readonly
Returns the value of attribute internal_config.
-
#lxc ⇒ Object
Returns the value of attribute lxc.
-
#mappings_key ⇒ Object
Returns the value of attribute mappings_key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#ui ⇒ Object
readonly
Returns the value of attribute ui.
-
#vagabondfile ⇒ Object
readonly
Returns the value of attribute vagabondfile.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Vagabond
constructor
- action
- Action to perform name
- Name of vagabond config
-
Hash configuration.
Methods included from Helpers
Constructor Details
#initialize(*args) ⇒ Vagabond
- action
-
Action to perform
- name
-
Name of vagabond
- config
-
Hash configuration
Creates an instance
80 81 82 83 84 |
# File 'lib/vagabond/vagabond.rb', line 80 def initialize(*args) super @threads = Mash.new @mappings_key = :mappings end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
38 39 40 |
# File 'lib/vagabond/vagabond.rb', line 38 def action @action end |
#config ⇒ Object
Returns the value of attribute config.
37 38 39 |
# File 'lib/vagabond/vagabond.rb', line 37 def config @config end |
#internal_config ⇒ Object (readonly)
Returns the value of attribute internal_config.
31 32 33 |
# File 'lib/vagabond/vagabond.rb', line 31 def internal_config @internal_config end |
#lxc ⇒ Object
Returns the value of attribute lxc.
36 37 38 |
# File 'lib/vagabond/vagabond.rb', line 36 def lxc @lxc end |
#mappings_key ⇒ Object
Returns the value of attribute mappings_key.
35 36 37 |
# File 'lib/vagabond/vagabond.rb', line 35 def mappings_key @mappings_key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
29 30 31 |
# File 'lib/vagabond/vagabond.rb', line 29 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
33 34 35 |
# File 'lib/vagabond/vagabond.rb', line 33 def @options end |
#ui ⇒ Object (readonly)
Returns the value of attribute ui.
32 33 34 |
# File 'lib/vagabond/vagabond.rb', line 32 def ui @ui end |
#vagabondfile ⇒ Object (readonly)
Returns the value of attribute vagabondfile.
30 31 32 |
# File 'lib/vagabond/vagabond.rb', line 30 def vagabondfile @vagabondfile end |