Permalink
Browse files

rails.el (rails-templates-list): added 'html.erb'

rails-snippets-feature.el (rails-snippets-feature:rest): replace *_url to *_path
inflections.el (singularize-string pluralize-string): downcase
  string befored searched
inflections.el (pluralize-string singularize-string): downcase
  input string before find in irregular


git-svn-id: svn+ssh://rubyforge.org/var/svn/emacs-rails/trunk@216 cc5033d0-740f-0410-afc7-949910e492f2
  • Loading branch information...
1 parent 436370c commit 61c3e81b6239f42146b44c9d84b6290edc1e0812 dimaexe committed Nov 2, 2007
Showing with 46 additions and 342 deletions.
  1. +29 −272 ChangeLog
  2. +1 −0 History
  3. +3 −3 inflections.el
  4. +2 −1 rails-core.el
  5. +1 −1 rails-ruby.el
  6. +7 −7 rails-snippets-feature.el
  7. +3 −2 rails.el
  8. +0 −56 untabify-file.el
View
301 ChangeLog

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,5 @@
SVN
+* Removed file 'untabify-file.el' from package emacs-rails
* Updated highlight of compilation output
* Added ruby-mode support in hs-minor-mode (aka folding).
* Added migrations and configuration files to speedbar.
View
@@ -104,12 +104,12 @@
(:irregular "sex" "sexes")
(:irregular "move" "moves")
- (:uncountable "equipment" "information" "rice" "money" "species" "series" "fish" "sheep"))
+ (:uncountable "equipment" "information" "rice" "money" "species" "series" "fish" "sheep" "news"))
(defun singularize-string (str)
(when (stringp str)
(or (car (member str inflection-uncountables))
- (caar (member* str inflection-irregulars :key 'cadr :test 'equal))
+ (caar (member* (downcase str) inflection-irregulars :key 'cadr :test 'equal))
(loop for (from to) in inflection-singulars
for singular = (string=~ from str (sub to))
when singular do (return singular))
@@ -118,7 +118,7 @@
(defun pluralize-string (str)
(when (stringp str)
(or (car (member str inflection-uncountables))
- (cadar (member* str inflection-irregulars :key 'car :test 'equal))
+ (cadar (member* (downcase str) inflection-irregulars :key 'car :test 'equal))
(loop for (from to) in inflection-plurals
for plurals = (string=~ from str (sub to))
when plurals do (return plurals))
View
@@ -133,7 +133,8 @@ it does not exist, ask to create it using QUESTION as a prompt."
(defun rails-core:controller-file-by-model (model)
(when model
- (let ((controller (pluralize-string model)))
+ (let* ((controller (pluralize-string model))
+ (controller (when controller (capitalize controller))))
(when (rails-core:controller-exist-p controller)
(rails-core:controller-file controller)))))
View
@@ -60,7 +60,7 @@ See the variable `align-rules-list' for more details.")
(when (eq 'code (overlay-get ov 'hs))
(overlay-put ov 'face 'font-lock-comment-face)
(overlay-put ov 'display
- (format " ··· %d lines"
+ (format " ... %d lines"
(count-lines (overlay-start ov)
(overlay-end ov))))))
View
@@ -405,25 +405,25 @@
(case action
(:index
(tooltip-show (format "GET /%s" plural))
- (format "%s_url" plural))
+ (format "%s_path" plural))
(:show
(tooltip-show (format "GET /%s/1" plural))
- (format "%s_url(%s)" singular model))
+ (format "%s_path(%s)" singular model))
(:new
(tooltip-show (format "GET /%s/new" plural))
- (format "new_%s_url" singular))
+ (format "new_%s_path" singular))
(:edit
(tooltip-show (format "GET /%s/1;edit" plural))
- (format "edit_%s_url(%s)" singular model))
+ (format "edit_%s_path(%s)" singular model))
(:create
(tooltip-show (format "POST /%s" plural))
- (format "%s_url" plural))
+ (format "%s_path" plural))
(:update
(tooltip-show (format "PUT /%s/1" plural))
- (format "%s_url(%s)" singular model))
+ (format "%s_path(%s)" singular model))
(:destroy
(tooltip-show (format "DELETE /%s/1" plural))
- (format "%s_url(%s)" singular model))))))
+ (format "%s_path(%s)" singular model))))))
(defun rails-snippets-feature:rest-index ()
(rails-snippets-feature:rest :index))
View
@@ -146,8 +146,8 @@ Emacs w3m browser."
:group 'rails
:type 'string)
-(defvar rails-version "0.5.99.1")
-(defvar rails-templates-list '("erb" "rhtml" "rxml" "rjs" "haml" "liquid" "mab"))
+(defvar rails-version "0.5.99.6")
+(defvar rails-templates-list '("html.erb" "erb" "rhtml" "rxml" "rjs" "haml" "liquid" "mab"))
(defvar rails-use-another-define-key nil)
(defvar rails-primary-switch-func nil)
(defvar rails-secondary-switch-func nil)
@@ -446,6 +446,7 @@ necessary."
(setq auto-mode-alist (cons '("\\.rjs$" . ruby-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.rxml$" . ruby-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.rhtml$" . html-mode) auto-mode-alist))
+(setq auto-mode-alist (cons '("\\.erb$" . html-mode) auto-mode-alist))
(modify-coding-system-alist 'file "\\.rb$" 'utf-8)
(modify-coding-system-alist 'file "\\.rake$" 'utf-8)
View
@@ -1,56 +0,0 @@
-;;; untabify-file.el --- automatic untabify files before save
-
-;; Copyright (C) 2006 Dmitry Galinsky <dima dot exe at gmail dot com>
-
-;; Authors: Dmitry Galinsky <dima dot exe at gmail dot com>,
-
-;; Keywords: ruby rails languages oop
-;; $URL: svn+ssh://rubyforge/var/svn/emacs-rails/trunk/rails.el $
-;; $Id: rails.el 149 2007-03-29 15:07:49Z dimaexe $
-
-;;; License
-
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License
-;; as published by the Free Software Foundation; either version 2
-;; of the License, or (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-;;; Code:
-
-(require 'cl)
-(require 'custom)
-
-(defcustom untabify-exclude-list
- '(makefile-mode
- makefile-bsdmake-mode
- change-log-mode
- "Makefile$")
- "List of regexp or modes to which is not applied untabify."
- :group 'untabify)
-
-(defun untabify-before-write ()
- "Strip all trailing whitespaces and untabify buffer before
-save."
- (when (and (eq this-command 'save-buffer)
- (not (find nil
- untabify-exclude-list
- :if #'(lambda (r)
- (typecase r
- (string (string-match r (buffer-name)))
- (symbol (eq major-mode r)))))))
- (save-excursion
- (untabify (point-min) (point-max))
- (delete-trailing-whitespace))))
-
-(add-hook 'write-file-hooks 'untabify-before-write)
-
-(provide 'untabify-file)

0 comments on commit 61c3e81

Please sign in to comment.