openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

ruby.php (9420B)


      1 <?php
      2 /*************************************************************************************
      3  * ruby.php
      4  * --------
      5  * Author: Moises Deniz
      6  * Copyright: (c) 2007 Moises Deniz
      7  * Release Version: 1.0.7.20
      8  * Date Started: 2007/03/21
      9  *
     10  * Ruby language file for GeSHi
     11  *
     12  *************************************************************************************
     13  *
     14  *   This file is part of GeSHi.
     15  *
     16  *   GeSHi is free software; you can redistribute it and/or modify
     17  *   it under the terms of the GNU General Public License as published by
     18  *   the Free Software Foundation; either version 2 of the License, or
     19  *   (at your option) any later version.
     20  *
     21  *   GeSHi is distributed in the hope that it will be useful,
     22  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     23  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     24  *   GNU General Public License for more details.
     25  *
     26  *   You should have received a copy of the GNU General Public License
     27  *   along with GeSHi; if not, write to the Free Software
     28  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     29  *
     30  ************************************************************************************/
     31 
     32 $language_data = array (
     33     'LANG_NAME' => 'Ruby',
     34     'COMMENT_SINGLE' => array(1 => "#"),
     35     'COMMENT_MULTI' => array("=begin" => "=end"),
     36     'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
     37     'QUOTEMARKS' => array('"', '`','\''),
     38     'ESCAPE_CHAR' => '\\',
     39     'KEYWORDS' => array(
     40         1 => array(
     41                 'alias', 'and', 'begin', 'break', 'case', 'class',
     42                 'def', 'defined', 'do', 'else', 'elsif', 'end',
     43                 'ensure', 'for', 'if', 'in', 'module', 'while',
     44                 'next', 'not', 'or', 'redo', 'rescue', 'yield',
     45                 'retry', 'super', 'then', 'undef', 'unless',
     46                 'until', 'when', 'BEGIN', 'END', 'include'
     47             ),
     48         2 => array(
     49                 '__FILE__', '__LINE__', 'false', 'nil', 'self', 'true',
     50                 'return'
     51             ),
     52         3 => array(
     53                 'Array', 'Float', 'Integer', 'String', 'at_exit',
     54                 'autoload', 'binding', 'caller', 'catch', 'chop', 'chop!',
     55                 'chomp', 'chomp!', 'eval', 'exec', 'exit', 'exit!', 'fail',
     56                 'fork', 'format', 'gets', 'global_variables', 'gsub', 'gsub!',
     57                 'iterator?', 'lambda', 'load', 'local_variables', 'loop',
     58                 'open', 'p', 'print', 'printf', 'proc', 'putc', 'puts',
     59                 'raise', 'rand', 'readline', 'readlines', 'require', 'select',
     60                 'sleep', 'split', 'sprintf', 'srand', 'sub', 'sub!', 'syscall',
     61                 'system', 'trace_var', 'trap', 'untrace_var'
     62             ),
     63         4 => array(
     64                 'Abbrev', 'ArgumentError', 'Base64', 'Benchmark',
     65                 'Benchmark::Tms', 'Bignum', 'Binding', 'CGI', 'CGI::Cookie',
     66                 'CGI::HtmlExtension', 'CGI::QueryExtension',
     67                 'CGI::Session', 'CGI::Session::FileStore',
     68                 'CGI::Session::MemoryStore', 'Class', 'Comparable', 'Complex',
     69                 'ConditionVariable', 'Continuation', 'Data',
     70                 'Date', 'DateTime', 'Delegator', 'Dir', 'EOFError', 'ERB',
     71                 'ERB::Util', 'Enumerable', 'Enumerable::Enumerator', 'Errno',
     72                 'Exception', 'FalseClass', 'File',
     73                 'File::Constants', 'File::Stat', 'FileTest', 'FileUtils',
     74                 'FileUtils::DryRun', 'FileUtils::NoWrite',
     75                 'FileUtils::StreamUtils_', 'FileUtils::Verbose', 'Find',
     76                 'Fixnum', 'FloatDomainError', 'Forwardable', 'GC', 'Generator',
     77                 'Hash', 'IO', 'IOError', 'Iconv', 'Iconv::BrokenLibrary',
     78                 'Iconv::Failure', 'Iconv::IllegalSequence',
     79                 'Iconv::InvalidCharacter', 'Iconv::InvalidEncoding',
     80                 'Iconv::OutOfRange', 'IndexError', 'Interrupt', 'Kernel',
     81                 'LoadError', 'LocalJumpError', 'Logger', 'Logger::Application',
     82                 'Logger::Error', 'Logger::Formatter', 'Logger::LogDevice',
     83                 'Logger::LogDevice::LogDeviceMutex', 'Logger::Severity',
     84                 'Logger::ShiftingError', 'Marshal', 'MatchData',
     85                 'Math', 'Matrix', 'Method', 'Module', 'Mutex', 'NameError',
     86                 'NameError::message', 'NilClass', 'NoMemoryError',
     87                 'NoMethodError', 'NotImplementedError', 'Numeric', 'Object',
     88                 'ObjectSpace', 'Observable', 'PStore', 'PStore::Error',
     89                 'Pathname', 'Precision', 'Proc', 'Process', 'Process::GID',
     90                 'Process::Status', 'Process::Sys', 'Process::UID', 'Queue',
     91                 'Range', 'RangeError', 'Rational', 'Regexp', 'RegexpError',
     92                 'RuntimeError', 'ScriptError', 'SecurityError', 'Set',
     93                 'Shellwords', 'Signal', 'SignalException', 'SimpleDelegator',
     94                 'SingleForwardable', 'Singleton', 'SingletonClassMethods',
     95                 'SizedQueue', 'SortedSet', 'StandardError', 'StringIO',
     96                 'StringScanner', 'StringScanner::Error', 'Struct', 'Symbol',
     97                 'SyncEnumerator', 'SyntaxError', 'SystemCallError',
     98                 'SystemExit', 'SystemStackError', 'Tempfile',
     99                 'Test::Unit::TestCase', 'Test::Unit', 'Test', 'Thread',
    100                 'ThreadError', 'ThreadGroup',
    101                 'ThreadsWait', 'Time', 'TrueClass', 'TypeError', 'URI',
    102                 'URI::BadURIError', 'URI::Error', 'URI::Escape', 'URI::FTP',
    103                 'URI::Generic', 'URI::HTTP', 'URI::HTTPS',
    104                 'URI::InvalidComponentError', 'URI::InvalidURIError',
    105                 'URI::LDAP', 'URI::MailTo', 'URI::REGEXP',
    106                 'URI::REGEXP::PATTERN', 'UnboundMethod', 'Vector', 'YAML',
    107                 'ZeroDivisionError', 'Zlib',
    108                 'Zlib::BufError', 'Zlib::DataError', 'Zlib::Deflate',
    109                 'Zlib::Error', 'Zlib::GzipFile', 'Zlib::GzipFile::CRCError',
    110                 'Zlib::GzipFile::Error', 'Zlib::GzipFile::LengthError',
    111                 'Zlib::GzipFile::NoFooter', 'Zlib::GzipReader',
    112                 'Zlib::GzipWriter', 'Zlib::Inflate', 'Zlib::MemError',
    113                 'Zlib::NeedDict', 'Zlib::StreamEnd', 'Zlib::StreamError',
    114                 'Zlib::VersionError',
    115                 'Zlib::ZStream',
    116                 'Enumerable',
    117                 'HTML::Selector', 'HashWithIndifferentAccess', 'Inflector',
    118                 'Inflector::Inflections', 'Mime', 'Mime::Type',
    119                 'OCI8AutoRecover', 'Symbol', 'TimeZone', 'XmlSimple'
    120             ),
    121         ),
    122     'SYMBOLS' => array(
    123         '(', ')', '[', ']', '{', '}', '%', '&', '*', '|', '/', '<', '>',
    124         '+', '-', '=&gt;', '=>', '<<'
    125         ),
    126     'CASE_SENSITIVE' => array(
    127         GESHI_COMMENTS => false,
    128         1 => false,
    129         2 => false,
    130         3 => false,
    131         4 => true,
    132         ),
    133     'STYLES' => array(
    134         'KEYWORDS' => array(
    135             1 => 'color:#9966CC; font-weight:bold;',
    136             2 => 'color:#0000FF; font-weight:bold;',
    137             3 => 'color:#CC0066; font-weight:bold;',
    138             4 => 'color:#CC00FF; font-weight:bold;',
    139             ),
    140         'COMMENTS' => array(
    141             1 => 'color:#008000; font-style:italic;',
    142                     'MULTI' => 'color:#000080; font-style:italic;'
    143             ),
    144         'ESCAPE_CHAR' => array(
    145             0 => 'color:#000099;'
    146             ),
    147         'BRACKETS' => array(
    148             0 => 'color:#006600; font-weight:bold;'
    149             ),
    150         'STRINGS' => array(
    151             0 => 'color:#996600;'
    152             ),
    153         'NUMBERS' => array(
    154             0 => 'color:#006666;'
    155             ),
    156         'METHODS' => array(
    157             1 => 'color:#9900CC;'
    158             ),
    159         'SYMBOLS' => array(
    160             0 => 'color:#006600; font-weight:bold;'
    161             ),
    162         'REGEXPS' => array(
    163             0 => 'color:#ff6633; font-weight:bold;',
    164             1 => 'color:#0066ff; font-weight:bold;',
    165             2 => 'color:#6666ff; font-weight:bold;',
    166             3 => 'color:#ff3333; font-weight:bold;'
    167             ),
    168         'SCRIPT' => array(
    169             0 => '',
    170             1 => '',
    171             2 => '',
    172             )
    173         ),
    174     'URLS' => array(
    175         1 => '',
    176         2 => '',
    177         3 => ''
    178         ),
    179     'OOLANG' => true,
    180     'OBJECT_SPLITTERS' => array(
    181         1 => '.'
    182         ),
    183     'REGEXPS' => array(
    184         0 => array(
    185             GESHI_SEARCH => "([[:space:]])(\\$[a-zA-Z_][a-zA-Z0-9_]*)",
    186             GESHI_REPLACE => '\\2',
    187             GESHI_MODIFIERS => '',
    188             GESHI_BEFORE => '\\1',
    189             GESHI_AFTER => ''
    190             ),
    191         1 => array(
    192             GESHI_SEARCH => "([[:space:]])(@[a-zA-Z_][a-zA-Z0-9_]*)",
    193             GESHI_REPLACE => '\\2',
    194             GESHI_MODIFIERS => '',
    195             GESHI_BEFORE => '\\1',
    196             GESHI_AFTER => ''
    197             ),
    198         2 => "([A-Z][a-zA-Z0-9_]*::)+[A-Z][a-zA-Z0-9_]*",
    199         3 => array(
    200             GESHI_SEARCH => "([[:space:]]|\[|\()(:[a-zA-Z_][a-zA-Z0-9_]*)",
    201             GESHI_REPLACE => '\\2',
    202             GESHI_MODIFIERS => '',
    203             GESHI_BEFORE => '\\1',
    204             GESHI_AFTER => ''
    205             )
    206         ),
    207     'STRICT_MODE_APPLIES' => GESHI_MAYBE,
    208     'SCRIPT_DELIMITERS' => array(
    209         0 => array(
    210             '<%' => '%>'
    211             )
    212         ),
    213     'HIGHLIGHT_STRICT_BLOCK' => array(
    214         0 => true,
    215         ),
    216     'TAB_WIDTH' => 2
    217 );
    218 
    219 ?>