Class: Augit::Branch
- Inherits:
-
Object
- Object
- Augit::Branch
- Defined in:
- lib/augit/branch.rb
Constant Summary collapse
- CHANGE_MAP =
[ { name: 'commit', regex: /^commit\s(.*)/ }, { name: 'author', regex: /^Author:\s(.*)\s</ }, { name: 'timestamp', regex: /^Date:\s*(.*)$/ }, { name: 'file', regex: /^:.*\s(.*)/ } ]
Instance Attribute Summary collapse
-
#age ⇒ Object
readonly
Returns the value of attribute age.
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#commits ⇒ Object
readonly
Returns the value of attribute commits.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
Instance Method Summary collapse
- #commit_count ⇒ Object
- #compare_url ⇒ Object
- #files ⇒ Object
-
#initialize(name, origin) ⇒ Branch
constructor
A new instance of Branch.
Constructor Details
Instance Attribute Details
#age ⇒ Object (readonly)
Returns the value of attribute age.
5 6 7 |
# File 'lib/augit/branch.rb', line 5 def age @age end |
#author ⇒ Object (readonly)
Returns the value of attribute author.
5 6 7 |
# File 'lib/augit/branch.rb', line 5 def @author end |
#commits ⇒ Object (readonly)
Returns the value of attribute commits.
5 6 7 |
# File 'lib/augit/branch.rb', line 5 def commits @commits end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/augit/branch.rb', line 5 def name @name end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
5 6 7 |
# File 'lib/augit/branch.rb', line 5 def origin @origin end |
Instance Method Details
#commit_count ⇒ Object
31 32 33 |
# File 'lib/augit/branch.rb', line 31 def commit_count commits.keys.length end |
#compare_url ⇒ Object
23 24 25 |
# File 'lib/augit/branch.rb', line 23 def compare_url "https://github.com/#{origin}/compare/#{name}" end |
#files ⇒ Object
27 28 29 |
# File 'lib/augit/branch.rb', line 27 def files commits.values.flatten.uniq end |