Method: Rugged::Config#each_pair

Defined in:
ext/rugged/rugged_config.c

#each_pair {|key, value| ... } ⇒ Object #each_pairObject #each {|key, value| ... } ⇒ Object #eachObject

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

Overloads:

  • #each_pair {|key, value| ... } ⇒ Object

    Yields:

    • (key, value)
  • #each {|key, value| ... } ⇒ Object

    Yields:

    • (key, value)
[View source]

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;
}