Permalink
Browse files

Added encoding_file function for ruby plugin

  • Loading branch information...
1 parent dea2b49 commit 03d199c4127db2efe94f34f5ec83c7bd67267151 @tinogomes committed Jan 10, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 plugins/ruby/ruby.plugin.zsh
@@ -4,3 +4,9 @@ alias sgem='sudo gem'
# Find ruby file
alias rfind='find . -name "*.rb" | xargs grep -n'
+
+# Add first line "#encoding: UTF-8" into a file (for Ruby 1.9)
+encoding_file = function() {
+ sed '1i#encoding: UTF-8' $1 > /tmp/new_file.tmp
+ mv /tmp/new_file.tmp $1
+}

0 comments on commit 03d199c

Please sign in to comment.