Class: YARD::CLI::LinkStdlib
- Inherits:
-
Command
- Object
- Command
- YARD::CLI::LinkStdlib
- Defined in:
- lib/yard/cli/link_stdlib.rb,
lib/yard/cli/link_stdlib/add.rb,
lib/yard/cli/link_stdlib/url.rb,
lib/yard/cli/link_stdlib/help.rb,
lib/yard/cli/link_stdlib/list.rb,
lib/yard/cli/link_stdlib/search.rb,
lib/yard/cli/link_stdlib/command_helper.rb
Overview
Top-level Command for the ‘yard-link_stdlib` plugin. Added under the name `stdlib` (see LinkStdlib.install!).
Simply a router to the sub-commands. Like CommandParser, which handles routing for ‘yard`, but is not really re-usable. In addition, this class handles “-” → “_” conversion in sub-command names, since we have multi-word commands.
Defined Under Namespace
Modules: CommandHelper Classes: Add, Help, List, Search, URL
Class Method Summary collapse
-
.commands ⇒ Object
Singleton Methods ==========================================================================.
Instance Method Summary collapse
-
#description ⇒ Object
Instance Methods ========================================================================.
- #run(*args) ⇒ Object
Class Method Details
.commands ⇒ Object
Singleton Methods
57 58 59 |
# File 'lib/yard/cli/link_stdlib.rb', line 57 def self.commands @commands end |
Instance Method Details
#description ⇒ Object
Instance Methods
65 66 67 |
# File 'lib/yard/cli/link_stdlib.rb', line 65 def description "Mange Ruby stdlib linking" end |
#run(*args) ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/yard/cli/link_stdlib.rb', line 70 def run *args # log.level = Logger::INFO target = self.class.commands args = [ 'help' ] if args.empty? while target.is_a? Hash key = args[0].gsub( '-', '_' ).to_sym if target.key? key target = target[key] args.shift else raise "Bad command name: #{ args[0] }" end end target.run( *args ) end |