Class: SimpleGit::DiffStat
- Inherits:
-
Object
- Object
- SimpleGit::DiffStat
- Defined in:
- lib/simple_git/diff_stat.rb
Defined Under Namespace
Classes: DiffStatWrapper
Instance Attribute Summary collapse
-
#ptr ⇒ Object
Returns the value of attribute ptr.
Instance Method Summary collapse
- #deletions ⇒ Object
-
#initialize(diff) ⇒ DiffStat
constructor
A new instance of DiffStat.
- #insertions ⇒ Object
Constructor Details
#initialize(diff) ⇒ DiffStat
Returns a new instance of DiffStat.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/simple_git/diff_stat.rb', line 5 def initialize(diff) wrapper = DiffStatWrapper.new ret = Git2.git_diff_get_stats(wrapper, diff.ptr) if ret != 0 error = Git2::GitError.new(Git2.giterr_last) raise ArgumentError, error[:message].read_string end @ptr = wrapper[:stat] ObjectSpace.define_finalizer(self, self.class.finalize(@ptr)) end |
Instance Attribute Details
#ptr ⇒ Object
Returns the value of attribute ptr.
3 4 5 |
# File 'lib/simple_git/diff_stat.rb', line 3 def ptr @ptr end |