File tree Expand file tree Collapse file tree 4 files changed +16
-10
lines changed
Expand file tree Collapse file tree 4 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 1+ --no-private --protected exe/* lib/**/*.rb - CODE_OF_CONDUCT.md README.md LICENSE.txt
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def say(message)
4141 #
4242 # @param command [Command] the git-cmd command to parse the arguments for
4343 # @param arguments [Array] the command line arguments
44- # @return options [Array] the GitCommander::Command options with values
44+ # @return [Array< GitCommander::Command::Option>] the available options with values
4545 def parse_command_options! ( command , arguments )
4646 parser = configure_option_parser_for_command ( command )
4747 parser . parse! ( arguments )
Original file line number Diff line number Diff line change 22
33module GitCommander
44 class Command
5- # @nodoc
5+ # @abstract Wraps [Command] arguments, flags, and switches in a generic
6+ # object to normalize their representation in the context of a
7+ # [Command].
68 class Option
79 attr_reader :default , :description , :name
810 attr_writer :value
911
12+ # Creates a [Option] object.
13+ #
14+ # @param name [String, Symbol] the name of the option, these are unique per [Command]
15+ # @param default [anything] the default value the option should have
16+ # @param description [String] a description of the option for display in
17+ # the [Command]'s help text
18+ # @param value [anything] a value for the option
1019 def initialize ( name :, default : nil , description : nil , value : nil )
1120 @name = name . to_sym
1221 @default = default
Original file line number Diff line number Diff line change @@ -11,14 +11,10 @@ module GitCommander
1111 # context. Plugins can define their own inline gems, and can define
1212 # additional Commands.
1313 #
14- # @example Loadable Command file with native `git` plugin
15- # # This is a unique example of using `plugin` without any options. It
16- # # uses the `git` plugin provided natively with this gem. Most times you will
17- # # use a path: "path/to/my/plugin", or url: "https://example.com/myplugin"
18- # plugin :git
19- # command :local_branches do |cmd|
20- # git.branches.local.map(&:name)
21- # end
14+ # @example A simple `git` plugin
15+ # require "git"
16+ # git_instance = Git.open(Dir.pwd, log: GitCommander.logger)
17+ # GitCommander::Plugin.new(:git, source_instance: git_instance)
2218 #
2319 class Plugin
2420 attr_accessor :executor , :name , :registry
You can’t perform that action at this time.
0 commit comments