From 5baa5fad0a1c6e2b8790f07f62c088fd505406d9 Mon Sep 17 00:00:00 2001 From: gitlabhq Date: Mon, 24 Oct 2011 22:38:03 +0300 Subject: Issue #149 --- lib/commit_ext.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 lib/commit_ext.rb (limited to 'lib/commit_ext.rb') diff --git a/lib/commit_ext.rb b/lib/commit_ext.rb new file mode 100644 index 00000000000..c175fa0cc2d --- /dev/null +++ b/lib/commit_ext.rb @@ -0,0 +1,9 @@ +module CommitExt + # Cause of encoding rails truncate raise error + # this method is temporary decision + def truncated_message(size = 80) + message.length > size ? (message[0..(size - 1)] + "...") : message + rescue + "-- invalid encoding for commit message" + end +end -- cgit v1.2.1