Method: Rugged::Config#each
- Defined in:
- ext/rugged/rugged_config.c
permalink #each_pair {|key, value| ... } ⇒ Object #each_pair ⇒ Object #each {|key, value| ... } ⇒ Object #each ⇒ Object
Call the given block once for each key/value pair in the config file. If no block is given, an enumerator is returned.
cfg.each do |key, value|
puts "#{key} => #{value}"
end
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'ext/rugged/rugged_config.c', line 247
static VALUE rb_git_config_each_pair(VALUE self)
{
git_config *config;
int error, exception;
RETURN_ENUMERATOR(self, 0, 0);
Data_Get_Struct(self, git_config, config);
error = git_config_foreach(config, &cb_config__each_pair, &exception);
if (error == GIT_EUSER)
rb_jump_tag(exception);
rugged_exception_check(error);
return Qnil;
}
|