2011-10-24 15:38:03 -04:00
|
|
|
module CommitExt
|
2011-10-25 00:32:02 -04:00
|
|
|
def safe_message
|
2011-10-26 09:46:25 -04:00
|
|
|
message.encode("UTF-8",
|
|
|
|
:invalid => :replace,
|
|
|
|
:undef => :replace,
|
2011-10-25 00:32:02 -04:00
|
|
|
:universal_newline => true,
|
|
|
|
:replace => "")
|
2011-10-26 09:46:25 -04:00
|
|
|
rescue
|
2011-10-24 15:38:03 -04:00
|
|
|
"-- invalid encoding for commit message"
|
|
|
|
end
|
2011-10-31 16:57:16 -04:00
|
|
|
|
|
|
|
def created_at
|
|
|
|
committed_date
|
|
|
|
end
|
2011-11-03 06:56:26 -04:00
|
|
|
|
|
|
|
def author_email
|
|
|
|
author.email.force_encoding(Encoding::UTF_8)
|
|
|
|
end
|
|
|
|
|
|
|
|
def author_name
|
|
|
|
author.name.force_encoding(Encoding::UTF_8)
|
|
|
|
end
|
2011-10-24 15:38:03 -04:00
|
|
|
end
|