Commit Graph

74495 Commits

Author SHA1 Message Date
Ryuta Kamizono 2489a5939d
Merge pull request #37134 from rmacklin/fix-code-block-in-rails-guides-generated-html
Fix code block in the HTML version of the upgrade guide

[ci skip]
2019-09-05 15:27:07 +09:00
Richard Macklin 056bcf96a5 Fix code block in the HTML version of the upgrade guide [ci skip]
In 0a7ce46d2c I added the section about
npm package name changes to the upgrade guide. After it was merged, I
noticed an issue in the rendering of the code block in the HTML version
that doesn't appear in the corresponding markdown version. I was able to
fix it by adding an extra newline before the code block (which doesn't
affect the markdown version).

I verified the fix by running the `guides:generate:html` rake task
locally.

Before:
https://user-images.githubusercontent.com/1863540/64316451-2a774300-cfb5-11e9-985c-0697cfc23b9a.png

After:
https://user-images.githubusercontent.com/1863540/64316583-893cbc80-cfb5-11e9-9182-a2143d99f9d9.png
2019-09-05 08:10:23 +02:00
Akira Matsuda d2f4541f12 Passing in a Hash instance as non-kwargs parameters has to be curly braced now 2019-09-05 13:26:58 +09:00
Akira Matsuda 4071115ddd Passing in a Hash instance as kwargs parameters requires the "double splat" prefix 2019-09-05 13:26:58 +09:00
y-yagi 58df38818a
Merge pull request #37114 from iainbeeston/patch-1
Don't use Process#clock_gettime CLOCK_PROCESS_CPUTIME_ID on Solaris
2019-09-05 11:47:24 +09:00
George Claghorn d03d6fc33b
Merge pull request #37131 from rmacklin/document-new-npm-packages-in-upgrade-guide
Document the new npm package names in the upgrade guide
2019-09-04 15:24:16 -04:00
Eugene Kenny d50049bef8
Merge pull request #37127 from Shopify/railtie-documentation
Safer example in Rails::Railtie documentation
2019-09-04 17:01:13 +01:00
Richard Macklin 0a7ce46d2c Document the new npm package names in the upgrade guide
[ci skip]
2019-09-04 16:46:07 +02:00
Jean Boussier 86a28b1f8e Safer example in Rails::Railtie documentation 2019-09-04 12:18:24 +02:00
Iain Beeston b5fafb5caf Don't use `Process#clock_gettime(CLOCK_PROCESS_CPUTIME_ID)` on Solaris
Solaris returns `true` for `defined?(Process::CLOCK_PROCESS_CPUTIME_ID)` but calling `Process.clock_gettime(Process::CLOCK_PROCESS_CPUTIME_ID)` raises `Errno::EINVAL: Invalid argument - clock_gettime` when `ActiveSupport::Notifications::Event.now_cpu` is called.
2019-09-04 10:15:39 +01:00
Akira Matsuda 6d68bb5f69 Unify `save` method signatures to take keyword arguments 2019-09-04 13:47:02 +09:00
Akira Matsuda e1e7fd6c44 These methods take keyword arguments 2019-09-04 13:47:02 +09:00
Akira Matsuda 1915255846 Revert "Include kwargs definition in the generated method signatures and method calls"
This reverts commit 9895d67d6d.

Reason: This causes CI failures in activerecord tests
2019-09-04 13:47:02 +09:00
Akira Matsuda 9895d67d6d Include kwargs definition in the generated method signatures and method calls 2019-09-04 12:45:27 +09:00
Akira Matsuda 257d8f9792 The super_method at Type::Value takes kwargs 2019-09-04 12:45:27 +09:00
Akira Matsuda 4645f2d34f Passing in a Hash instance as kwargs parameters requires the "double splat" prefix 2019-09-04 12:45:27 +09:00
Akira Matsuda ea791e53f9 No need to synchronize for just reading an ivar, at least in MRI
thanks to GVL.
2019-09-04 12:45:27 +09:00
Akira Matsuda 2c528dd446 Merging options donesn't have to be synchronized 2019-09-04 12:45:27 +09:00
Akira Matsuda dd1aa73889 Ivar += in MRI is thread safe 2019-09-04 12:45:27 +09:00
Akira Matsuda 5e0ef9ca7a No need to synchronize for just reading an ivar, at least in MRI
Monitor `synchronize` became a little bit more costly since https://github.com/ruby/ruby/commit/f91879a7b5 even when then synchronization is nested,
thus we'd better avoid unnecessary `synchronize {  }` call for the majoriry platform that properly implements GVL.
2019-09-04 12:45:24 +09:00
Ryuta Kamizono 237c80840f
Merge pull request #37123 from giraffate/add_a_test_for_select_argument_error_with_block
Add a test for select argument error with block
2019-09-04 12:23:05 +09:00
Akira Matsuda 8292fd2db3
Merge pull request #37121 from kamipo/do_not_enforce_no_braces_for_hash
Do not enforce no braces for hash argument
2019-09-04 12:07:51 +09:00
Takayuki Nakata 246417c74e Add a test for select argument error with block
This added test is for select with arguments and block.
2019-09-04 10:25:05 +09:00
Ryuta Kamizono 0770c025bd Do not enforce no braces for hash argument
Non-kwargs parameters should be to be braced for https://github.com/ruby/ruby/pull/2395.
See https://bugs.ruby-lang.org/issues/14183 for details.

`Style/BracesAroundHashParameters` cop conflicts with that.

This removes `Style/BracesAroundHashParameters` cop and auto-correct to
following changes.

d94263f...5665fb5
2019-09-04 08:49:36 +09:00
George Claghorn 1edb151b71
Merge pull request #37118 from bb/patch-1
Fix typo [ci skip]
2019-09-03 14:59:00 -04:00
Benjamin Bock 19128e23a9
Fix typo [ci skip] 2019-09-03 20:54:50 +02:00
Eileen M. Uchitelle affa3f8661
Merge pull request #37117 from cpruitt/vary-header-do-not-reset
Do not set response "Vary" header if it has already been set
2019-09-03 13:42:40 -04:00
Cliff Pruitt 89c62a7bdb Do not set response "Vary" header if it has already been set
If an app sets the `"Vary"` header in an action to a value other than `"Accept"`, the `_set_vary_header` method will reset it's value to `"Accept"`.

This commit checks the header to be sure that it does not already have a value before setting the header to `"Accept"`.
2019-09-03 11:54:40 -04:00
Ryuta Kamizono 1074fb4ebe
Merge pull request #37115 from Shopify/intern-activejob-queue-name
Intern ActiveJob queue_name
2019-09-03 23:48:08 +09:00
Jean Boussier e623ccf921 Intern ActiveJob queue_name
Memory profiling shows that the queue name is always duplicated

```
Retained String Report
-----------------------------------
  ...
217  "default"
200  /tmp/bundle/ruby/2.6.0/bundler/gems/rails-59e746d4d07b/activejob/lib/active_job/queue_name.rb:52
```
2019-09-03 16:16:39 +02:00
Akira Matsuda 5665fb5f6e send with **options only when options is not empty
or this causes "ArgumentError: wrong number of arguments (given 1, expected 0)" in some methods
2019-09-03 20:59:14 +09:00
Akira Matsuda b7e591a55f These RequestHelpers' methods take keyword arguments 2019-09-03 18:55:50 +09:00
Akira Matsuda 614b552a0a RequestEncoder.register_encoder takes keyworded arguments 2019-09-03 18:14:39 +09:00
Akira Matsuda 08ee9d1490 Passing in a Hash instance as non-kwargs parameters has to be braced in Ruby 3.0 syntax 2019-09-03 18:12:23 +09:00
Akira Matsuda b5704f3b38 Passing in a Hash instance as kwargs parameters requires the "double splat" prefix 2019-09-03 18:10:18 +09:00
Akira Matsuda 3cfd6d1d44 Introduce keyword arguments for some AS::Cache methods
since RedisCacheStore#write_entry takes kwargs, we needed to kwargsify all these methods
in order to eliminate Ruby 2.7 warnings.

It's a little bit bigger patch than I expected, but it doesn't warn on Ruby 3,
and it doesn't introduce any incompatibility on loder rubies, so it may not be a bad thing anyway.
2019-09-03 17:48:40 +09:00
Akira Matsuda 81230c610f Unify the API with Messages::Rotator::Verifier#verify that takes kwargs 2019-09-03 17:48:40 +09:00
Akira Matsuda 575d4d1348 subscribe block doesn't take keyword arguments 2019-09-03 17:48:40 +09:00
Akira Matsuda 1e4e0935bc :number is not a keyword argument 2019-09-03 17:48:40 +09:00
Akira Matsuda e60c1bfc7f I18n.translate takes kwargs options 2019-09-03 17:48:40 +09:00
Akira Matsuda 87b428c8e0 Passing in a Hash instance as kwargs parameters requires the "double splat" prefix
See https://bugs.ruby-lang.org/issues/14183 for details
2019-09-03 17:48:34 +09:00
Akira Matsuda e69b5f500b Passing in a Hash instance as non-kwargs parameters has to be braced in Ruby 3.0 syntax
See https://bugs.ruby-lang.org/issues/14183 for details
2019-09-03 17:38:55 +09:00
Ryuta Kamizono d94263f3e7
Merge pull request #37109 from giraffate/fix_href_to_replace_http_with_https
Fix href to replace http with https in the `Yay! You’re on Rails!` page
2019-09-03 10:44:26 +09:00
Akira Matsuda aa756a4c44 Prefer normal method call over method_missing 2019-09-03 10:26:15 +09:00
Takayuki Nakata aeb59dd9d3 Fix href to replace http with https in the `Yay! You’re on Rails!` page 2019-09-03 09:43:29 +09:00
y-yagi ef4bf83a1b
Merge pull request #37102 from y-yagi/fixes_37011
Correctly classify the files and directories that pass to watcher
2019-09-03 07:57:41 +09:00
y-yagi 54ce780477
Merge pull request #37083 from swrobel/patch-5
Add title tag to mailer previews
2019-09-03 07:29:40 +09:00
Stefan Wrobel b9689aefe5 Add title tag to mailer previews 2019-09-02 14:44:46 -07:00
yuuji.yaginuma 81befcf267 Correctly classify the files and directories that pass to watcher
Currently, autoload paths pass to the watcher as directories. If using evented
watcher, this possibly pass as it is to `Listen`.
But autoload paths include files and `Listen` raise an error when was passed
file. So, it is necessary to classify files and directories correctly.

Fixes #37011.
2019-09-02 11:22:39 +09:00
Ryuta Kamizono d05f1f036f Merge pull request #37103 from giraffate/add_tests_for_no_or_blank_like_arguments_to_query_methods
Add tests for no or blank like arguments to query methods
2019-09-02 10:49:58 +09:00