diff .svn/pristine/ff/ff7c7a78022ec834d13d1e81c3b7d935dfcd48bf.svn-base @ 909:cbb26bc654de redmine-1.3

Update to Redmine 1.3-stable branch (Redmine SVN rev 8964)
author Chris Cannam
date Fri, 24 Feb 2012 19:09:32 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.svn/pristine/ff/ff7c7a78022ec834d13d1e81c3b7d935dfcd48bf.svn-base	Fri Feb 24 19:09:32 2012 +0000
@@ -0,0 +1,25 @@
+module CodeRay
+module Encoders
+  
+  load :token_kind_filter
+  
+  # A simple Filter that removes all tokens of the :comment kind.
+  # 
+  # Alias: +remove_comments+
+  # 
+  # Usage:
+  #  CodeRay.scan('print # foo', :ruby).comment_filter.text
+  #  #-> "print "
+  # 
+  # See also: TokenKindFilter, LinesOfCode
+  class CommentFilter < TokenKindFilter
+    
+    register_for :comment_filter
+    
+    DEFAULT_OPTIONS = superclass::DEFAULT_OPTIONS.merge \
+      :exclude => [:comment, :docstring]
+    
+  end
+  
+end
+end