summaryrefslogtreecommitdiffstats
path: root/vendor/plugins/coderay-0.9.0/lib/coderay/encoders/json.rb
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/plugins/coderay-0.9.0/lib/coderay/encoders/json.rb')
-rw-r--r--vendor/plugins/coderay-0.9.0/lib/coderay/encoders/json.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/vendor/plugins/coderay-0.9.0/lib/coderay/encoders/json.rb b/vendor/plugins/coderay-0.9.0/lib/coderay/encoders/json.rb
new file mode 100644
index 000000000..6d789c6d5
--- /dev/null
+++ b/vendor/plugins/coderay-0.9.0/lib/coderay/encoders/json.rb
@@ -0,0 +1,19 @@
+module CodeRay
+module Encoders
+
+ # = JSON Encoder
+ class JSON < Encoder
+
+ register_for :json
+ FILE_EXTENSION = 'json'
+
+ protected
+ def compile tokens, options
+ require 'json'
+ @out = tokens.to_a.to_json
+ end
+
+ end
+
+end
+end