Method: Rugged::Blame#each
- Defined in:
- ext/rugged/rugged_blame.c
#each {|hunk| ... } ⇒ Object #each ⇒ Object
If given a block, yields each hunk
that is part of blame
. If no block is given, an enumerator will be returned.
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
# File 'ext/rugged/rugged_blame.c', line 245
static VALUE rb_git_blame_each(VALUE self)
{
git_blame *blame;
uint32_t i, blame_count;
RETURN_SIZED_ENUMERATOR(self, 0, 0, rugged_blame_enum_size);
Data_Get_Struct(self, git_blame, blame);
blame_count = git_blame_get_hunk_count(blame);
for (i = 0; i < blame_count; ++i) {
rb_yield(rb_git_blame_hunk_fromC(
git_blame_get_hunk_byindex(blame, i)
));
}
return self;
}
|