Class: Amitree::GitClient::Range
- Inherits:
-
Object
- Object
- Amitree::GitClient::Range
- Defined in:
- lib/amitree/git_client/range.rb
Instance Attribute Summary collapse
-
#commits ⇒ Object
readonly
Returns the value of attribute commits.
Instance Method Summary collapse
- #commit_messages ⇒ Object
-
#initialize(commits) ⇒ Range
constructor
A new instance of Range.
- #since(rev) ⇒ Object
- #story_ids ⇒ Object
- #up_to(rev) ⇒ Object
Constructor Details
#initialize(commits) ⇒ Range
Returns a new instance of Range.
9 10 11 |
# File 'lib/amitree/git_client/range.rb', line 9 def initialize commits @commits = commits end |
Instance Attribute Details
#commits ⇒ Object (readonly)
Returns the value of attribute commits.
7 8 9 |
# File 'lib/amitree/git_client/range.rb', line 7 def commits @commits end |
Instance Method Details
#commit_messages ⇒ Object
19 20 21 |
# File 'lib/amitree/git_client/range.rb', line 19 def commits.map(&:commit).map(&:message) end |
#since(rev) ⇒ Object
23 24 25 |
# File 'lib/amitree/git_client/range.rb', line 23 def since(rev) Range.new(commits[(index(rev)+1)..-1]) end |
#story_ids ⇒ Object
13 14 15 16 17 |
# File 'lib/amitree/git_client/range.rb', line 13 def story_ids .map do |msg| msg.scan(/(?<=\[).*?(?=\])/).map{|expr| expr.scan /(?<=#)\d+/} end.flatten.map(&:to_i).uniq end |