Class: CTT::Cli::Configs
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
-
#configs ⇒ Object
Returns the value of attribute configs.
-
#suites ⇒ Object
Returns the value of attribute suites.
Instance Method Summary collapse
-
#initialize ⇒ Configs
constructor
A new instance of Configs.
- #load_commands ⇒ Object
Constructor Details
#initialize ⇒ Configs
Returns a new instance of Configs.
9 10 11 12 |
# File 'lib/cli/configs.rb', line 9 def initialize @suites = Suites.new.suites load_commands end |
Instance Attribute Details
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
7 8 9 |
# File 'lib/cli/configs.rb', line 7 def commands @commands end |
#configs ⇒ Object
Returns the value of attribute configs.
5 6 7 |
# File 'lib/cli/configs.rb', line 5 def configs @configs end |
#suites ⇒ Object
Returns the value of attribute suites.
5 6 7 |
# File 'lib/cli/configs.rb', line 5 def suites @suites end |
Instance Method Details
#load_commands ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/cli/configs.rb', line 14 def load_commands @commands = STATIC_COMMANDS.dup commands = {} @suites["suites"].each do |suite, _| # for each suite, three commands should be added. # - configure suite # - suite [subcommand] # - list suite commands[suite] = {"usage" => "#{suite} [subcommand]", "desc" => "run default test for test suite: #{suite}," + " if no subcommand is specified"} key = "list #{suite}" commands[key] = {"usage" => key, "desc" => "list all available subcommands for test suite: #{suite}"} end @commands.merge!(commands) end |