summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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