Class: Regrit::Provider::System
- Inherits:
-
Object
- Object
- Regrit::Provider::System
- Defined in:
- lib/regrit/provider/system.rb
Constant Summary collapse
- DEFAULT_TIMEOUT =
5
Instance Method Summary collapse
- #clone(*argv) ⇒ Object
- #fetch(*argv) ⇒ Object
- #git(*argv) ⇒ Object
-
#initialize(uri, options) ⇒ System
constructor
A new instance of System.
- #ls_remote(named = nil) ⇒ Object
- #pull(*argv) ⇒ Object
- #push(*argv) ⇒ Object
Constructor Details
#initialize(uri, options) ⇒ System
Returns a new instance of System.
10 11 12 13 14 |
# File 'lib/regrit/provider/system.rb', line 10 def initialize(uri, ) @uri = uri @options = @timeout = @options[:timeout] || DEFAULT_TIMEOUT end |
Instance Method Details
#clone(*argv) ⇒ Object
20 21 22 |
# File 'lib/regrit/provider/system.rb', line 20 def clone(*argv) git "clone", *argv end |
#fetch(*argv) ⇒ Object
24 25 26 |
# File 'lib/regrit/provider/system.rb', line 24 def fetch(*argv) git "fetch", *argv end |
#git(*argv) ⇒ Object
36 37 38 |
# File 'lib/regrit/provider/system.rb', line 36 def git(*argv) spawn "#{git_command} #{Escape.shell_command(argv.flatten.compact)}" end |
#ls_remote(named = nil) ⇒ Object
16 17 18 |
# File 'lib/regrit/provider/system.rb', line 16 def ls_remote(named=nil) git "ls-remote", @uri.to_s, named end |
#pull(*argv) ⇒ Object
32 33 34 |
# File 'lib/regrit/provider/system.rb', line 32 def pull(*argv) git "pull", *argv end |
#push(*argv) ⇒ Object
28 29 30 |
# File 'lib/regrit/provider/system.rb', line 28 def push(*argv) git "push", *argv end |