Method: Rugged::Index#each
- Defined in:
- ext/rugged/rugged_index.c
permalink #each {|entry| ... } ⇒ nil #each ⇒ Enumerator
Passes each entry of the index to the given block.
If no block is given, an enumerator is returned instead.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'ext/rugged/rugged_index.c', line 190
static VALUE rb_git_index_each(VALUE self)
{
git_index *index;
unsigned int i, count;
RETURN_ENUMERATOR(self, 0, 0);
Data_Get_Struct(self, git_index, index);
count = (unsigned int)git_index_entrycount(index);
for (i = 0; i < count; ++i) {
const git_index_entry *entry = git_index_get_byindex(index, i);
if (entry)
rb_yield(rb_git_indexentry_fromC(entry));
}
return Qnil;
}
|