Method: Rugged.signature_from_buffer

Defined in:
ext/rugged/rugged.c

.signature_from_buffer(buffer[, encoding_name]) ⇒ Object

Parse the signature from the given buffer. If an encoding is given, the strings will be tagged with that encoding.

commit.author #=> {:email=>"tanoku@gmail.com", :time=>Tue Jan 24 05:42:45 UTC 2012, :name=>"Vicent Mart\303\255"}

402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'ext/rugged/rugged.c', line 402

static VALUE rb_git_signature_from_buffer(int argc, VALUE *argv, VALUE self)
{
	VALUE rb_buffer, rb_encoding_name;
	const char *buffer, *encoding_name = NULL;

	rb_scan_args(argc, argv, "11", &rb_buffer, &rb_encoding_name);

	buffer = StringValueCStr(rb_buffer);
	if (!NIL_P(rb_encoding_name))
		encoding_name = StringValueCStr(rb_encoding_name);

	return rugged_signature_from_buffer(buffer, encoding_name);
}