chitin / chitinrc

Diff from to
   val = val.strip == '..' ? 'cd ".."' : val
 end
 
-pre_process do |val|
-  # if there is an unclosed string, close it and run it again.
-  # smart compilers are bad... but this ain't a compiler
-  #
-  # option: make it ask for confirmation first
-  # settable in chitinrc, perjaps?
-  if (e = syntax_error_for(val)) &&
-     e.message =~ /unterminated string meets end of file/
-
-    if syntax_error_for(val + '\'')
-      unless syntax_error_for(val + '"')
-        val << '"'
-      end
-    else
-      val << '\''
-    end
-
-  end
-
-  val
-end
-
-# You can use error classes as a name and if the error comes up,
-# block of code will be run.
+# Sample usage of pre_process and post_process.
+# This is taken from the lib/chitin/commands/builtins.rb
+#
+# pre_process do |val|
+#   # if there is an unclosed string, close it and run it again.
+#   # smart compilers are bad... but this ain't a compiler
+#   #
+#   # option: make it ask for confirmation first
+#   # settable in chitinrc, perjaps?
+#   if (e = syntax_error_for(val)) &&
+#      e.message =~ /unterminated string meets end of file/
 # 
-# post_process SyntaxError do |e, val|
-#   # sample
+#     if syntax_error_for(val + '\'')
+#       unless syntax_error_for(val + '"')
+#         val << '"'
+#       end
+#     else
+#       val << '\''
+#     end
+# 
+#   end
+# 
+#   val
+# end
+# 
+# # You can use error classes as a name and if the error comes up,
+# # block of code will be run.
+# # 
+# # post_process SyntaxError do |e, val|
+# #   # sample
+# # end
+# 
+# post_process :color do |val|
+#   Wirble::Colorize.colorize val
 # end
 
-post_process :color do |val|
-  Wirble::Colorize.colorize val
-end
-
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.