Method: Rugged::Config#each_key

Defined in:
ext/rugged/rugged_config.c

#each_key {|key| ... } ⇒ Object #each_keyObject

Call the given block once for each key in the config file. If no block is given, an enumerator is returned.

cfg.each_key do |key|
  puts key
end

Overloads:

  • #each_key {|key| ... } ⇒ Object

    Yields:

    • (key)
[View source]

217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'ext/rugged/rugged_config.c', line 217

static VALUE rb_git_config_each_key(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_key, &exception);
	if (error == GIT_EUSER)
		rb_jump_tag(exception);

	rugged_exception_check(error);
	return Qnil;
}