| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
`Gem.win_platform?` check if it is Windows more accurately.
Ref: https://github.com/ruby/ruby/blob/ruby_2_2/lib/rubygems.rb#L945..L952
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
| |
|
|
|
|
|
|
|
|
|
| |
This commit comes from the comments made by @matthewd at https://github.com/rails/rails/pull/23795/files#r54469637
and by @rafaelfranca at https://github.com/rails/rails/pull/23795/files#r54609364
The idea is that if you type (for example) "rake db:migrate" in an AppGenerator,
then this should actually invoke `rake db:migrate` on the command line, whereas
if you type "rails_command db:migrate", this should invoke `rails db:migrate`.
|
|
|
|
|
| |
Follows the convention from Rails 5 of invoking tasks on the command-line
with `rails …` rather than `rake …`.
|
|
|
|
|
|
|
|
|
|
|
| |
Since Rails 5.0 is switching the Rails command line from 'rake …'
to 'rails …', it makes sense to also replace the `rake` method in
the Rails templates API.
Based on feedback from @matthewd and @kaspth, I chose to replace
`rake` with `rails_command`, which is less confusing than
the alternatives `rails` or `command` or `rails_run` and is not
Thor-reserved word like `task`.
|
|
|
|
|
|
| |
as argument
- Fixes #23137.
|
|
|
|
| |
generator template.
|
| |
|
|
|
|
| |
We can't use this configuration outside of the application.rb
|
| |
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
claudiob/replace-slower-block-call-with-faster-yield
Replace (slower) block.call with (faster) yield
|
|
|
|
| |
This reverts commit 0ab075e75f58bf403f7ebe20546c7005f35db1f6.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
```
|
|
|
|
| |
This was caused by #15327.
|
|
|
|
|
|
| |
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.
|
|\
| |
| |
| | |
Replace double quotes with single quotes while adding an entry into Gemfile
|
|/ |
|
| |
|
|
|
|
|
| |
* Add "<tt>" or "+" to improve font of some code and filenames in API documentation
* Does not contain wording changes
|
|
|
|
|
|
| |
atom_feed_helper_test.rb to fail with "SystemStackError: stack level too deep".
This reverts commit d3a1ce1cdc60d593de1682c5f4e3230c8db9a0fd.
|
| |
|
|
|
|
|
| |
syntax. This helps removing the class level abstraction of an
application.
|
| |
|
|
|
|
| |
actions.rb:34: warning: instance variable @in_group not initialized
|
|
|
|
| |
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'
|
|
|
|
|
|
|
|
| |
They was extracted from a plugin.
See https://github.com/rails/rails-observers
[Rafael Mendonça França + Steve Klabnik]
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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]]
|
| |
|
|\ |
|
| |
| |
| |
| |
| | |
This comment about :env option for gem method was actual for rails 2.3
without bundler. Now bundler uses grups for this goal.
|
|/
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|\
| |
| | |
Rails template creation issue
|