railties 7.0.5.1 → 7.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3fd6b7b5e181cfe9a3da616c6e3d257e0f4c7c388833e749b421fed848e09742
4
- data.tar.gz: 33552ae47254c63efcee16bc49124c15541d5a262176e927fdf93032a5fbbb07
3
+ metadata.gz: 3fe5f34e3dc88b67c68974ca74f6144771dff0933968daeba86d3aeff0220c30
4
+ data.tar.gz: 7c2633262d61be8f5b964d7e9b614614ce885c5b41e0c341e35207fd902c284d
5
5
  SHA512:
6
- metadata.gz: e97275b52f127244190482b2d0ee0b43b6262af3b1fbfca2d68a1760727756f913df052a660bd6edf260c544aaba1e5af8f169d3f02b8f61615d822ab14012f4
7
- data.tar.gz: 051e316ebb44bd07237b01b422f293b57bd179f8c8c5507a0a9e1234da3fa00bf439c45434b39be75cad830b144d96190964d9bc6602130cb674ec81eaf31466
6
+ metadata.gz: 4deed5f007927fbe9c543f96b15a6e22a206fec1e3b6931d21a4d3c3dbf979a3bed5ef2b9432c159ac5445f0c21004f9299b4800ba5b5b6f979af86067be6ca5
7
+ data.tar.gz: 2734c739e10923f5b8bc93b83ce16021c07426f813a060a969634b56db2dafc2aa50963d83973151f73791b4bfd68eeb972977e52237ef5cf8f1432ea044f00a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## Rails 7.0.7 (August 09, 2023) ##
2
+
3
+ * Update default scaffold templates to set 303 (See Other) as status code
4
+ on redirect for the update action for XHR requests other than GET or POST
5
+ to avoid issues (e.g browsers trying to follow the redirect using the
6
+ original request method resulting in double PATCH/PUT)
7
+
8
+ *Guillermo Iguaran*
9
+
10
+
11
+ ## Rails 7.0.6 (June 29, 2023) ##
12
+ * Avoid escaping paths when editing credentials.
13
+
14
+ *Jonathan Hefner*
15
+
16
+
1
17
  ## Rails 7.0.5.1 (June 26, 2023) ##
2
18
 
3
19
  * No changes.
data/README.rdoc CHANGED
@@ -14,7 +14,7 @@ The latest version of Railties can be installed with RubyGems:
14
14
 
15
15
  * gem install railties
16
16
 
17
- Source code can be downloaded as part of the Rails project on GitHub
17
+ Source code can be downloaded as part of the \Rails project on GitHub
18
18
 
19
19
  * https://github.com/rails/rails/tree/main/railties
20
20
 
@@ -230,7 +230,6 @@ module Rails
230
230
  active_support.cache_format_version = 7.0
231
231
  active_support.use_rfc4122_namespaced_uuids = true
232
232
  active_support.executor_around_test_case = true
233
- active_support.isolation_level = :thread
234
233
  active_support.disable_to_s_conversion = true
235
234
  end
236
235
 
@@ -92,7 +92,7 @@ module Rails
92
92
 
93
93
  def change_credentials_in_system_editor
94
94
  credentials.change do |tmp_path|
95
- system("#{ENV["EDITOR"]} #{Shellwords.escape(tmp_path)}")
95
+ system(*Shellwords.split(ENV["EDITOR"]), tmp_path.to_s)
96
96
  end
97
97
  end
98
98
 
@@ -9,8 +9,8 @@ module Rails
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 0
12
- TINY = 5
13
- PRE = "1"
12
+ TINY = 7
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -12,13 +12,58 @@ module Rails
12
12
  @indentation = 0
13
13
  end
14
14
 
15
- # Adds an entry into +Gemfile+ for the supplied gem.
15
+ # Adds a +gem+ declaration to the +Gemfile+ for the specified gem.
16
16
  #
17
17
  # gem "rspec", group: :test
18
18
  # gem "technoweenie-restful-authentication", lib: "restful-authentication", source: "http://gems.github.com/"
19
19
  # gem "rails", "3.0", git: "https://github.com/rails/rails"
20
20
  # gem "RedCloth", ">= 4.1.0", "< 4.2.0"
21
21
  # gem "rspec", comment: "Put this comment above the gem declaration"
22
+ #
23
+ # Note that this method only adds the gem to the +Gemfile+; it does not
24
+ # install the gem.
25
+ #
26
+ # ==== Options
27
+ #
28
+ # [+:version+]
29
+ # The version constraints for the gem, specified as a string or an
30
+ # array of strings:
31
+ #
32
+ # gem "my_gem", version: "~> 1.1"
33
+ # gem "my_gem", version: [">= 1.1", "< 2.0"]
34
+ #
35
+ # Alternatively, can be specified as one or more arguments following the
36
+ # gem name:
37
+ #
38
+ # gem "my_gem", ">= 1.1", "< 2.0"
39
+ #
40
+ # [+:comment+]
41
+ # Outputs a comment above the +gem+ declaration in the +Gemfile+.
42
+ #
43
+ # gem "my_gem", comment: "First line.\nSecond line."
44
+ #
45
+ # Outputs:
46
+ #
47
+ # # First line.
48
+ # # Second line.
49
+ # gem "my_gem"
50
+ #
51
+ # [+:group+]
52
+ # The gem group in the +Gemfile+ that the gem belongs to.
53
+ #
54
+ # [+:git+]
55
+ # The URL of the git repository for the gem.
56
+ #
57
+ # Any additional options passed to this method will be appended to the
58
+ # +gem+ declaration in the +Gemfile+. For example:
59
+ #
60
+ # gem "my_gem", comment: "Edge my_gem", git: "https://example.com/my_gem.git", branch: "master"
61
+ #
62
+ # Outputs:
63
+ #
64
+ # # Edge my_gem
65
+ # gem "my_gem", git: "https://example.com/my_gem.git", branch: "master"
66
+ #
22
67
  def gem(*args)
23
68
  options = args.extract_options!
24
69
  name, *versions = args
@@ -117,18 +162,47 @@ module Rails
117
162
  end
118
163
  end
119
164
 
120
- # Adds a line inside the Application class for <tt>config/application.rb</tt>.
165
+ # Adds configuration code to a Rails runtime environment.
166
+ #
167
+ # By default, adds code inside the +Application+ class in
168
+ # +config/application.rb+ so that it applies to all environments.
169
+ #
170
+ # environment %(config.asset_host = "cdn.provider.com")
171
+ #
172
+ # Results in:
173
+ #
174
+ # # config/application.rb
175
+ # class Application < Rails::Application
176
+ # config.asset_host = "cdn.provider.com"
177
+ # # ...
178
+ # end
179
+ #
180
+ # If the +:env+ option is specified, the code will be added to the
181
+ # corresponding file in +config/environments+ instead.
182
+ #
183
+ # environment %(config.asset_host = "localhost:3000"), env: "development"
184
+ #
185
+ # Results in:
121
186
  #
122
- # If options <tt>:env</tt> is specified, the line is appended to the corresponding
123
- # file in <tt>config/environments</tt>.
187
+ # # config/environments/development.rb
188
+ # Rails.application.configure do
189
+ # config.asset_host = "localhost:3000"
190
+ # # ...
191
+ # end
192
+ #
193
+ # +:env+ can also be an array. In which case, the code is added to each
194
+ # corresponding file in +config/environments+.
195
+ #
196
+ # The code can also be specified as the return value of the block:
124
197
  #
125
198
  # environment do
126
- # "config.asset_host = 'cdn.provider.com'"
199
+ # %(config.asset_host = "cdn.provider.com")
127
200
  # end
128
201
  #
129
202
  # environment(nil, env: "development") do
130
- # "config.asset_host = 'localhost:3000'"
203
+ # %(config.asset_host = "localhost:3000")
131
204
  # end
205
+ #
132
206
  def environment(data = nil, options = {})
133
207
  sentinel = "class Application < Rails::Application\n"
134
208
  env_file_sentinel = "Rails.application.configure do\n"
@@ -146,11 +220,20 @@ module Rails
146
220
  end
147
221
  alias :application :environment
148
222
 
149
- # Run a command in git.
223
+ # Runs one or more git commands.
150
224
  #
151
225
  # git :init
226
+ # # => runs `git init`
227
+ #
152
228
  # git add: "this.file that.rb"
153
- # git add: "onefile.rb", rm: "badfile.cxx"
229
+ # # => runs `git add this.file that.rb`
230
+ #
231
+ # git commit: "-m 'First commit'"
232
+ # # => runs `git commit -m 'First commit'`
233
+ #
234
+ # git add: "good.rb", rm: "bad.cxx"
235
+ # # => runs `git add good.rb; git rm bad.cxx`
236
+ #
154
237
  def git(commands = {})
155
238
  if commands.is_a?(Symbol)
156
239
  run "git #{commands}"
@@ -161,80 +244,91 @@ module Rails
161
244
  end
162
245
  end
163
246
 
164
- # Create a new file in the <tt>vendor/</tt> directory. Code can be specified
165
- # in a block or a data string can be given.
247
+ # Creates a file in +vendor/+. The contents can be specified as an
248
+ # argument or as the return value of the block.
249
+ #
250
+ # vendor "foreign.rb", <<~RUBY
251
+ # # Foreign code is fun
252
+ # RUBY
166
253
  #
167
- # vendor("sekrit.rb") do
168
- # sekrit_salt = "#{Time.now}--#{3.years.ago}--#{rand}--"
169
- # "salt = '#{sekrit_salt}'"
254
+ # vendor "foreign.rb" do
255
+ # "# Foreign code is fun"
170
256
  # end
171
257
  #
172
- # vendor("foreign.rb", "# Foreign code is fun")
173
258
  def vendor(filename, data = nil)
174
259
  log :vendor, filename
175
260
  data ||= yield if block_given?
176
261
  create_file("vendor/#{filename}", optimize_indentation(data), verbose: false)
177
262
  end
178
263
 
179
- # Create a new file in the <tt>lib/</tt> directory. Code can be specified
180
- # in a block or a data string can be given.
264
+ # Creates a file in +lib/+. The contents can be specified as an argument
265
+ # or as the return value of the block.
266
+ #
267
+ # lib "foreign.rb", <<~RUBY
268
+ # # Foreign code is fun
269
+ # RUBY
181
270
  #
182
- # lib("crypto.rb") do
183
- # "crypted_special_value = '#{rand}--#{Time.now}--#{rand(1337)}--'"
271
+ # lib "foreign.rb" do
272
+ # "# Foreign code is fun"
184
273
  # end
185
274
  #
186
- # lib("foreign.rb", "# Foreign code is fun")
187
275
  def lib(filename, data = nil)
188
276
  log :lib, filename
189
277
  data ||= yield if block_given?
190
278
  create_file("lib/#{filename}", optimize_indentation(data), verbose: false)
191
279
  end
192
280
 
193
- # Create a new +Rakefile+ with the provided code (either in a block or a string).
281
+ # Creates a Rake tasks file in +lib/tasks/+. The code can be specified as
282
+ # an argument or as the return value of the block.
194
283
  #
195
- # rakefile("bootstrap.rake") do
284
+ # rakefile "bootstrap.rake", <<~RUBY
285
+ # task :bootstrap do
286
+ # puts "Boots! Boots! Boots!"
287
+ # end
288
+ # RUBY
289
+ #
290
+ # rakefile "bootstrap.rake" do
196
291
  # project = ask("What is the UNIX name of your project?")
197
292
  #
198
- # <<-TASK
293
+ # <<~RUBY
199
294
  # namespace :#{project} do
200
295
  # task :bootstrap do
201
- # puts "I like boots!"
296
+ # puts "Boots! Boots! Boots!"
202
297
  # end
203
298
  # end
204
- # TASK
299
+ # RUBY
205
300
  # end
206
301
  #
207
- # rakefile('seed.rake', 'puts "Planting seeds"')
208
302
  def rakefile(filename, data = nil)
209
303
  log :rakefile, filename
210
304
  data ||= yield if block_given?
211
305
  create_file("lib/tasks/#{filename}", optimize_indentation(data), verbose: false)
212
306
  end
213
307
 
214
- # Create a new initializer with the provided code (either in a block or a string).
308
+ # Creates an initializer file in +config/initializers/+. The code can be
309
+ # specified as an argument or as the return value of the block.
215
310
  #
216
- # initializer("globals.rb") do
217
- # data = ""
311
+ # initializer "api.rb", <<~RUBY
312
+ # API_KEY = "123456"
313
+ # RUBY
218
314
  #
219
- # ['MY_WORK', 'ADMINS', 'BEST_COMPANY_EVAR'].each do |const|
220
- # data << "#{const} = :entp\n"
221
- # end
222
- #
223
- # data
315
+ # initializer "api.rb" do
316
+ # %(API_KEY = "123456")
224
317
  # end
225
318
  #
226
- # initializer("api.rb", "API_KEY = '123456'")
227
319
  def initializer(filename, data = nil)
228
320
  log :initializer, filename
229
321
  data ||= yield if block_given?
230
322
  create_file("config/initializers/#{filename}", optimize_indentation(data), verbose: false)
231
323
  end
232
324
 
233
- # Generate something using a generator from Rails or a plugin.
234
- # The second parameter is the argument string that is passed to
235
- # the generator or an Array that is joined.
325
+ # Runs another generator.
326
+ #
327
+ # generate "scaffold", "Post title:string body:text"
328
+ # generate "scaffold", "Post", "title:string", "body:text"
236
329
  #
237
- # generate(:authenticated, "user session")
330
+ # The first argument is the generator name, and the remaining arguments
331
+ # are joined together and passed to the generator.
238
332
  def generate(what, *args)
239
333
  log :generate, what
240
334
 
@@ -244,22 +338,56 @@ module Rails
244
338
  rails_command "generate #{what} #{args.join(" ")}", options
245
339
  end
246
340
 
247
- # Runs the supplied rake task (invoked with 'rake ...')
341
+ # Runs the specified Rake task.
342
+ #
343
+ # rake "db:migrate"
344
+ # rake "db:migrate", env: "production"
345
+ # rake "db:migrate", abort_on_failure: true
346
+ # rake "stats", capture: true
347
+ # rake "gems:install", sudo: true
348
+ #
349
+ # ==== Options
350
+ #
351
+ # [+:env+]
352
+ # The Rails environment in which to run the task. Defaults to
353
+ # <tt>ENV["RAILS_ENV"] || "development"</tt>.
354
+ #
355
+ # [+:abort_on_failure+]
356
+ # Whether to halt the generator if the task exits with a non-success
357
+ # exit status.
248
358
  #
249
- # rake("db:migrate")
250
- # rake("db:migrate", env: "production")
251
- # rake("gems:install", sudo: true)
252
- # rake("gems:install", capture: true)
359
+ # [+:capture+]
360
+ # Whether to capture and return the output of the task.
361
+ #
362
+ # [+:sudo+]
363
+ # Whether to run the task using +sudo+.
253
364
  def rake(command, options = {})
254
365
  execute_command :rake, command, options
255
366
  end
256
367
 
257
- # Runs the supplied rake task (invoked with 'rails ...')
368
+ # Runs the specified Rails command.
369
+ #
370
+ # rails_command "db:migrate"
371
+ # rails_command "db:migrate", env: "production"
372
+ # rails_command "db:migrate", abort_on_failure: true
373
+ # rails_command "stats", capture: true
374
+ # rails_command "gems:install", sudo: true
375
+ #
376
+ # ==== Options
377
+ #
378
+ # [+:env+]
379
+ # The Rails environment in which to run the command. Defaults to
380
+ # <tt>ENV["RAILS_ENV"] || "development"</tt>.
381
+ #
382
+ # [+:abort_on_failure+]
383
+ # Whether to halt the generator if the command exits with a non-success
384
+ # exit status.
385
+ #
386
+ # [+:capture+]
387
+ # Whether to capture and return the output of the command.
258
388
  #
259
- # rails_command("db:migrate")
260
- # rails_command("db:migrate", env: "production")
261
- # rails_command("gems:install", sudo: true)
262
- # rails_command("gems:install", capture: true)
389
+ # [+:sudo+]
390
+ # Whether to run the command using +sudo+.
263
391
  def rails_command(command, options = {})
264
392
  if options[:inline]
265
393
  log :rails, command
@@ -40,11 +40,6 @@
40
40
  # and asynchronous queries will then be enabled.
41
41
  # Rails.application.config.active_support.executor_around_test_case = true
42
42
 
43
- # Define the isolation level of most of Rails internal state.
44
- # If you use a fiber based server or job processor, you should set it to `:fiber`.
45
- # Otherwise the default of `:thread` if preferable.
46
- # Rails.application.config.active_support.isolation_level = :thread
47
-
48
43
  # Set both the `:open_timeout` and `:read_timeout` values for `:smtp` delivery method.
49
44
  # Rails.application.config.action_mailer.smtp_timeout = 5
50
45
 
@@ -34,7 +34,7 @@ class <%= controller_class_name %>Controller < ApplicationController
34
34
  # PATCH/PUT <%= route_url %>/1
35
35
  def update
36
36
  if @<%= orm_instance.update("#{singular_table_name}_params") %>
37
- redirect_to <%= redirect_resource_name %>, notice: <%= %("#{human_name} was successfully updated.") %>
37
+ redirect_to <%= redirect_resource_name %>, notice: <%= %("#{human_name} was successfully updated.") %>, status: :see_other
38
38
  else
39
39
  render :edit, status: :unprocessable_entity
40
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railties
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.5.1
4
+ version: 7.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-26 00:00:00.000000000 Z
11
+ date: 2023-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 7.0.5.1
19
+ version: 7.0.7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 7.0.5.1
26
+ version: 7.0.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 7.0.5.1
33
+ version: 7.0.7
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 7.0.5.1
40
+ version: 7.0.7
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 7.0.5.1
103
+ version: 7.0.7
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 7.0.5.1
110
+ version: 7.0.7
111
111
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
112
112
  email: david@loudthinking.com
113
113
  executables:
@@ -422,10 +422,10 @@ licenses:
422
422
  - MIT
423
423
  metadata:
424
424
  bug_tracker_uri: https://github.com/rails/rails/issues
425
- changelog_uri: https://github.com/rails/rails/blob/v7.0.5.1/railties/CHANGELOG.md
426
- documentation_uri: https://api.rubyonrails.org/v7.0.5.1/
425
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.7/railties/CHANGELOG.md
426
+ documentation_uri: https://api.rubyonrails.org/v7.0.7/
427
427
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
428
- source_code_uri: https://github.com/rails/rails/tree/v7.0.5.1/railties
428
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.7/railties
429
429
  rubygems_mfa_required: 'true'
430
430
  post_install_message:
431
431
  rdoc_options:
@@ -444,7 +444,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
444
444
  - !ruby/object:Gem::Version
445
445
  version: '0'
446
446
  requirements: []
447
- rubygems_version: 3.3.3
447
+ rubygems_version: 3.4.10
448
448
  signing_key:
449
449
  specification_version: 4
450
450
  summary: Tools for creating, working with, and running Rails applications.