Class: Git::Log
Overview
object that holds the last X commits on given branch
Instance Method Summary collapse
- #author(regex) ⇒ Object
- #between(sha1, sha2 = nil) ⇒ Object
- #each ⇒ Object
- #first ⇒ Object
- #grep(regex) ⇒ Object
-
#initialize(base, count = 30) ⇒ Log
constructor
A new instance of Log.
- #object(objectish) ⇒ Object
- #path(path) ⇒ Object
- #since(date) ⇒ Object
-
#size ⇒ Object
forces git log to run.
- #to_s ⇒ Object
- #until(date) ⇒ Object
Constructor Details
#initialize(base, count = 30) ⇒ Log
Returns a new instance of Log.
19 20 21 22 23 |
# File 'lib/git/log.rb', line 19 def initialize(base, count = 30) dirty_log @base = base @count = count end |
Instance Method Details
#author(regex) ⇒ Object
31 32 33 34 35 |
# File 'lib/git/log.rb', line 31 def (regex) dirty_log = regex return self end |
#between(sha1, sha2 = nil) ⇒ Object
61 62 63 64 65 |
# File 'lib/git/log.rb', line 61 def between(sha1, sha2 = nil) dirty_log @between = [sha1, sha2] return self end |
#each ⇒ Object
79 80 81 82 83 84 |
# File 'lib/git/log.rb', line 79 def each check_log @commits.each do |c| yield c end end |
#first ⇒ Object
86 87 88 89 |
# File 'lib/git/log.rb', line 86 def first check_log @commits.first rescue nil end |
#grep(regex) ⇒ Object
37 38 39 40 41 |
# File 'lib/git/log.rb', line 37 def grep(regex) dirty_log @grep = regex return self end |
#object(objectish) ⇒ Object
25 26 27 28 29 |
# File 'lib/git/log.rb', line 25 def object(objectish) dirty_log @object = objectish return self end |
#path(path) ⇒ Object
43 44 45 46 47 |
# File 'lib/git/log.rb', line 43 def path(path) dirty_log @path = path return self end |
#since(date) ⇒ Object
49 50 51 52 53 |
# File 'lib/git/log.rb', line 49 def since(date) dirty_log @since = date return self end |
#size ⇒ Object
forces git log to run
74 75 76 77 |
# File 'lib/git/log.rb', line 74 def size check_log @commits.size rescue nil end |
#to_s ⇒ Object
67 68 69 |
# File 'lib/git/log.rb', line 67 def to_s self.map { |c| c.to_s }.join("\n") end |
#until(date) ⇒ Object
55 56 57 58 59 |
# File 'lib/git/log.rb', line 55 def until(date) dirty_log @until = date return self end |