Class: Cumuli::CLI::Args

Inherits:
Object
  • Object
show all
Defined in:
lib/cumuli/cli/args.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Args

Returns a new instance of Args.



6
7
8
9
# File 'lib/cumuli/cli/args.rb', line 6

def initialize(argv)
  @argv = argv
  @dir ||= argv.shift
end

Instance Attribute Details

#argvObject (readonly)

Returns the value of attribute argv.



4
5
6
# File 'lib/cumuli/cli/args.rb', line 4

def argv
  @argv
end

#dirObject (readonly)

Returns the value of attribute dir.



4
5
6
# File 'lib/cumuli/cli/args.rb', line 4

def dir
  @dir
end

Instance Method Details

#foreman_optionsObject



15
16
17
# File 'lib/cumuli/cli/args.rb', line 15

def foreman_options
  argv.join(' ')
end

#nameObject



11
12
13
# File 'lib/cumuli/cli/args.rb', line 11

def name
  @name ||= dir.match(/([a-z_]+)$/i)[0]
end