struct Agate::Signature

Overview

An immutable git signature (author or committer).

This is a pure Crystal value type -- no C pointers, no finalization. Data is extracted eagerly from the C struct at the boundary.

Defined in:

agate/signature.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.create(name : String, email : String, time : Time, offset : Int32 | Nil = nil) : Signature #

Creates a signature via libgit2 with the given name, email, time, and timezone offset (in minutes).


[View source]
def self.default(repo) : Signature #

Creates a signature from the repository's default config (user.name and user.email).


[View source]
def self.from_buffer(buf : String) : Signature #

Parses a signature from a buffer in the format "Name timestamp offset".


[View source]
def self.new(name : String, email : String, time : Time, offset : Int32) #

[View source]
def self.now(name : String, email : String) : Signature #

Creates a signature with the given name, email, and the current time.


[View source]

Class Method Detail

def self.default?(repo) : Signature | Nil #

Creates a signature from the repository's default config, or nil if user.name/email aren't configured.


[View source]
def self.from_buffer?(buf : String) : Signature | Nil #

Parses a signature from a buffer, returning nil on failure.


[View source]

Instance Method Detail

def clone #

[View source]
def copy_with(name _name = @name, email _email = @email, time _time = @time, offset _offset = @offset) #

[View source]
def email : String #

def name : String #

def offset : Int32 #

def time : Time #