summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorgitlabhq <m@gitlabhq.com>2011-10-24 22:38:03 +0300
committergitlabhq <m@gitlabhq.com>2011-10-24 22:38:03 +0300
commit5baa5fad0a1c6e2b8790f07f62c088fd505406d9 (patch)
tree80e5fe5e9de9c31089543a4970aa3bed625643f0 /lib
parent61e6751ea676d23f5ef88de6d0bf9c273f785516 (diff)
downloadgitlab-ce-5baa5fad0a1c6e2b8790f07f62c088fd505406d9.tar.gz
Issue #149
Diffstat (limited to 'lib')
-rw-r--r--lib/commit_ext.rb9
1 files changed, 9 insertions, 0 deletions
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