Class: Commands::RandomBranch
- Inherits:
-
Object
- Object
- Commands::RandomBranch
- Defined in:
- lib/commands/randombranch.rb
Instance Method Summary collapse
-
#options ⇒ Object
holds the options that were passed you can set any initial defaults here.
- #register(opts, global_options) ⇒ Object
-
#required_options ⇒ Object
required options.
- #run(global_options) ⇒ Object
Instance Method Details
#options ⇒ Object
holds the options that were passed you can set any initial defaults here
14 15 16 17 |
# File 'lib/commands/randombranch.rb', line 14 def ||= { } end |
#register(opts, global_options) ⇒ Object
25 26 27 28 29 |
# File 'lib/commands/randombranch.rb', line 25 def register(opts, ) opts. = "Usage: randombranch" opts.description = "Creates a random name to be used with a build branch." end |
#required_options ⇒ Object
required options
20 21 22 23 |
# File 'lib/commands/randombranch.rb', line 20 def ||= Set.new [ ] end |
#run(global_options) ⇒ Object
31 32 33 34 35 |
# File 'lib/commands/randombranch.rb', line 31 def run() randomstring = SecureRandom.hex(4) randomstring << "_buildbranch" puts randomstring end |