1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/test/generators
yuuji.yaginuma 1b86d90136 Enable Performance/UnfreezeString cop
In Ruby 2.3 or later, `String#+@` is available and `+@` is faster than `dup`.

```ruby
# frozen_string_literal: true

require "bundler/inline"

gemfile(true) do
  source "https://rubygems.org"

  gem "benchmark-ips"
end

Benchmark.ips do |x|
  x.report('+@') { +"" }
  x.report('dup') { "".dup }
  x.compare!
end
```

```
$ ruby -v benchmark.rb
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
Warming up --------------------------------------
                  +@   282.289k i/100ms
                 dup   187.638k i/100ms
Calculating -------------------------------------
                  +@      6.775M (± 3.6%) i/s -     33.875M in   5.006253s
                 dup      3.320M (± 2.2%) i/s -     16.700M in   5.032125s

Comparison:
                  +@:  6775299.3 i/s
                 dup:  3320400.7 i/s - 2.04x  slower

```
2018-09-23 08:56:55 +09:00
..
actions_test.rb add github to template actions, light DSL refactor 2018-08-30 16:22:32 -07:00
api_app_generator_test.rb Generate bundler-compatible bundler binstub 2018-06-23 16:58:25 -03:00
app_generator_test.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
application_record_generator_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
argv_scrubber_test.rb Fix "warning: assigned but unused variable - message" 2017-10-12 15:04:33 +09:00
assets_generator_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
channel_generator_test.rb Add test case to ChannelGeneratorTest 2018-04-22 12:24:27 +09:00
controller_generator_test.rb Gracefully handle extra "controller" when generating controller 2018-03-23 19:09:59 +02:00
create_migration_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
generated_attribute_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
generator_generator_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
generator_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
generators_test_helper.rb Use .tt extension to all the template files 2017-11-13 15:23:28 -05:00
helper_generator_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
integration_test_generator_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
job_generator_test.rb Fix duplicated suffix for JobGenerator 2018-04-22 12:09:04 +09:00
mailer_generator_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
migration_generator_test.rb Add migrations_paths option to migration generator 2018-08-30 11:18:40 -04:00
model_generator_test.rb Emit warning for unknown inflection rule when generating model. 2018-08-31 15:47:35 +09:00
named_base_test.rb Generate the correct path in nested scaffold generator 2017-11-05 13:46:28 +09:00
namespaced_generators_test.rb Use escaped character in regexp 2017-09-11 20:34:15 -04:00
orm_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
plugin_generator_test.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
plugin_test_helper.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
plugin_test_runner_test.rb Remove redundant passing --skip-active-storage in test cases 2017-11-08 21:39:35 +00:00
resource_generator_test.rb Emit warning for unknown inflection rule when generating model. 2018-08-31 15:47:35 +09:00
scaffold_controller_generator_test.rb rails new runs rails active_storage:install 2017-11-06 21:29:14 +00:00
scaffold_generator_test.rb Generate the same value as a label of view in system test template 2018-08-29 09:58:21 +09:00
shared_generator_tests.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
system_test_generator_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
task_generator_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
test_runner_in_engine_test.rb Show rails instead of bin/rails on USAGE instructions 2018-07-06 22:46:54 +02:00