Class: Commands::RandomBranch

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/randombranch.rb

Instance Method Summary collapse

Instance Method Details

#optionsObject

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 options
  @options ||= {
  }
end

#register(opts, global_options) ⇒ Object



25
26
27
28
29
# File 'lib/commands/randombranch.rb', line 25

def register(opts, global_options)
  opts.banner = "Usage: randombranch"
  opts.description = "Creates a random name to be used with a build branch."

end

#required_optionsObject

required options



20
21
22
23
# File 'lib/commands/randombranch.rb', line 20

def required_options
  @required_options ||= Set.new [
  ]
end

#run(global_options) ⇒ Object



31
32
33
34
35
# File 'lib/commands/randombranch.rb', line 31

def run(global_options)
  randomstring = SecureRandom.hex(4)
  randomstring << "_buildbranch"
  puts randomstring
end