(ert-deftest foo ()
(assert nil))
Now: M-x ert RET foo RET
Emacs makes discovery easier.
require 'json' | |
require 'date' | |
# Embedders | |
def scalar | |
lambda { |x| x } | |
end | |
def date |
source 'https://rubygems.org' | |
gem 'rails', '3.2.3' | |
# ... | |
platforms :jruby do | |
gem 'trinidad', '~> 1.3', :require => false | |
gem 'jruby-rack', '1.1.1', :require => false # trinidad dep | |
gem 'trinidad_logging_extension', :require => false | |
end |
group :assets do | |
#gem 'sass-rails', '~> 3.1.4' | |
#gem 'coffee-rails', '~> 3.1.1' | |
#gem 'uglifier', '>= 1.0.3' | |
gem 'less', :git => 'git://github.com/kares/less.rb.git', :submodules => true | |
gem 'less-rails', '>= 2.2.1' | |
gem 'less-rails-bootstrap' # optional | |
gem 'therubyracer', :platforms => :ruby |
# Please add the following lines after Bundler.require | |
# and before "class Application < Rails::Application" | |
# in your config/application.rb | |
# | |
# Notice this is just an experiment, don't leave those | |
# lines there after the experiment. Then please benchmark | |
# your app boot time in development before and after adding | |
# those lines. A simple benchmark is: | |
# | |
# time script/rails runner "MODEL" |
:~$ rvm use jruby | |
Using /home/saito/.rvm/gems/jruby-1.6.2 | |
:~$ gem i mvn:org.slf4j:slf4j-simple | |
Successfully installed mvn:org.slf4j:slf4j-api-1.6.2-java | |
Successfully installed mvn:org.slf4j:slf4j-simple-1.6.2-java |
# minimal rails3 app | |
require 'action_controller' | |
Router = ActionDispatch::Routing::RouteSet.new | |
Router.draw do | |
root :to => 'site#index' | |
end | |
class SiteController < ActionController::Metal |
;; Add this to ~/.emacs | |
;; Missing from ruby-mode.el, see https://groups.google.com/group/emacs-on-rails/msg/565fba8263233c28 | |
(defun ruby-insert-end () | |
"Insert \"end\" at point and reindent current line." | |
(interactive) | |
(insert "end") | |
(ruby-indent-line t) | |
(end-of-line)) |
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |