Module: Cyberweb::BaseModule::CommandlineArguments

Included in:
Cyberweb::BaseModule
Defined in:
lib/cyberweb/base_module/commandline_arguments/commandline_arguments.rb

Overview

Cyberweb::BaseModule::CommandlineArguments

Instance Method Summary collapse

Instance Method Details

#append_to_the_commandline_arguments(i) ⇒ Object

#

append_to_the_commandline_arguments

#


42
43
44
# File 'lib/cyberweb/base_module/commandline_arguments/commandline_arguments.rb', line 42

def append_to_the_commandline_arguments(i)
  @internal_hash[:commandline_arguments] << i # Simply append, without ANY checking.
end

#commandline_arguments?Boolean

#

commandline_arguments?

#

Returns:

  • (Boolean)


35
36
37
# File 'lib/cyberweb/base_module/commandline_arguments/commandline_arguments.rb', line 35

def commandline_arguments?
  @internal_hash[:commandline_arguments]
end

#first_argument?Boolean Also known as: first?

#

first_argument?

#

Returns:

  • (Boolean)


49
50
51
# File 'lib/cyberweb/base_module/commandline_arguments/commandline_arguments.rb', line 49

def first_argument?
  @internal_hash[:commandline_arguments].first
end

#parse_these_commandline_arguments(i) ⇒ Object

#

parse_these_commandline_arguments

This will simply append the commandline arguments. It is a bit of a misnomer, though.

#


66
67
68
69
# File 'lib/cyberweb/base_module/commandline_arguments/commandline_arguments.rb', line 66

def parse_these_commandline_arguments(i)
  i = [i].flatten.compact
  append_to_the_commandline_arguments(i)
end

#second_argument?Boolean

#

second_argument?

#

Returns:

  • (Boolean)


56
57
58
# File 'lib/cyberweb/base_module/commandline_arguments/commandline_arguments.rb', line 56

def second_argument?
  @internal_hash[:commandline_arguments][1]
end

#set_commandline_arguments(i = ARGV) ⇒ Object

#

set_commandline_arguments

#


25
26
27
28
29
30
# File 'lib/cyberweb/base_module/commandline_arguments/commandline_arguments.rb', line 25

def set_commandline_arguments(
    i = ARGV
  )
  i = [i].flatten.compact
  @internal_hash[:commandline_arguments] = i
end