Class: Git::Remote
Instance Attribute Summary collapse
-
#fetch_opts ⇒ Object
Returns the value of attribute fetch_opts.
-
#name ⇒ Object
Returns the value of attribute name.
-
#url ⇒ Object
Returns the value of attribute url.
Attributes inherited from Path
Instance Method Summary collapse
- #branch(branch = 'master') ⇒ Object
- #fetch(opts = {}) ⇒ Object
-
#initialize(base, name) ⇒ Remote
constructor
A new instance of Remote.
-
#merge(branch = 'master') ⇒ Object
merge this remote locally.
- #remove ⇒ Object
- #to_s ⇒ Object
Methods inherited from Path
Constructor Details
#initialize(base, name) ⇒ Remote
Returns a new instance of Remote.
6 7 8 9 10 11 12 |
# File 'lib/git/remote.rb', line 6 def initialize(base, name) @base = base config = @base.lib.config_remote(name) @name = name @url = config['url'] @fetch_opts = config['fetch'] end |
Instance Attribute Details
#fetch_opts ⇒ Object
Returns the value of attribute fetch_opts.
4 5 6 |
# File 'lib/git/remote.rb', line 4 def fetch_opts @fetch_opts end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/git/remote.rb', line 4 def name @name end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/git/remote.rb', line 4 def url @url end |
Instance Method Details
#branch(branch = 'master') ⇒ Object
23 24 25 |
# File 'lib/git/remote.rb', line 23 def branch(branch = 'master') Git::Branch.new(@base, "#{@name}/#{branch}") end |
#fetch(opts = {}) ⇒ Object
14 15 16 |
# File 'lib/git/remote.rb', line 14 def fetch(opts={}) @base.fetch(@name, opts) end |
#merge(branch = 'master') ⇒ Object
merge this remote locally
19 20 21 |
# File 'lib/git/remote.rb', line 19 def merge(branch = 'master') @base.merge("#{@name}/#{branch}") end |
#remove ⇒ Object
27 28 29 |
# File 'lib/git/remote.rb', line 27 def remove @base.lib.remote_remove(@name) end |
#to_s ⇒ Object
31 32 33 |
# File 'lib/git/remote.rb', line 31 def to_s @name end |