Class: Jenkins2::CLI::CreateNode
Instance Attribute Summary
#errors, #options
Class Method Summary
collapse
Instance Method Summary
collapse
#call, class_to_command, #initialize, #parse, subcommands
Constructor Details
This class inherits a constructor from Jenkins2::CLI
Class Method Details
.description ⇒ Object
26
27
28
|
# File 'lib/jenkins2/cli/nodes.rb', line 26
def self.description
'Create a new node by reading stdin for an XML configuration.'
end
|
Instance Method Details
#add_options ⇒ Object
30
31
32
33
34
35
|
# File 'lib/jenkins2/cli/nodes.rb', line 30
def add_options
parser.separator 'Mandatory arguments:'
parser.on '-n', '--name NAME', 'Name of the node.' do |n|
options[:name] = n
end
end
|
#run ⇒ Object
37
38
39
40
|
# File 'lib/jenkins2/cli/nodes.rb', line 37
def run
jc.computer(options[:name]).create and
jc.computer(options[:name]).update($stdin.read)
end
|