summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/code-syntax-highlighter/shBrushRuby.js
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-08-25 08:08:24 -0300
committerRenato Botelho <renato@netgate.com>2015-08-25 14:49:54 -0300
commit46bc6e545a17e77202aaf01ec0cd8d5a46567525 (patch)
tree32d18dda436ec739c67c489ceb771e8629cd926f /src/usr/local/www/code-syntax-highlighter/shBrushRuby.js
parent4d9801c2dbd2b3e54a39578ee62b93af66607227 (diff)
downloadpfsense-46bc6e545a17e77202aaf01ec0cd8d5a46567525.zip
pfsense-46bc6e545a17e77202aaf01ec0cd8d5a46567525.tar.gz
Move main pfSense content to src/
Diffstat (limited to 'src/usr/local/www/code-syntax-highlighter/shBrushRuby.js')
-rw-r--r--src/usr/local/www/code-syntax-highlighter/shBrushRuby.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/usr/local/www/code-syntax-highlighter/shBrushRuby.js b/src/usr/local/www/code-syntax-highlighter/shBrushRuby.js
new file mode 100644
index 0000000..fdc5e34
--- /dev/null
+++ b/src/usr/local/www/code-syntax-highlighter/shBrushRuby.js
@@ -0,0 +1,26 @@
+/* Ruby 1.8.4 syntax contributed by Erik Peterson */
+dp.sh.Brushes.Ruby = function()
+{
+ var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' +
+ 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' +
+ 'self super then throw true undef unless until when while yield';
+
+ var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' +
+ 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' +
+ 'ThreadGroup Thread Time TrueClass'
+
+ this.regexList = [
+ { regex: dp.sh.RegexLib.SingleLinePerlComments, css: 'comment' }, // one line comments
+ { regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string' }, // double quoted strings
+ { regex: dp.sh.RegexLib.SingleQuotedString, css: 'string' }, // single quoted strings
+ { regex: new RegExp(':[a-z][A-Za-z0-9_]*', 'g'), css: 'symbol' }, // symbols
+ { regex: new RegExp('[\\$|@|@@]\\w+', 'g'), css: 'variable' }, // $global, @instance, and @@class variables
+ { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
+ { regex: new RegExp(this.GetKeywords(builtins), 'gm'), css: 'builtin' } // builtins
+ ];
+
+ this.CssClass = 'dp-rb';
+}
+
+dp.sh.Brushes.Ruby.prototype = new dp.sh.Highlighter();
+dp.sh.Brushes.Ruby.Aliases = ['ruby', 'rails'];
OpenPOWER on IntegriCloud