Class: Twigg::Command::GitHost
- Inherits:
-
Twigg::Command
- Object
- Twigg::Command
- Twigg::Command::GitHost
- Defined in:
- lib/twigg/command/git_host.rb
Overview
This is an abstract superclass the holds code common to the “gerrit” and “github” subcommands.
Constant Summary
Constants inherited from Twigg::Command
EASTER_EGGS, PUBLIC_SUBCOMMANDS, SUBCOMMANDS
Instance Method Summary collapse
-
#initialize(*args) ⇒ GitHost
constructor
A new instance of GitHost.
- #run ⇒ Object
Methods inherited from Twigg::Command
Constructor Details
#initialize(*args) ⇒ GitHost
Returns a new instance of GitHost.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/twigg/command/git_host.rb', line 6 def initialize(*args) super @sub_subcommand = @args.first unless (1..2).cover?(@args.size) && sub_subcommands.include?(@sub_subcommand) # eg. "Twigg::Command::{Gerrit,GitHub}" -> "gerrit/github" Help.new(self.class.to_s.split('::').last.downcase).run! end @repositories_directory = @args[1] || Config.repositories_directory end |
Instance Method Details
#run ⇒ Object
19 20 21 |
# File 'lib/twigg/command/git_host.rb', line 19 def run send @sub_subcommand end |