#-------------------------------------------------------------------------------
#
#	Name    : Ruby On Rails
#	Purpose : StrongED mode file for Ruby On Rails files
#	Author  :  Andrew Hodgkinson
#	Licence : Freeware
#	Version : 1.02, 16-Apr-2006
#
# Based on the Ruby On Rails syntax definition for TextPad.
#
#-------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# History
# =======
#
# 30-Jan-2006 (ADH): Created.
# 31-Jan-2006 (ADH): Correction to ModeWhen file and StrongHelp manual.
# 16-Apr-2006 (ADH): Final fixes to ModeWhen file. Updated manual.
#------------------------------------------------------------------------------

ID_FirstChar	A-Za-z_@$
ID_Middle	A-Za-z_0-9
ID_LastChar	A-Za-z_0-9!?

SyntaxOptions
	SingleQuote	Yes
	DoubleQuote	Yes
	QuoteChar	\
	QuoteQuote	No
	SplitString	No
	HexPrefix	0x
End

SyntaxComment 1
	Type		MultiLine
	StartWith	!--
	EndWith		-->
End

SyntaxComment 2
	Type		OneLine
	StartWith	#
End

# Primary keywords as defined in the Goat book (Ruby in a Nutshell)
# and online "Programming Ruby" guide from http://www.ruby-lang.org/

SyntaxWords Group1 case
	__FILE__
	__LINE__
	alias
	and
	begin end break
	case
	class
	def
	defined?
	do
	else
	elsif
	ensure
	false
	for
	if
	in
	keys
	module
	next
	nil
	not
	or
	redo
	rescue
	retry
	return
	self
	super
	then
	true
	undef
	unless
	until
	when
	while
	yield
End

# Built-In Classes & Methods
#
# The following characters used for methods were not added:
#
#   [ ] ]= ^ | ~ % & ` * + +@ -
#   -@ <, << <=, <=> == === =~
#   >, >= `
#
# Conflicts with reserved words:
#
#   begin
#   class
#   end
#   keys
#   next

SyntaxWords Group2 case
	Arithmetic
	Array
	Bignum
	Binding
	Bit
	Class
	Comparable
	Comparisons
	Continuation
	Dir
	Enumerable
	Errno
	Exception
	FalseClass
	File
	File::Stat
	FileTest
	Fixnum
	Float
	GC
	Hash
	IO
	Integer
	Kernel
	Marshal
	MatchData
	Math
	Method
	Module
	NilClass
	Numeric
	Object
	ObjectSpace
	Proc
	Process
	Range
	Regexp
	Signal
	String
	Struct
	Struct::Tms
	Symbol
	Thread
	ThreadGroup
	Time
	TrueClass
	__id__
	__send__
	_id2ref
	abort
	abort_on_exception
	abort_on_exception=
	abs
	acos
	add
	alias_method
	alive?
	all?
	all_symbols
	ancestors
	any?
	append_features
	arity
	asctime
	asin
	assoc
	at
	at_exit
	atan
	atan2
	atime
	attr
	attr_accessor
	attr_reader
	attr_writer
	autoload
	backtrace
	basename
	between?
	binding
	binmode
	blksize
	block_given?
	blockdev?
	blocks
	call
	callcc
	caller
	capitalize
	capitalize!
	casecmp
	casefold?
	catch
	ceil
	center
	chardev?
	chdir
	chmod
	chomp
	chomp!
	chop
	chop!
	chown
	chr
	chroot
	class_eval
	class_variables
	clear
	clone
	close
	close_read
	close_write
	closed?
	coerce
	collect
	collect!
	compact
	compact!
	compile
	concat
	const_defined?
	const_get
	const_set
	constants
	cos
	cosh
	count
	critical
	critical=
	crypt
	ctime
	current
	day
	default
	default=
	define_finalizer
	delete
	delete!
	delete_at
	delete_if
	detach
	detect
	dev
	directory?
	dirname
	disable
	display
	divmod
	downcase
	downcase!
	downto
	dump
	dup
	each
	each_byte
	each_index
	each_key
	each_line
	each_object
	each_pair
	each_value
	each_with_index
	egid
	egid=
	empty?
	enable
	entries
	eof
	eof?
	eql?
	equal?
	escape
	euid
	euid=
	eval
	exception
	exclude_end?
	exec
	executable?
	executable_real?
	exist?
	exists?
	exit
	exit!
	exp
	expand_path
	extend
	extend_object
	fail
	fcntl
	fetch
	file?
	fileno
	fill
	find
	find_all
	finite?
	first
	flatten
	flatten!
	flock
	floor
	flush
	fnmatch
	for_fd
	foreach
	fork
	format
	freeze
	frexp
	frozen?
	ftype
	garbage_collect
	getc
	getpgid
	getpgrp
	getpriority
	gets
	getwd
	gid
	gid=
	glob
	global_variables
	gm
	gmt?
	gmtime
	grep
	group
	grpowned?
	gsub
	gsub!
	has_key?
	has_value?
	hash
	hex
	hour
	hypot
	id
	id2name
	include
	include?
	included
	included_modules
	index
	indexes
	indices
	infinite?
	inherited
	initialize
	initialize_copy
	inject
	ino
	insert
	inspect
	instance_eval
	instance_methods
	instance_of?
	instance_variable_get
	instance_variable_set
	instance_variables
	integer?
	intern
	invert
	ioctl
	is_a?
	isatty
	isdst
	iterator?
	join
	kcode
	key?
	kill
	kind_of?
	lambda
	last
	last_match
	lchmod
	lchown
	ldexp
	length
	lineno
	lineno=
	link
	list
	ljust
	load
	local
	local_variables
	localtime
	log
	log10
	loop
	lstat
	lstrip
	lstrip!
	main
	map
	map!
	match
	max
	mday
	member?
	members
	merge
	merge!
	message
	method
	method_added
	method_defined?
	method_missing
	method_removed
	method_undefined
	methods
	min
	mkdir
	mktime
	mode
	module_eval
	module_function
	modules
	modulo
	mon
	month
	mtime
	name
	nan?
	nesting
	new
	next!
	nil?
	nitems
	nlink
	nonzero?
	now
	oct
	offset
	open
	operations
	owned?
	p
	pack
	pass
	path
	pid
	pipe
	pipe?
	pop
	popen
	pos
	pos=
	post_match
	ppid
	pre_match
	print
	printf
	priority
	priority=
	private
	private_class_method
	private_instance_methods
	private_methods
	proc
	protected
	protected_instance_methods
	protected_methods
	public
	public_class_method
	public_instance_methods
	public_methods
	push
	putc
	puts
	pwd
	quote
	raise
	rand
	rassoc
	rdev
	read
	readable?
	readable_real?
	readchar
	readline
	readlines
	readlink
	rehash
	reject
	reject!
	remainder
	remove_const
	remove_method
	rename
	reopen
	replace
	require
	respond_to?
	restore
	reverse
	reverse!
	reverse_each
	rewind
	rindex
	rjust
	rmdir
	round
	rstrip
	rstrip!
	run
	safe_level
	scan
	sec
	seek
	select
	send
	set_backtrace
	set_trace_func
	setgid?
	setpgid
	setpgrp
	setpriority
	setsid
	setuid?
	shift
	sin
	singleton_method_added
	singleton_method_removed
	singleton_method_undefined
	singleton_methods
	sinh
	size
	size?
	sleep
	slice
	slice!
	socket?
	sort
	sort!
	sort_by
	source
	split
	sprintf
	sqrt
	squeeze
	squeeze!
	srand
	start
	stat
	status
	step
	sticky?
	stop
	stop?
	store
	strftime
	string
	strip
	strip!
	sub
	sub!
	succ
	succ!
	sum
	superclass
	swapcase
	swapcase!
	symlink
	symlink?
	sync
	sync=
	syscall
	sysopen
	sysread
	sysseek
	system
	syswrite
	taint
	tainted?
	tan
	tanh
	tell
	terminate
	test
	throw
	times
	to_a
	to_ary
	to_f
	to_i
	to_io
	to_proc
	to_s
	to_str
	tr
	tr!
	tr_s
	tr_s!
	trace_var
	transpose
	trap
	truncate
	tty?
	tv_sec
	tv_usec
	type
	uid
	uid=
	umask
	undef_method
	undefine_finalizer
	ungetc
	uniq
	uniq!
	unlink
	unpack
	unshift
	untaint
	untrace_var
	upcase
	upcase!
	update
	upto
	usec
	utc
	utc?
	utime
	value
	value?
	values
	wait
	wait2
	waitall
	waitpid
	waitpid2
	wakeup
	warn
	wday
	writable?
	writable_real?
	write
	yday
	year
	zero?
	zip
	zone
End

# Predefined Variables & Constants
#
# Defining these is optional as it is sometimes confusing,
# esepcially in regular expressions ( eg: /\$!$/ ):
#
#   $! $" $$ $& $' $* $+ $, $. $/ $:
#   $; $< $= $> $? $@ $\ $_ $` $~
#

SyntaxWords Group3 case
	$-0
	$-a
	$-d
	$-F
	$-i
	$-K
	$-l
	$-p
	$-v
	$-w
	$0
	$1
	$2
	$3
	$4
	$5
	$6
	$9
	$DEBUG
	$defout
	$F
	$FILENAME
	$LOAD_PATH
	$SAFE
	$stderr
	$stdin
	$stdout
	$VERBOSE
	ARGF
	ARGV
	DATA
	ENV
	FALSE
	NIL
	RUBY_PLATFORM
	RUBY_RELEASE_DATE
	RUBY_VERSION
	STDERR
	STDIN
	STDOUT
	TOPLEVEL_BINDING
	TRUE
End

# Rails functions

SyntaxWords Group4 case
	before_filter
	after_filter
	filter
	layout
	require_dependency
	render
	render_action
	render_text
	render_file
	render_template
	render_nothing
	render_component
	render_without_layout
	url_for
	redirect_to
	redirect_to_path
	redirect_to_url
	helper
	helper_method
	model
	service
	observer
	serialize
	scaffold
	acts_as_list
	acts_as_tree
	after_create
	after_destroy
	after_save
	after_update
	after_validation
	after_validation_on_create
	after_validation_on_update
	before_create
	before_destroy
	before_save
	before_update
	before_validation
	before_validation_on_create
	before_validation_on_update
	composed_of
	belongs_to
	has_one
	has_many
	has_and_belongs_to_many
	helperhelper_method
	validate
	validate_on_create
	validates_numericality_of
	validate_on_update
	validates_acceptance_of
	validates_associated
	validates_confirmation_of
	validates_each
	validates_format_of
	validates_inclusion_of
	validates_exclusion_of
	validates_length_of
	validates_presence_of
	validates_size_of
	validates_uniqueness_of
End

# HTML tags for .rhtml templates

SyntaxWords Group5 nocase
	!DOCTYPE
	A
	ABBR
	ACRONYM
	ADDRESS
	APPLET
	AREA
	B
	BASE
	BASEFONT
	BDO
	BGSOUND
	BIG
	BLINK
	BLOCKQUOTE
	BODY
	BR
	BUTTON
	CAPTION
	CITE
	CODE
	COL
	COLGROUP
	DD
	DEL
	DFN
	DIV
	DL
	DT
	EM
	EMBED
	FIELDSET
	FONT
	FORM
	FRAME
	FRAMESET
	H1
	H2
	H3
	H4
	H5
	H6
	HEAD
	HR
	HTML
	I
	IFRAME
	ILAYER
	IMG
	INPUT
	INS
	ISINDEX
	KBD
	KEYGEN
	LABEL
	LAYER
	LEGEND
	LI
	LISTING
	MENU
	META
	MULTICOL
	NOBR
	NOEMBED
	NOFRAMES
	NOLAYER
	NOSCRIPT
	OL
	OPTGROUP
	OPTION
	PARAM
	PLAINTEXT
	PRE
	Q
	RUBY
	S
	SAMP
	SCRIPT
	SERVER
	SMALL
	SOUND
	SPACER
	SPAN
	STRIKE
	STRONG
	STYLE
	SUP
	TBODY
	TEXTAREA
	TITLE
	TT
	U
	UL
	VAR
	WBR
	XMP
	TABLE
	TD
	TFOOT
	TH
	THEAD
End

# HTML attributes for .rhtml templates

SyntaxWords Group6 nocase
	ACCESSKEY
	ACTION
	ALIGN
	ALINK
	ALT
	BACKGROUND
	BALANCE
	BEHAVIOR
	BGCOLOR
	BGPROPERTIES
	BORDER
	BORDERCOLOR
	BORDERCOLORDARK
	BORDERCOLORLIGHT
	BOTTOMMARGIN
	CELLPADDING
	CELLSPACING
	CHECKED
	CLASSID
	CODEBASE
	CODETYPE
	COLOR
	COLS
	COLSPAN
	CONTENT
	CONTROLS
	COORDS
	DATAFLD
	DATAFORMATAS
	DATASRC
	DIRECTION
	DISABLED
	DYNSRC
	ENCTYPE
	EVENT
	FACE
	FRAMEBORDER
	FRAMESPACING
	HEIGHT
	HIDDEN
	HREF
	HSPACE
	HTTP-EQUIV
	ISMAP
	LANG
	LANGUAGE
	LEFTMARGIN
	LOWSRC
	MARGINHEIGHT
	MARGINWIDTH
	MAXLENGTH
	MAYSCRIPT
	MULTIPLE
	NOHREF
	NORESIZE
	NOSHADE
	NOWRAP
	PALETTE
	PLUGINSPAGE
	RB
	RBC
	READONLY
	REL
	REV
	RIGHTMARGIN
	ROWS
	ROWSPAN
	RP
	RT
	RTC
	RULES
	SCROLL
	SCROLLAMOUNT
	SCROLLDELAY
	SCROLLING
	SELECTED
	SHAPE
	SRC
	TABINDEX
	TARGET
	TEXT
	TOPMARGIN
	TRUESPEED
	URL
	URN
	USEMAP
	VALIGN
	VLINK
	VOLUME
	VRML
	VSPACE
	WIDTH
	WRAP
End

# ERB delimiters

SyntaxWords Group7 case
	<%
	%>
	<%=
	!%>
End
