Class: Pronto::Git::Patches
- Inherits:
-
Object
- Object
- Pronto::Git::Patches
- Includes:
- Enumerable
- Defined in:
- lib/pronto/git/patches.rb
Instance Attribute Summary collapse
-
#commit ⇒ Object
readonly
Returns the value of attribute commit.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #find_line(path, line) ⇒ Object
-
#initialize(repo, commit, patches) ⇒ Patches
constructor
A new instance of Patches.
- #reject(&block) ⇒ Object
Constructor Details
Instance Attribute Details
#commit ⇒ Object (readonly)
Returns the value of attribute commit.
6 7 8 |
# File 'lib/pronto/git/patches.rb', line 6 def commit @commit end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
6 7 8 |
# File 'lib/pronto/git/patches.rb', line 6 def repo @repo end |
Instance Method Details
#each(&block) ⇒ Object
14 15 16 |
# File 'lib/pronto/git/patches.rb', line 14 def each(&block) @patches.each(&block) end |
#find_line(path, line) ⇒ Object
22 23 24 25 26 |
# File 'lib/pronto/git/patches.rb', line 22 def find_line(path, line) patch = find { |p| p.new_file_full_path == path } lines = patch ? patch.lines : [] lines.find { |l| l.new_lineno == line } end |