diff options
author | murphy <murphy@rubychan.de> | 2006-10-17 10:10:35 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2006-10-17 10:10:35 +0000 |
commit | 5e0d6d97bf4676ab1c1ca9b06590dd774d263b0d (patch) | |
tree | db433d0109b087ffaa3f25fece64ea62c7481e8e /sample/global_vars.rb | |
parent | 975a2fd6ea64529d993bc1412899fad386ff02ea (diff) | |
download | coderay-5e0d6d97bf4676ab1c1ca9b06590dd774d263b0d.tar.gz |
Renamed demo files (trim demo_ prefix).
Diffstat (limited to 'sample/global_vars.rb')
-rw-r--r-- | sample/global_vars.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sample/global_vars.rb b/sample/global_vars.rb new file mode 100644 index 0000000..8066d67 --- /dev/null +++ b/sample/global_vars.rb @@ -0,0 +1,13 @@ +code = <<'CODE'
+$ie.text_field(:name, "pAnfrage ohne $gV und mit #{$gv}").set artikel
+oder
+text = $bla.test(...)
+CODE
+
+require 'coderay'
+
+tokens = CodeRay.scan code, :ruby
+tokens.each_text_token { |text, kind| text.upcase! }
+tokens.each(:global_variable) { |text, kind| text.replace '<--%s-->' % text }
+
+print tokens
|