summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demo/coderay_demos.tar.gzbin0 -> 9620 bytes
-rw-r--r--lib/coderay/encoders/null.rb12
2 files changed, 9 insertions, 3 deletions
diff --git a/demo/coderay_demos.tar.gz b/demo/coderay_demos.tar.gz
new file mode 100644
index 0000000..f1b3a93
--- /dev/null
+++ b/demo/coderay_demos.tar.gz
Binary files differ
diff --git a/lib/coderay/encoders/null.rb b/lib/coderay/encoders/null.rb
index 67c4987..e995cb0 100644
--- a/lib/coderay/encoders/null.rb
+++ b/lib/coderay/encoders/null.rb
@@ -1,12 +1,20 @@
module CodeRay
module Encoders
+ # = Null Encoder
+ #
+ # Does nothing and returns an empty string.
class Null < Encoder
include Streamable
register_for :null
- protected
+ # Defined for faster processing
+ def to_proc
+ proc {}
+ end
+
+ protected
def token(*)
# do nothing
@@ -16,5 +24,3 @@ module CodeRay
end
end
-
-