summaryrefslogtreecommitdiff
path: root/sample/div.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2006-10-17 10:10:35 +0000
committermurphy <murphy@rubychan.de>2006-10-17 10:10:35 +0000
commit5e0d6d97bf4676ab1c1ca9b06590dd774d263b0d (patch)
treedb433d0109b087ffaa3f25fece64ea62c7481e8e /sample/div.rb
parent975a2fd6ea64529d993bc1412899fad386ff02ea (diff)
downloadcoderay-5e0d6d97bf4676ab1c1ca9b06590dd774d263b0d.tar.gz
Renamed demo files (trim demo_ prefix).
Diffstat (limited to 'sample/div.rb')
-rw-r--r--sample/div.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/sample/div.rb b/sample/div.rb
new file mode 100644
index 0000000..27b6f32
--- /dev/null
+++ b/sample/div.rb
@@ -0,0 +1,19 @@
+require 'coderay'
+
+puts CodeRay.scan(DATA.read, :ruby).div
+
+__END__
+for a in 0..255
+ a = a.chr
+ begin
+ x = eval("?\\#{a}")
+ if x == a[0]
+ next
+ else
+ print "#{a}: #{x}"
+ end
+ rescue SyntaxError => boom
+ print "#{a}: error"
+ end
+ puts
+end