aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/actions.rb
Commit message (Collapse)AuthorAgeFilesLines
* modify add_source in application template to take a block for gem entriesHirofumi Wakasugi2015-06-251-2/+16
|
* Add a new-line to the end of route method generated code.Arthur Neves2015-03-181-1/+1
| | | | | | | | Fix regression on route method that was added by bac812a7ef2660a2fe2ab00822e5e66228379822. The regression was that when calling the `route` method, we were not appending a \n anymore. [fixes #19316]
* Force generated route to be insertedAndrew White2015-02-051-1/+1
| | | | | | | Thor isn't very discerning over whether some content is present when passed to `inject_into_file`, e.g. a commented out route is detected as being present. So to prevent people scratching their heads as to why a route hasn't appeared it's better to fall on the side of having duplicate routes.
* Don't remove all line endings from routes.rbAndrew White2015-02-031-2/+2
| | | | | | | | | | | | When there is a single scaffold in the routes.rb with no other lines then revoking/destroying it will create a routes.rb file with a syntax error. This is because the sentinel for the Thor `route` action didn't include the newline but the logged route code did. The fix is to add the newline to the sentinel and remove it from the the logged route code. Fixes #15913.
* No need of requiring `rbconfig`, it is by-default loadedKuldeep Aggarwal2015-01-101-1/+0
|
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-1/+1
|
* Merge pull request #17302 from ↵Rafael Mendonça França2014-10-181-2/+2
| | | | | | claudiob/replace-slower-block-call-with-faster-yield Replace (slower) block.call with (faster) yield
* Revert "Replace (slower) block.call with (faster) yield"Zachary Scott2014-10-181-2/+2
| | | | This reverts commit 0ab075e75f58bf403f7ebe20546c7005f35db1f6.
* Replace (slower) block.call with (faster) yieldclaudiob2014-10-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Performance optimization: `yield` with an implicit `block` is faster than `block.call`. See http://youtu.be/fGFM_UrSp70?t=10m35s and the following benchmark: ```ruby require 'benchmark/ips' def fast yield end def slow(&block) block.call end Benchmark.ips do |x| x.report('fast') { fast{} } x.report('slow') { slow{} } end # => fast 154095 i/100ms # => slow 71454 i/100ms # => # => fast 7511067.8 (±5.0%) i/s - 37445085 in 4.999660s # => slow 1227576.9 (±6.8%) i/s - 6145044 in 5.028356s ```
* fix broken `gem` method with non-String arguments. Closes #16709.Yves Senn2014-08-271-4/+6
| | | | This was caused by #15327.
* Add an after_bundle callback in Rails templatesStefan Kanev2014-08-031-0/+11
| | | | | | The template runs before the generation of binstubs – this does not allow to write one, that makes an initial commit to version control. It is solvable by adding an after_bundle callback.
* Merge pull request #15327 from alexbel/replace_double_quotes_with_single_quotesYves Senn2014-05-271-4/+13
|\ | | | | | | Replace double quotes with single quotes while adding an entry into Gemfile
| * Replace double quotes with single quotes while adding an entry into Gemfilealexbel2014-05-261-4/+14
|/
* Replace map.flatten with flat_map in railtiesErik Michaels-Ober2014-03-041-1/+1
|
* Improve font of some code in API documentation [ci skip]Chun-wei Kuo2013-12-261-8/+8
| | | | | * Add "<tt>" or "+" to improve font of some code and filenames in API documentation * Does not contain wording changes
* Revert "Used Yield instead of block.call" -- this causes all of ↵David Heinemeier Hansson2013-11-141-2/+2
| | | | | | atom_feed_helper_test.rb to fail with "SystemStackError: stack level too deep". This reverts commit d3a1ce1cdc60d593de1682c5f4e3230c8db9a0fd.
* Used Yield instead of block.callKuldeep Aggarwal2013-11-151-2/+2
|
* Removing the app constant and replacing it with Rails.applicationwangjohn2013-04-301-1/+1
| | | | | syntax. This helps removing the class level abstraction of an application.
* Change default root route helperKohei Hasegawa2013-02-261-1/+1
|
* Initialize instance variable to remove warningCarlos Antonio da Silva2013-01-071-0/+4
| | | | actions.rb:34: warning: instance variable @in_group not initialized
* Introduce ./bin for your app's executables: bin/bundle, bin/rails, bin/rake. ↵Jeremy Kemper2013-01-061-1/+1
| | | | Executable scripts are versioned code like the rest of your app. To generate a stub for a bundled gem: 'bundle binstubs unicorn' and 'git add bin/unicorn'
* Remove observers and sweepersRafael Mendonça França2012-11-281-1/+1
| | | | | | | | They was extracted from a plugin. See https://github.com/rails/rails-observers [Rafael Mendonça França + Steve Klabnik]
* Use Ruby 1.9 Hash syntax in railtiesRobin Dupret2012-10-141-22/+22
|
* Revert "Use flat_map { } instead of map {}.flatten"Santiago Pastorino2012-10-051-1/+1
| | | | | | | | | | | This reverts commit abf8de85519141496a6773310964ec03f6106f3f. We should take a deeper look to those cases flat_map doesn't do deep flattening. irb(main):002:0> [[[1,3], [1,2]]].map{|i| i}.flatten => [1, 3, 1, 2] irb(main):003:0> [[[1,3], [1,2]]].flat_map{|i| i} => [[1, 3], [1, 2]]
* Use flat_map { } instead of map {}.flattenSantiago Pastorino2012-10-051-1/+1
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-05-231-2/+1
|\
| * Remove obsolete comment from generator gem methodAlexey Vakhov2012-05-221-2/+1
| | | | | | | | | | This comment about :env option for gem method was actual for rails 2.3 without bundler. Now bundler uses grups for this goal.
* | Use new hash syntax for generators gem methodAlexey Vakhov2012-05-221-1/+1
|/ | | | | | The Gemfile of new application uses ruby 1.9 hashes. Gem method of generators should use them too. It prevents from mixing two kinds of syntax in one file.
* Removing ==Examples and last blank lines of docs from railtiesFrancesco Rodriguez2012-05-141-42/+0
|
* minor fixes [ci skip]Vijay Dev2012-04-051-2/+2
|
* added example, removed blank linesHrvoje Šimić2012-04-041-4/+13
|
* Correct invalid route example [ci skip]Cezary Baginski2012-04-021-1/+1
|
* Fixes #4764 - remove generated new line in routes.rb on scaffold generationVijay Dev2012-01-311-1/+1
| | | | | | | | | As explained in #4764, when destroying a scaffold, routes.rb loses a new line. This seems to happen because a new line is added while generating the route and the destroy generator removes it. However, this causes a problem if the routes file is manually edited to remove such new lines. This commit just removes that extra new line from added in the first place.
* No need to check for 'draw do |map|' anymorePiotr Sarnacki2012-01-071-1/+1
|
* use Kernel#Array instead of Array.wrap in Rails::Generators::ActionsSergey Nartimov2012-01-061-2/+1
|
* Rails::Plugin has goneSantiago Pastorino2012-01-031-34/+0
|
* Merge pull request #4221 from tonycoco/masterJon Leighton2011-12-281-0/+1
|\ | | | | Rails template creation issue
| * Update railties/lib/rails/generators/actions.rbTony Coconate2011-12-281-0/+1
| |
* | Updating newline fix to maintain existing linebreaks and indentation and ↵John Donahue2011-11-251-3/+4
| | | | | | | | test for b/eol on inserts
* | Added tests for #3751ganesh2011-11-251-1/+1
|/
* warning removed : '&' interpreted as argument prefixArun Agrawal2011-09-301-1/+1
|
* Honour RAILS_ENV environment variable when running rake.Dmitriy Kiriyenko2011-09-291-1/+1
|
* Merge pull request #2841 from wojtekmach/app-generators-groupJosé Valim2011-09-041-1/+26
|\ | | | | Add gem group support to generators
| * Add gem_group support to generatorsWojciech Mach2011-09-041-1/+26
| |
* | Warnings removed for using shadow variable.Arun Agrawal2011-09-041-2/+2
|/
* fix indent for generator environment methodAlexey Vakhov2011-09-021-1/+1
|
* Fix Rails::Generators::Actions#environment when env is passed. Closes #2110Guillermo Iguaran2011-07-181-2/+3
|
* Removed warnings about shadowing variablesAlexey Gaziev2011-06-201-4/+4
|
* parenthesize the arguments with splatAkira Matsuda2011-05-181-1/+1
| | | | to make sure we're not calling the :* operator
* log and readme should respect --quietJosé Valim2011-03-041-3/+4
|