Class: YARD::CLI::Config
Overview
CLI command to view or edit configuration options
Instance Attribute Summary collapse
-
#key ⇒ Symbol?
The key to view/edit, if any.
-
#reset ⇒ Boolean
Whether to reset the #key.
-
#values ⇒ Array?
The list of values to set (or single value), if modifying.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #run(*args) ⇒ Object
Methods inherited from Command
#common_options, #load_script, #parse_options, run
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
15 16 17 18 19 20 |
# File 'lib/yard/cli/config.rb', line 15 def initialize super self.key = nil self.values = [] self.reset = false end |
Instance Attribute Details
#key ⇒ Symbol?
Returns the key to view/edit, if any.
7 8 9 |
# File 'lib/yard/cli/config.rb', line 7 def key @key end |
#reset ⇒ Boolean
Returns whether to reset the #key.
13 14 15 |
# File 'lib/yard/cli/config.rb', line 13 def reset @reset end |
#values ⇒ Array?
Returns the list of values to set (or single value), if modifying.
10 11 12 |
# File 'lib/yard/cli/config.rb', line 10 def values @values end |
Instance Method Details
#description ⇒ Object
22 23 24 |
# File 'lib/yard/cli/config.rb', line 22 def description 'Views or edits current global configuration' end |
#run(*args) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/yard/cli/config.rb', line 26 def run(*args) optparse(*args) if key if reset || values.size > 0 modify_item else view_item end else list_configuration end end |