PageSourceSearch

https://wild-cards.net/wc/wp-content/plugins/syntaxhighlighter/syn…/scripts/shBrushRuby.js?ver=2.1.364

js wild-cards.net collected 2026-10-03 22:10:51 UTC 2,713 bytes, 57 lines download raw bytes

1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 *
8 * @version
9 * 2.1.364 (October 15 2009)
10 * 
11 * @copyright
12 * Copyright (C) 2004-2009 Alex Gorbatchev.
13 *
14 * @license
15 * This file is part of SyntaxHighlighter.
16 * 
17 * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU Lesser General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
21 * 
22 * SyntaxHighlighter is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25 * GNU General Public License for more details.
26 * 
27 * You should have received a copy of the GNU General Public License
28 * along with SyntaxHighlighter.  If not, see <http://www.gnu.org/copyleft/lesser.html>.
29 */
30SyntaxHighlighter.brushes.Ruby = function()
31{
32	// Contributed by Erik Peterson.
33	
34	var keywords =	'alias and BEGIN begin break case class def define_method defined do each else elsif ' +
35					'END end ensure false for if in module new next nil not or raise redo rescue retry return ' +
36					'self super then throw true undef unless until when while yield';
37
38	var builtins =	'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' +
39					'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' +
40					'ThreadGroup Thread Time TrueClass';
41
42	this.regexList = [
43		{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments,	css: 'comments' },		// one line comments
44		{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,		css: 'string' },		// double quoted strings
45		{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },		// single quoted strings
46		{ regex: /\b[A-Z0-9_]+\b/g,									css: 'constants' },		// constants
47		{ regex: /:[a-z][A-Za-z0-9_]*/g,							css: 'color2' },		// symbols
48		{ regex: /(\$|@@|@)\w+/g,									css: 'variable bold' },	// $global, @instance, and @@class variables
49		{ regex: new RegExp(this.getKeywords(keywords), 'gm'),		css: 'keyword' },		// keywords
50		{ regex: new RegExp(this.getKeywords(builtins), 'gm'),		css: 'color1' }			// builtins
51		];
52
53	this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
54};
55
56SyntaxHighlighter.brushes.Ruby.prototype	= new SyntaxHighlighter.Highlighter();
57SyntaxHighlighter.brushes.Ruby.aliases		= ['ruby', 'rails', 'ror', 'rb'];

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.