Module: Git::Base::Factory
- Included in:
- Git::Base
- Defined in:
- lib/git/base/factory.rb
Instance Method Summary collapse
-
#branch(branch_name = 'master') ⇒ Object
returns a Git::Branch object for branch_name.
-
#branches ⇒ Object
returns a Git::Branches object of all the Git::Branch objects for this repo.
- #commit_tree(tree = nil, opts = {}) ⇒ Object
-
#diff(objectish = 'HEAD', obj2 = nil) ⇒ Object
returns a Git::Diff object.
- #gblob(objectish) ⇒ Object
- #gcommit(objectish) ⇒ Object
- #gtree(objectish) ⇒ Object
-
#log(count = 30) ⇒ Object
returns a Git::Log object with count commits.
-
#object(objectish) ⇒ Object
returns a Git::Object of the appropriate type you can also call @git.gtree(‘tree’), but that’s just for readability.
-
#remote(remote_name = 'origin') ⇒ Object
returns a Git::Remote object.
-
#status ⇒ Object
returns a Git::Status object.
-
#tag(tag_name) ⇒ Object
returns a Git::Tag object.
Instance Method Details
#branch(branch_name = 'master') ⇒ Object
returns a Git::Branch object for branch_name
8 9 10 |
# File 'lib/git/base/factory.rb', line 8 def branch(branch_name = 'master') Git::Branch.new(self, branch_name) end |
#branches ⇒ Object
returns a Git::Branches object of all the Git::Branch objects for this repo
14 15 16 |
# File 'lib/git/base/factory.rb', line 14 def branches Git::Branches.new(self) end |
#commit_tree(tree = nil, opts = {}) ⇒ Object
18 19 20 |
# File 'lib/git/base/factory.rb', line 18 def commit_tree(tree = nil, opts = {}) Git::Object::Commit.new(self, self.lib.commit_tree(tree, opts)) end |
#diff(objectish = 'HEAD', obj2 = nil) ⇒ Object
returns a Git::Diff object
23 24 25 |
# File 'lib/git/base/factory.rb', line 23 def diff(objectish = 'HEAD', obj2 = nil) Git::Diff.new(self, objectish, obj2) end |
#gblob(objectish) ⇒ Object
27 28 29 |
# File 'lib/git/base/factory.rb', line 27 def gblob(objectish) Git::Object.new(self, objectish, 'blob') end |
#gcommit(objectish) ⇒ Object
31 32 33 |
# File 'lib/git/base/factory.rb', line 31 def gcommit(objectish) Git::Object.new(self, objectish, 'commit') end |
#gtree(objectish) ⇒ Object
35 36 37 |
# File 'lib/git/base/factory.rb', line 35 def gtree(objectish) Git::Object.new(self, objectish, 'tree') end |
#log(count = 30) ⇒ Object
returns a Git::Log object with count commits
40 41 42 |
# File 'lib/git/base/factory.rb', line 40 def log(count = 30) Git::Log.new(self, count) end |
#object(objectish) ⇒ Object
returns a Git::Object of the appropriate type you can also call @git.gtree(‘tree’), but that’s just for readability. If you call @git.gtree(‘HEAD’) it will still return a Git::Object::Commit object.
on the objectish and determine the type of the object and return an appropriate object for that type
52 53 54 |
# File 'lib/git/base/factory.rb', line 52 def object(objectish) Git::Object.new(self, objectish) end |
#remote(remote_name = 'origin') ⇒ Object
returns a Git::Remote object
57 58 59 |
# File 'lib/git/base/factory.rb', line 57 def remote(remote_name = 'origin') Git::Remote.new(self, remote_name) end |