Class: Lazylead::Entry
- Inherits:
-
Object
- Object
- Lazylead::Entry
- Defined in:
- lib/lazylead/task/svn/grep.rb
Overview
Single SVN commit details
Instance Method Summary collapse
- #author ⇒ Object
- #header ⇒ Object
-
#includes?(text) ⇒ Boolean
The modified lines contains expected text.
-
#initialize(commit) ⇒ Entry
constructor
A new instance of Entry.
- #lines ⇒ Object
- #msg ⇒ Object
- #rev ⇒ Object
- #time ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(commit) ⇒ Entry
Returns a new instance of Entry.
72 73 74 |
# File 'lib/lazylead/task/svn/grep.rb', line 72 def initialize(commit) @commit = commit end |
Instance Method Details
#author ⇒ Object
84 85 86 |
# File 'lib/lazylead/task/svn/grep.rb', line 84 def header[1] end |
#header ⇒ Object
107 108 109 |
# File 'lib/lazylead/task/svn/grep.rb', line 107 def header @header ||= lines.first.split(" | ").reject(&:blank?) end |
#includes?(text) ⇒ Boolean
The modified lines contains expected text
97 98 99 100 101 |
# File 'lib/lazylead/task/svn/grep.rb', line 97 def includes?(text) text = [text] unless text.respond_to? :each lines[4..-1].select { |l| l.start_with? "+" } .any? { |l| text.any? { |t| l.include? t } } end |
#lines ⇒ Object
103 104 105 |
# File 'lib/lazylead/task/svn/grep.rb', line 103 def lines @lines ||= @commit.split("\n").reject(&:blank?) end |
#msg ⇒ Object
92 93 94 |
# File 'lib/lazylead/task/svn/grep.rb', line 92 def msg lines[1] end |
#rev ⇒ Object
80 81 82 |
# File 'lib/lazylead/task/svn/grep.rb', line 80 def rev header.first end |
#time ⇒ Object
88 89 90 |
# File 'lib/lazylead/task/svn/grep.rb', line 88 def time header[2] end |
#to_s ⇒ Object
76 77 78 |
# File 'lib/lazylead/task/svn/grep.rb', line 76 def to_s "#{rev} #{msg}" end |