;;; ruby-mode.el --- Major mode for editing Ruby files
-;; Copyright (C) 1994-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2013 Free Software Foundation, Inc.
;; Authors: Yukihiro Matsumoto
;; Nobuyoshi Nakada
;; URL: http://www.emacswiki.org/cgi-bin/wiki/RubyMode
;; Created: Fri Feb 4 14:49:13 JST 1994
;; Keywords: languages ruby
-;; Version: 1.0
+;; Version: 1.2
;; This file is part of GNU Emacs.
"Regexp to match keywords that nest without blocks.")
(defconst ruby-indent-beg-re
- (concat "^\\s *" (regexp-opt '("class" "module" "def" "if" "unless" "case"
- "while" "until" "for" "begin")) "\\_>")
+ (concat "^\\(\\s *" (regexp-opt '("class" "module" "def")) "\\|"
+ (regexp-opt '("if" "unless" "case" "while" "until" "for" "begin"))
+ "\\)\\_>")
"Regexp to match where the indentation gets deeper.")
(defconst ruby-modifier-beg-keywords
(goto-char start)
;; Find all expression expansions and
;; - save the match data to a text property, for font-locking later,
- ;; - set the syntax of all double quotes and backticks to puctuation.
+ ;; - set the syntax of all double quotes and backticks to punctuation.
(while (re-search-forward ruby-expression-expansion-re end 'move)
(let ((beg (match-beginning 2))
(end (match-end 2)))
;;;###autoload
(add-to-list 'auto-mode-alist (cons (purecopy "\\.rb\\'") 'ruby-mode))
;;;###autoload
-(add-to-list 'auto-mode-alist '("Rakefile\\'" . ruby-mode))
+(add-to-list 'auto-mode-alist (cons (purecopy "Rakefile\\'") 'ruby-mode))
+;;;###autoload
+(add-to-list 'auto-mode-alist (cons (purecopy "\\.gemspec\\'") 'ruby-mode))
;;;###autoload
(dolist (name (list "ruby" "rbx" "jruby" "ruby1.9" "ruby1.8"))