lib/rails/generators/actions.rb in railties-3.0.0.beta4 vs lib/rails/generators/actions.rb in railties-3.0.0.rc
- old
+ new
@@ -38,11 +38,11 @@
else
log "! no git or svn provided for #{name}. Skipping..."
end
end
- # Adds an entry into config/environment.rb for the supplied gem. If env
+ # Adds an entry into Gemfile for the supplied gem. If env
# is specified, add the gem to the given environment.
#
# ==== Example
#
# gem "rspec", :env => :test
@@ -98,11 +98,11 @@
in_root do
prepend_file "Gemfile", "source #{source.inspect}\n", :verbose => false
end
end
- # Adds a line inside the Initializer block for config/environment.rb.
+ # Adds a line inside the Application class for config/application.rb.
#
# If options :env is specified, the line is appended to the corresponding
# file in config/environments.
#
def environment(data=nil, options={}, &block)
@@ -265,18 +265,18 @@
#
def freeze!(args={})
ActiveSupport::Deprecation.warn "freeze! is deprecated since your rails app now comes bundled with Rails by default, please check your Gemfile"
end
- # Make an entry in Rails routing file conifg/routes.rb
+ # Make an entry in Rails routing file config/routes.rb
#
# === Example
#
# route "root :to => 'welcome'"
#
def route(routing_code)
log :route, routing_code
- sentinel = "routes.draw do |map|"
+ sentinel = /\.routes\.draw do(\s*\|map\|)?\s*$/
in_root do
inject_into_file 'config/routes.rb', "\n #{routing_code}\n", { :after => sentinel, :verbose => false }
end
end