railties 7.0.5.1 → 7.0.6

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: d5d76894f7ee82ab8df507eb093d755cf69c3dd1e0adb6c965865a0ea7fa1ea5
4
+ data.tar.gz: 1b8a5c3cbe5056a657f92de640b7d8db16d29b7bbc1efc226e8e37f5c0fe810d
5
5
  SHA512:
6
- metadata.gz: e97275b52f127244190482b2d0ee0b43b6262af3b1fbfca2d68a1760727756f913df052a660bd6edf260c544aaba1e5af8f169d3f02b8f61615d822ab14012f4
7
- data.tar.gz: 051e316ebb44bd07237b01b422f293b57bd179f8c8c5507a0a9e1234da3fa00bf439c45434b39be75cad830b144d96190964d9bc6602130cb674ec81eaf31466
6
+ metadata.gz: f6af0cb8b05213f42dc7f656d3b0df7097f39337b2cdfa3e8ee383d76ff78f21b966a180bd2459a104c32c90bfd8553a6c1b2e83c468aa9a77dc7301ddae16e0
7
+ data.tar.gz: f0e75011cf18bb845a82c80f632fa2fa40e2054e44d26659abc93b5b9938880c647dd09eaba5062391745307e64b2c2fc24603f3565e5e4b21c0edd9b8c44608
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## Rails 7.0.6 (June 29, 2023) ##
2
+
3
+ * Avoid escaping paths when editing credentials.
4
+
5
+ *Jonathan Hefner*
6
+
7
+
1
8
  ## Rails 7.0.5.1 (June 26, 2023) ##
2
9
 
3
10
  * 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
 
@@ -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 = 6
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
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.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-26 00:00:00.000000000 Z
11
+ date: 2023-06-29 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.6
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.6
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.6
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.6
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.6
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.6
111
111
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
112
112
  email: david@loudthinking.com
113
113
  executables:
@@ -422,12 +422,12 @@ 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.6/railties/CHANGELOG.md
426
+ documentation_uri: https://api.rubyonrails.org/v7.0.6/
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.6/railties
429
429
  rubygems_mfa_required: 'true'
430
- post_install_message:
430
+ post_install_message:
431
431
  rdoc_options:
432
432
  - "--exclude"
433
433
  - "."
@@ -444,8 +444,8 @@ 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
448
- signing_key:
447
+ rubygems_version: 3.4.13
448
+ signing_key:
449
449
  specification_version: 4
450
450
  summary: Tools for creating, working with, and running Rails applications.
451
451
  test_files: []