Class: MultiRepo::InspectCommand
- Inherits:
-
Command
- Object
- CLAide::Command
- Command
- MultiRepo::InspectCommand
show all
- Defined in:
- lib/multirepo/commands/inspect-command.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
#ensure_in_work_tree, #ensure_multirepo_enabled, #ensure_multirepo_tracked, #install_hooks, #multirepo_enabled_dependencies, report_error, #uninstall_hooks, #update_gitconfig
Constructor Details
Returns a new instance of InspectCommand.
18
19
20
21
22
|
# File 'lib/multirepo/commands/inspect-command.rb', line 18
def initialize(argv)
stat = argv.shift_argument
@stat = stat ? stat.downcase : nil
super
end
|
Class Method Details
.options ⇒ Object
14
15
16
|
# File 'lib/multirepo/commands/inspect-command.rb', line 14
def self.options
[['<stat name>', 'The name of the statistic to output.']].concat(super)
end
|
Instance Method Details
#valid_stat?(stat) ⇒ Boolean
33
34
35
|
# File 'lib/multirepo/commands/inspect-command.rb', line 33
def valid_stat?(stat)
stats.include?(stat)
end
|
#validate! ⇒ Object
24
25
26
27
|
# File 'lib/multirepo/commands/inspect-command.rb', line 24
def validate!
super
help! "You must provide a valid stat name. Available stats: \n #{stats.join(', ')}" unless valid_stat?(@stat)
end
|