Class: Jenkins::Plugin::CLI::Generate
- Includes:
- Thor::Actions
- Defined in:
- lib/jenkins/plugin/cli/generate.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #builder(name) ⇒ Object
- #computer_listener(name) ⇒ Object
- #node_property(name) ⇒ Object
- #publisher(name) ⇒ Object
- #run_listener(name) ⇒ Object
- #wrapper(name) ⇒ Object
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/jenkins/plugin/cli/generate.rb', line 7 def name @name end |
Class Method Details
.help(shell, task) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/jenkins/plugin/cli/generate.rb', line 11 def self.help(shell, task) shell.say "Usage: jpi generate GENERATOR" shell.say "Available Generators:" tasks.each do |k, v| next if k.to_s == 'help' puts " #{k}" end end |
Instance Method Details
#builder(name) ⇒ Object
28 29 30 31 32 |
# File 'lib/jenkins/plugin/cli/generate.rb', line 28 def builder(name) @name = name @step_class = "Builder" template('templates/build_step.tt', "models/#{name.downcase}_builder.rb") end |
#computer_listener(name) ⇒ Object
53 54 55 56 |
# File 'lib/jenkins/plugin/cli/generate.rb', line 53 def computer_listener(name) @name = name template('templates/computer_listener.tt', "models/#{name.downcase}_listener.rb") end |
#node_property(name) ⇒ Object
41 42 43 44 |
# File 'lib/jenkins/plugin/cli/generate.rb', line 41 def node_property(name) @name = name template('templates/node_property.tt', "models/#{name.downcase}_property.rb") end |
#publisher(name) ⇒ Object
21 22 23 24 25 |
# File 'lib/jenkins/plugin/cli/generate.rb', line 21 def publisher(name) @name = name @step_class = "Publisher" template('templates/build_step.tt', "models/#{name.downcase}_publisher.rb") end |
#run_listener(name) ⇒ Object
47 48 49 50 |
# File 'lib/jenkins/plugin/cli/generate.rb', line 47 def run_listener(name) @name = name template('templates/run_listener.tt', "models/#{name.downcase}_listener.rb") end |
#wrapper(name) ⇒ Object
35 36 37 38 |
# File 'lib/jenkins/plugin/cli/generate.rb', line 35 def wrapper(name) @name = name template('templates/build_wrapper.tt', "models/#{name.downcase}_wrapper.rb") end |