2 /*************************************************************************************
6 * Copyright: (c) 2005 Moises Deniz
7 * Release Version: 1.0.8.11
8 * Date Started: 2007/03/21
10 * Ruby (with Ruby on Rails Framework) language file for GeSHi.
12 *************************************************************************************
14 * This file is part of GeSHi.
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.
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.
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
30 ************************************************************************************/
32 $language_data = array (
33 'LANG_NAME' => 'Rails',
34 'COMMENT_SINGLE' => array(1 => "#"),
35 'COMMENT_MULTI' => array("=begin" => "=end"),
36 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE
,
37 'QUOTEMARKS' => array('"', '`','\''),
38 'ESCAPE_CHAR' => '\\',
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'
49 '__FILE__', '__LINE__', 'false', 'nil', 'self', 'true',
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'
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',
116 'ActionController::AbstractRequest',
117 'ActionController::Assertions::DomAssertions',
118 'ActionController::Assertions::ModelAssertions',
119 'ActionController::Assertions::ResponseAssertions',
120 'ActionController::Assertions::RoutingAssertions',
121 'ActionController::Assertions::SelectorAssertions',
122 'ActionController::Assertions::TagAssertions',
123 'ActionController::Base',
124 'ActionController::Benchmarking::ClassMethods',
125 'ActionController::Caching',
126 'ActionController::Caching::Actions',
127 'ActionController::Caching::Actions::ActionCachePath',
128 'ActionController::Caching::Fragments',
129 'ActionController::Caching::Pages',
130 'ActionController::Caching::Pages::ClassMethods',
131 'ActionController::Caching::Sweeping',
132 'ActionController::Components',
133 'ActionController::Components::ClassMethods',
134 'ActionController::Components::InstanceMethods',
135 'ActionController::Cookies',
136 'ActionController::Filters::ClassMethods',
137 'ActionController::Flash',
138 'ActionController::Flash::FlashHash',
139 'ActionController::Helpers::ClassMethods',
140 'ActionController::Integration::Session',
141 'ActionController::IntegrationTest',
142 'ActionController::Layout::ClassMethods',
143 'ActionController::Macros',
144 'ActionController::Macros::AutoComplete::ClassMethods',
145 'ActionController::Macros::InPlaceEditing::ClassMethods',
146 'ActionController::MimeResponds::InstanceMethods',
147 'ActionController::Pagination',
148 'ActionController::Pagination::ClassMethods',
149 'ActionController::Pagination::Paginator',
150 'ActionController::Pagination::Paginator::Page',
151 'ActionController::Pagination::Paginator::Window',
152 'ActionController::Rescue', 'ActionController::Resources',
153 'ActionController::Routing',
154 'ActionController::Scaffolding::ClassMethods',
155 'ActionController::SessionManagement::ClassMethods',
156 'ActionController::Streaming', 'ActionController::TestProcess',
157 'ActionController::TestUploadedFile',
158 'ActionController::UrlWriter',
159 'ActionController::Verification::ClassMethods',
160 'ActionMailer::Base', 'ActionView::Base',
161 'ActionView::Helpers::ActiveRecordHelper',
162 'ActionView::Helpers::AssetTagHelper',
163 'ActionView::Helpers::BenchmarkHelper',
164 'ActionView::Helpers::CacheHelper',
165 'ActionView::Helpers::CaptureHelper',
166 'ActionView::Helpers::DateHelper',
167 'ActionView::Helpers::DebugHelper',
168 'ActionView::Helpers::FormHelper',
169 'ActionView::Helpers::FormOptionsHelper',
170 'ActionView::Helpers::FormTagHelper',
171 'ActionView::Helpers::JavaScriptHelper',
172 'ActionView::Helpers::JavaScriptMacrosHelper',
173 'ActionView::Helpers::NumberHelper',
174 'ActionView::Helpers::PaginationHelper',
175 'ActionView::Helpers::PrototypeHelper',
176 'ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods',
177 'ActionView::Helpers::ScriptaculousHelper',
178 'ActionView::Helpers::TagHelper',
179 'ActionView::Helpers::TextHelper',
180 'ActionView::Helpers::UrlHelper', 'ActionView::Partials',
181 'ActionWebService::API::Method', 'ActionWebService::Base',
182 'ActionWebService::Client::Soap',
183 'ActionWebService::Client::XmlRpc',
184 'ActionWebService::Container::ActionController::ClassMethods',
185 'ActionWebService::Container::Delegated::ClassMethods',
186 'ActionWebService::Container::Direct::ClassMethods',
187 'ActionWebService::Invocation::ClassMethods',
188 'ActionWebService::Scaffolding::ClassMethods',
189 'ActionWebService::SignatureTypes', 'ActionWebService::Struct',
190 'ActiveRecord::Acts::List::ClassMethods',
191 'ActiveRecord::Acts::List::InstanceMethods',
192 'ActiveRecord::Acts::NestedSet::ClassMethods',
193 'ActiveRecord::Acts::NestedSet::InstanceMethods',
194 'ActiveRecord::Acts::Tree::ClassMethods',
195 'ActiveRecord::Acts::Tree::InstanceMethods',
196 'ActiveRecord::Aggregations::ClassMethods',
197 'ActiveRecord::Associations::ClassMethods',
198 'ActiveRecord::AttributeMethods::ClassMethods',
199 'ActiveRecord::Base',
200 'ActiveRecord::Calculations::ClassMethods',
201 'ActiveRecord::Callbacks',
202 'ActiveRecord::ConnectionAdapters::AbstractAdapter',
203 'ActiveRecord::ConnectionAdapters::Column',
204 'ActiveRecord::ConnectionAdapters::DB2Adapter',
205 'ActiveRecord::ConnectionAdapters::DatabaseStatements',
206 'ActiveRecord::ConnectionAdapters::FirebirdAdapter',
207 'ActiveRecord::ConnectionAdapters::FrontBaseAdapter',
208 'ActiveRecord::ConnectionAdapters::MysqlAdapter',
209 'ActiveRecord::ConnectionAdapters::OpenBaseAdapter',
210 'ActiveRecord::ConnectionAdapters::OracleAdapter',
211 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter',
212 'ActiveRecord::ConnectionAdapters::Quoting',
213 'ActiveRecord::ConnectionAdapters::SQLServerAdapter',
214 'ActiveRecord::ConnectionAdapters::SQLiteAdapter',
215 'ActiveRecord::ConnectionAdapters::SchemaStatements',
216 'ActiveRecord::ConnectionAdapters::SybaseAdapter::ColumnWithIdentity',
217 'ActiveRecord::ConnectionAdapters::SybaseAdapterContext',
218 'ActiveRecord::ConnectionAdapters::TableDefinition',
219 'ActiveRecord::Errors', 'ActiveRecord::Locking',
220 'ActiveRecord::Locking::Optimistic',
221 'ActiveRecord::Locking::Optimistic::ClassMethods',
222 'ActiveRecord::Locking::Pessimistic',
223 'ActiveRecord::Migration', 'ActiveRecord::Observer',
224 'ActiveRecord::Observing::ClassMethods',
225 'ActiveRecord::Reflection::ClassMethods',
226 'ActiveRecord::Reflection::MacroReflection',
227 'ActiveRecord::Schema', 'ActiveRecord::Timestamp',
228 'ActiveRecord::Transactions::ClassMethods',
229 'ActiveRecord::Validations',
230 'ActiveRecord::Validations::ClassMethods',
231 'ActiveRecord::XmlSerialization',
232 'ActiveSupport::CachingTools::HashCaching',
233 'ActiveSupport::CoreExtensions::Array::Conversions',
234 'ActiveSupport::CoreExtensions::Array::Grouping',
235 'ActiveSupport::CoreExtensions::Date::Conversions',
236 'ActiveSupport::CoreExtensions::Hash::Conversions',
237 'ActiveSupport::CoreExtensions::Hash::Conversions::ClassMethods',
238 'ActiveSupport::CoreExtensions::Hash::Diff',
239 'ActiveSupport::CoreExtensions::Hash::Keys',
240 'ActiveSupport::CoreExtensions::Hash::ReverseMerge',
241 'ActiveSupport::CoreExtensions::Integer::EvenOdd',
242 'ActiveSupport::CoreExtensions::Integer::Inflections',
243 'ActiveSupport::CoreExtensions::Numeric::Bytes',
244 'ActiveSupport::CoreExtensions::Numeric::Time',
245 'ActiveSupport::CoreExtensions::Pathname::CleanWithin',
246 'ActiveSupport::CoreExtensions::Range::Conversions',
247 'ActiveSupport::CoreExtensions::String::Access',
248 'ActiveSupport::CoreExtensions::String::Conversions',
249 'ActiveSupport::CoreExtensions::String::Inflections',
250 'ActiveSupport::CoreExtensions::String::Iterators',
251 'ActiveSupport::CoreExtensions::String::StartsEndsWith',
252 'ActiveSupport::CoreExtensions::String::Unicode',
253 'ActiveSupport::CoreExtensions::Time::Calculations',
254 'ActiveSupport::CoreExtensions::Time::Calculations::ClassMethods',
255 'ActiveSupport::CoreExtensions::Time::Conversions',
256 'ActiveSupport::Multibyte::Chars',
257 'ActiveSupport::Multibyte::Handlers::UTF8Handler',
258 'Breakpoint', 'Builder::BlankSlate', 'Builder::XmlMarkup',
260 'HTML::Selector', 'HashWithIndifferentAccess', 'Inflector',
261 'Inflector::Inflections', 'Mime', 'Mime::Type',
262 'OCI8AutoRecover', 'TimeZone', 'XmlSimple'
265 'image_tag', 'link_to', 'link_to_remote', 'javascript_include_tag',
266 'assert_equal', 'assert_not_equal', 'before_filter',
267 'after_filter', 'render', 'redirect_to', 'hide_action',
268 'render_to_string', 'url_for', 'controller_name',
269 'controller_class_name', 'controller_path', 'session',
270 'render_component', 'render_component_as_string', 'cookie',
271 'layout', 'flash', 'auto_complete_for', 'in_place_editor_for',
272 'respond_to', 'paginate', 'current_page', 'each', 'first',
273 'first_page', 'last_page', 'last', 'length', 'new', 'page_count',
274 'previous', 'scaffold', 'send_data',
275 'send_file', 'deliver', 'receive', 'error_messages_for',
276 'error_message_on', 'form', 'input', 'stylesheet_link_tag',
277 'stylesheet_path', 'content_for', 'select_date', 'ago',
278 'month', 'day', 'check_box', 'fields_for', 'file_field',
279 'form_for', 'hidden_field', 'text_area', 'password_field',
280 'collection_select', 'options_for_select',
281 'options_from_collection_for_select', 'file_field_tag',
282 'form_for_tag', 'hidden_field_tag', 'text_area_tag',
283 'password_field_tag', 'link_to_function', 'javascript_tag',
284 'human_size', 'number_to_currency', 'pagination_links',
285 'form_remote_tag', 'form_remote_for',
286 'submit_to_remote', 'remote_function', 'observe_form',
287 'observe_field', 'remote_form_for', 'options_for_ajax', 'alert',
288 'call', 'assign', 'show', 'hide', 'insert_html', 'sortable',
289 'toggle', 'visual_effect', 'replace', 'replace_html', 'remove',
290 'save', 'save!', 'draggable', 'drop_receiving', 'literal',
291 'draggable_element', 'drop_receiving_element', 'sortable_element',
292 'content_tag', 'tag', 'link_to_image', 'link_to_if',
293 'link_to_unless', 'mail_to', 'link_image_to', 'button_to',
294 'current_page?', 'act_as_list', 'act_as_nested', 'act_as_tree',
295 'has_many', 'has_one', 'belongs_to', 'has_many_and_belogns_to',
296 'delete', 'destroy', 'destroy_all', 'clone', 'deep_clone', 'copy',
297 'update', 'table_name', 'primary_key', 'sum', 'maximun', 'minimum',
298 'count', 'size', 'after_save', 'after_create', 'before_save',
299 'before_create', 'add_to_base', 'errors', 'add', 'validate',
300 'validates_presence_of', 'validates_numericality_of',
301 'validates_uniqueness_of', 'validates_length_of',
302 'validates_format_of', 'validates_size_of', 'to_a', 'to_s',
307 '(', ')', '[', ']', '{', '}', '%', '&', '*', '|', '/', '<', '>',
310 'CASE_SENSITIVE' => array(
311 GESHI_COMMENTS
=> false,
320 1 => 'color:#9966CC; font-weight:bold;',
321 2 => 'color:#0000FF; font-weight:bold;',
322 3 => 'color:#CC0066; font-weight:bold;',
323 4 => 'color:#CC00FF; font-weight:bold;',
324 5 => 'color:#5A0A0A; font-weight:bold;'
327 1 => 'color:#008000; font-style:italic;',
328 'MULTI' => 'color:#000080; font-style:italic;'
330 'ESCAPE_CHAR' => array(
331 0 => 'color:#000099;'
334 0 => 'color:#006600; font-weight:bold;'
337 0 => 'color:#996600;'
340 0 => 'color:#006666;'
343 1 => 'color:#9900CC;'
346 0 => 'color:#006600; font-weight:bold;'
349 0 => 'color:#ff6633; font-weight:bold;',
350 1 => 'color:#0066ff; font-weight:bold;',
351 2 => 'color:#6666ff; font-weight:bold;',
352 3 => 'color:#ff3333; font-weight:bold;'
368 'OBJECT_SPLITTERS' => array(
373 GESHI_SEARCH
=> "([[:space:]])(\\$[a-zA-Z_][a-zA-Z0-9_]*)",
374 GESHI_REPLACE
=> '\\2',
375 GESHI_MODIFIERS
=> '',
376 GESHI_BEFORE
=> '\\1',
380 GESHI_SEARCH
=> "([[:space:]])(@[a-zA-Z_][a-zA-Z0-9_]*)",
381 GESHI_REPLACE
=> '\\2',
382 GESHI_MODIFIERS
=> '',
383 GESHI_BEFORE
=> '\\1',
386 2 => "([A-Z][a-zA-Z0-9_]*::)+[A-Z][a-zA-Z0-9_]*", //Static OOP References
388 GESHI_SEARCH
=> "([[:space:]]|\[|\()(:[a-zA-Z_][a-zA-Z0-9_]*)",
389 GESHI_REPLACE
=> '\\2',
390 GESHI_MODIFIERS
=> '',
391 GESHI_BEFORE
=> '\\1',
395 'STRICT_MODE_APPLIES' => GESHI_MAYBE
,
396 'SCRIPT_DELIMITERS' => array(
401 'HIGHLIGHT_STRICT_BLOCK' => array(