1;(function() 2{ 3 // CommonJS 4 SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 5 6 function Brush() 7 { 8 // Contributed by Erik Peterson. 9 10 var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + 11 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + 12 'self super then throw true undef unless until when while yield'; 13 14 var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + 15 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + 16 'ThreadGroup Thread Time TrueClass'; 17 18 this.regexList = [ 19 { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments 20 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 21 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 22 { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants 23 { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols 24 { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables 25 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 26 { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins 27 ]; 28 29 this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 30 }; 31 32 Brush.prototype = new SyntaxHighlighter.Highlighter(); 33 Brush.aliases = ['ruby', 'rails', 'ror', 'rb']; 34 35 SyntaxHighlighter.brushes.Ruby = Brush; 36 37 // CommonJS 38 typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 39})(); 40