Skip to content
This repository

Tomtt's version of the minor mode for editing RubyOnRails code in Emacs

branch: master

Fixed indentation for shoulda snippets; Added 'shoulds' and 'shouldes…

…' to add several should blocks or should_eventually statements at once; Fixed other minor issues with shoulda snippets;
latest commit f2c4f8f4c0
Ryan McGeary rmm5t authored May 15, 2008
Octocat-spinner-32 .gitignore Added a .gitignore to the repos May 14, 2008
Octocat-spinner-32 ChangeLog Ability to specify number of lines initially shown when opening log file April 29, 2008
Octocat-spinner-32 History Updated History March 02, 2008
Octocat-spinner-32 README README updated. April 13, 2007
Octocat-spinner-32 behave-rails.el Adding some functionality to rails-lib, experimenting with elisp BDD … May 14, 2008
Octocat-spinner-32 inflections.el rails.el (rails-templates-list): added 'html.erb' November 02, 2007
Octocat-spinner-32 predictive-prog-mode.el README updated. April 13, 2007
Octocat-spinner-32 rails-bytecompile.el rails-lib.el, rails.el: fix compilation error [#9547] March 26, 2007
Octocat-spinner-32 rails-cmd-proxy.el rails-model-layout.el (rails-model-layout:keymap): created April 03, 2007
Octocat-spinner-32 rails-compat.el rails-compat.el (try-complete-abbrev): fixed August 14, 2007
Octocat-spinner-32 rails-controller-layout.el rails-ui.el (rails-minor-mode-prefix-key): created April 09, 2007
Octocat-spinner-32 rails-controller-minor-mode.el rails-model-layout.el (rails-model-layout:keymap): created April 03, 2007
Octocat-spinner-32 rails-core.el rails-core.el (rails-core:observer-p, rails-core:mailer-p): fixed reg… February 15, 2008
Octocat-spinner-32 rails-features.el rails-ruby.el (ruby-hs-minor-mode): created, support ruby in hs-minor… August 15, 2007
Octocat-spinner-32 rails-find.el * rails-spec.el: base support for rspec. Function August 24, 2007
Octocat-spinner-32 rails-fixture-minor-mode.el rails-model-layout.el (rails-model-layout:keymap): created April 03, 2007
Octocat-spinner-32 rails-functional-test-minor-mode.el rails.el (auto-mode-alist): added Rakefile to auto-mode-alist April 05, 2007
Octocat-spinner-32 rails-helper-minor-mode.el rails-model-layout.el (rails-model-layout:keymap): created April 03, 2007
Octocat-spinner-32 rails-layout-minor-mode.el updated copyright March 24, 2007
Octocat-spinner-32 rails-lib.el Adding some functionality to rails-lib, experimenting with elisp BDD … May 14, 2008
Octocat-spinner-32 rails-log.el Ability to specify number of lines initially shown when opening log file April 29, 2008
Octocat-spinner-32 rails-mailer-minor-mode.el rails-model-layout.el (rails-model-layout:keymap): created April 03, 2007
Octocat-spinner-32 rails-migration-minor-mode.el rails-model-layout.el (rails-model-layout:keymap): created April 03, 2007
Octocat-spinner-32 rails-model-layout.el rails-ui.el (rails-minor-mode-prefix-key): created April 09, 2007
Octocat-spinner-32 rails-model-minor-mode.el rails-model-layout.el (rails-model-layout:keymap): created April 03, 2007
Octocat-spinner-32 rails-navigation.el rails-test.el, rails-ui.el: apply patch #11998, created additional ke… August 04, 2007
Octocat-spinner-32 rails-plugin-minor-mode.el updated copyright March 24, 2007
Octocat-spinner-32 rails-project.el * rails-spec.el: base support for rspec. Function August 24, 2007
Octocat-spinner-32 rails-rake.el rails-test.el, rails-ui.el: apply patch #11998, created additional ke… August 04, 2007
Octocat-spinner-32 rails-ruby.el Fixed [#16742]: pass rails environment to script/console February 06, 2008
Octocat-spinner-32 rails-scripts.el Fixed [#16742]: pass rails environment to script/console February 06, 2008
Octocat-spinner-32 rails-shoulda.el whitespace cleanup May 15, 2008
Octocat-spinner-32 rails-snippets-feature.el Fixed indentation for shoulda snippets; Added 'shoulds' and 'shouldes… May 15, 2008
Octocat-spinner-32 rails-spec.el - rails-spec:run-this-spec December 23, 2007
Octocat-spinner-32 rails-speedbar-feature.el rails-compat.el (try-complete-abbrev): fixed August 14, 2007
Octocat-spinner-32 rails-test.el Added support so that should assertion in focus will get run in the s… May 07, 2008
Octocat-spinner-32 rails-ui.el rails-ws.el (rails-ws:available-servers-list): Added Thin support. March 02, 2008
Octocat-spinner-32 rails-unit-test-minor-mode.el rails.el (auto-mode-alist): added Rakefile to auto-mode-alist April 05, 2007
Octocat-spinner-32 rails-view-minor-mode.el rails-ui.el (rails-minor-mode-prefix-key): created April 09, 2007
Octocat-spinner-32 rails-ws.el rails-ws.el (rails-ws:available-servers-list): Added Thin support. March 02, 2008
Octocat-spinner-32 rails.el require rails-shoulda by default May 15, 2008
README
It is minor mode for editing "Ruby On Rails":ror code with
"Emacs":emacs. This minor mode makes your work much easier and user
friendly


== Instalation

You need download last release from RubyForge page
"http://rubyforge.org/projects/emacs-rails" and and unpack
it to directory containing libraries of Emacs, by default it's
$HOME/.emacs.d/

You can also use SVN

  cd  $HOME/.emacs.d/
  svn co svn://rubyforge/var/svn/emacs-rails/trunk emacs-rails

Download and install required libraries

* "http://www.kazmier.com/computer/snippet.el":snippets
* "http://www.webweavertech.com/ovidiu/emacs/find-recursive.txt":frecursive

*Alert:* From 0.44 release emacs-rails will require the
 "inf-ruby":inf-ruby.

After that you must add this code in $HOME/.emacs

  (setq load-path (cons "~/.emacs.d/rails" load-path))
  (require 'rails)

For Windows users: you can use your help in CHM format (the default
*ri*).  This will require utility "KeyHH":keyhh. And add to a file
.emacs

  (setq rails-chm-file "full_path_to_rails_chm_manual")

After that you can run Emacs. Almost all available actions are in the
menu [Ruby On Rails]. The snippets are in the menu [Ruby On
Rails-Snippets], for the convenience, they are divided into
categories.

To change default setting, select [Ruby On Rails - Customize].

== First Acquaintance

Go to directory with your rails application and open any file in Emacs:

  cd $HOME/project/simple_rails_application
  emacs app/controllers/application.rb

There must be "RoR" sign in the list of active minor-modes in status
bar. Thi means, that emacs-rails is enabled and ready to help you in
your not so easy work.

Almoust all actions are in the "RubyOnRails" menu. You can check it
out and try some of them. Don't forget, that menu will help you only
first time. After that you better use hot keys for effective work, you
can find them in the brackets.

== Features

* TextMate-like snippets
* Display of colored log files
* Integration with script/generate and script/destroy (controller,
  model, scaffold, migration, etc)
* Integration with script/console and script/breakpointer
* Run rake %(key)C-c C-c r%
* Quick start svn-status in RAILS_ROOT %(key)f9%
* Documentation search using *ri* or *chm* file and Rails API
  reference in HTML %(key)f1%
* Quick access to the main configuration files
* Automatic TAGS generation in RAILS_ROOT directory

=== Management of WEBrick/Mongrel

* Your can select Webrick, Mongrel or Lighttpd
* Start/stop application server %(key)C-c C-c w s%
* Automatic browsing on current action (from view or controller)
  %(key)C-c C-c w a%

=== Navigation in RAILS_ROOT hierarchy

* Quick switch stylesheets, javascripts, migrations, layouts, helpers,
  controllers, models, observers, plugins
* In controller file: go to views, functional test, helper
  %(key)C-down%
* Switch between action/view %(key)Ñ-up%
* Go to file in current line (example: cursor at line [redirect_to
  controller => :home, :action => "show"], will be open action "show"
  in "home" controller) %(key)C-RET%
* Quick access to the main configuration files using menu

Other hot keys

* %(key)C-c C-c g g% rails-nav:goto-migrate
* %(key)C-c C-c g j% rails-nav:goto-javascripts
* %(key)C-c C-c g s% rails-nav:goto-stylesheets
* %(key)C-c C-c g l% rails-nav:goto-layouts
* %(key)C-c C-c g h% rails-nav:goto-helpers
* %(key)C-c C-c g c% rails-nav:goto-controllers
* %(key)C-c C-c g m% rails-nav:goto-models
* %(key)C-c C-c g o% rails-nav:goto-observers
* %(key)C-c C-c g p% rails-nav:goto-plugins

=== ERb refactoring

* Create partial from selection %(key)C-c p%
* Create helper from block  %(key)C-c b%

= Bugs

emacs-rails designed for current CVS version of Emacs (future Emacs22)
more probably some functions will not work in older version, or will
work with errors, so if it is possible, try to update. I will not tell
you why you should use CVS version, just take my word.

In some version from CVS some time ago, when you use emacs-rails,
sintax highlight in rhtml was not working, so just update to the
newest version from CVS.

If you find error, place it description in "BugTrack":bugtrack.

= Links

* "Emacs W32 (CVS version for Windows)":http://ourcomments.org/Emacs/EmacsW32.html
* "HowToUseEmacsWithRails":http://wiki.rubyonrails.org/rails/pages/HowToUseEmacsWithRails
* "http://scott.elitists.net/users/scott/posts/rails-on-emacs":http://scott.elitists.net/users/scott/posts/rails-on-emacs
* "http://www.emacswiki.org/cgi-bin/wiki/RubyMode":http://www.emacswiki.org/cgi-bin/wiki/RubyMode
* "Emacs screencast":screencast
* "Effective Emacs":effectiveemacs

[bugtrack]http://rubyforge.org/tracker/?atid=5809&group_id=1484&func=browse
[effectiveemacs]http://steve.yegge.googlepages.com/effective-emacs
[screencast]http://emacsonrails.drozdov.net/
[lisp]http://en.wikipedia.org/wiki/Lisp_programming_language
[frecursive]http://www.webweavertech.com/ovidiu/emacs/find-recursive.txt
[keyhh]http://www.keyworks.net/keyhh.htm
[snippets]http://www.kazmier.com/computer/snippet.el
[emacs]http://www.gnu.org/software/emacs/
[ror]http://rubyonrails.org
[emacs-rails]http://rubyforge.org/projects/emacs-rails
[inf-ruby]http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/misc/inf-ruby.el?view=co
Something went wrong with that request. Please try again.