Commit Graph

6893 Commits

Author SHA1 Message Date
Josh Goodall
d0e813fc12 Document Arel.sql 2019-09-26 19:37:42 -04:00
John Hawthorn
02ecdf61d1
Merge pull request #37216 from jhawthorn/avoid_file_watcher
Avoid setting up file watcher on cache_classes
2019-09-25 10:53:33 -07:00
Xavier Noria
63a791c097 remove spurious trailing commas from zeitwerk:check error messages
Since the original message is something like this

    expected file ... to define constant A, but didn't

the \S+ captured the comma. A constant name goes there, so [\w:]+ is
enough and won't match the comma.
2019-09-25 00:41:39 +02:00
Xavier Noria
ac193d0cc3 actual fix for #37285 2019-09-25 00:27:18 +02:00
Xavier Noria
3ac9e22c12 let zeitwerk:check report files outside the root directory with absolute paths
This may happen in engines loaded as gems, for example.

Closes #37285.
2019-09-24 10:27:18 +02:00
Nobuyoshi Nakada
477e71b6b6
Reduce stat(2) calls
`File.file?` and other predicates for permissions can use same
stat(2) call result.
2019-09-22 18:23:09 +09:00
David Rodríguez
a06a734da8
Don't load environment in rake command
While generating an application with the `--skip-webpack-install` flag,
and then running `rails -h` on the generated application, I got the
crash listed below.

I was suprised that Rails would load the full application environment
just for the help command, so I located where the environment was being
loaded and stopped loading it.

It fixed the error and didn't break any tests, so it's probably not
necessary?

This is the backtrace for the error:

```
$ rails -h
The most common rails commands are:
 generate     Generate new code (short-cut alias: "g")
 console      Start the Rails console (short-cut alias: "c")
 server       Start the Rails server (short-cut alias: "s")
 test         Run tests except system tests (short-cut alias: "t")
 test:system  Run system tests
 dbconsole    Start a console for the database specified in config/database.yml
              (short-cut alias: "db")

 new          Create a new Rails application. "rails new my_app" creates a
              new application called MyApp in "./my_app"

All commands can be run with -h (or --help) for more information.
In addition to those commands, there are:

RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production environment
Traceback (most recent call last):
	74: from bin/rails:3:in `<main>'
	73: from bin/rails:3:in `load'
	72: from /home/deivid/Code/playground/testapp/bin/spring:15:in `<top (required)>'
	71: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	70: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	69: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
	68: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
	67: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
	66: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
	65: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
	64: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
	63: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
	62: from /home/deivid/Code/playground/testapp/bin/rails:9:in `<top (required)>'
	61: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require'
	60: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency'
	59: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require'
	58: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	57: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
	56: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
	55: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
	54: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
	53: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/commands.rb:18:in `<main>'
	52: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command.rb:46:in `invoke'
	51: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command/base.rb:65:in `perform'
	50: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	49: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	48: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	47: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/commands/help/help_command.rb:11:in `help'
	46: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command.rb:86:in `print_commands'
	45: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command.rb:96:in `commands'
	44: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command.rb:96:in `flat_map'
	43: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command.rb:96:in `each'
	42: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/commands/rake/rake_command.rb:12:in `printing_commands'
	41: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/commands/rake/rake_command.rb:42:in `formatted_rake_tasks'
	40: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/commands/rake/rake_command.rb:33:in `rake_tasks'
	39: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
	38: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command/actions.rb:28:in `require_environment!'
	37: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/application.rb:339:in `require_environment!'
	36: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require'
	35: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency'
	34: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require'
	33: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/zeitwerk-2.1.10/lib/zeitwerk/kernel.rb:23:in `require'
	32: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	31: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
	30: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
	29: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
	28: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
	27: from /home/deivid/Code/playground/testapp/config/environment.rb:5:in `<main>'
	26: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/application.rb:363:in `initialize!'
	25: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:60:in `run_initializers'
	24: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
	23: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
	22: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
	21: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:347:in `call'
	20: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:347:in `each'
	19: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
	18: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
	17: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	16: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
	15: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:61:in `block in run_initializers'
	14: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `run'
	13: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `instance_exec'
	12: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/railtie.rb:84:in `block in <class:Engine>'
	11: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker.rb:27:in `bootstrap'
	10: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/commands.rb:14:in `bootstrap'
	 9: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/manifest.rb:18:in `refresh'
	 8: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/manifest.rb:83:in `load'
	 7: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:47:in `public_manifest_path'
	 6: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:43:in `public_output_path'
	 5: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:39:in `public_path'
	 4: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:80:in `fetch'
	 3: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:84:in `data'
	 2: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:88:in `load'
	 1: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:88:in `read'
/home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:88:in `read': No such file or directory @ rb_sysopen - /home/deivid/Code/playground/testapp/config/webpacker.yml (Errno::ENOENT)
	73: from bin/rails:3:in `<main>'
	72: from bin/rails:3:in `load'
	71: from /home/deivid/Code/playground/testapp/bin/spring:15:in `<top (required)>'
	70: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	69: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	68: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
	67: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
	66: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
	65: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
	64: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
	63: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
	62: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
	61: from /home/deivid/Code/playground/testapp/bin/rails:9:in `<top (required)>'
	60: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require'
	59: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency'
	58: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require'
	57: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	56: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
	55: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
	54: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
	53: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
	52: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/commands.rb:18:in `<main>'
	51: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command.rb:46:in `invoke'
	50: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command/base.rb:65:in `perform'
	49: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	48: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	47: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	46: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/commands/help/help_command.rb:11:in `help'
	45: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command.rb:86:in `print_commands'
	44: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command.rb:96:in `commands'
	43: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command.rb:96:in `flat_map'
	42: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command.rb:96:in `each'
	41: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/commands/rake/rake_command.rb:12:in `printing_commands'
	40: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/commands/rake/rake_command.rb:42:in `formatted_rake_tasks'
	39: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/commands/rake/rake_command.rb:33:in `rake_tasks'
	38: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
	37: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command/actions.rb:28:in `require_environment!'
	36: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/application.rb:339:in `require_environment!'
	35: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require'
	34: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency'
	33: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require'
	32: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/zeitwerk-2.1.10/lib/zeitwerk/kernel.rb:23:in `require'
	31: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	30: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
	29: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
	28: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
	27: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
	26: from /home/deivid/Code/playground/testapp/config/environment.rb:5:in `<main>'
	25: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/application.rb:363:in `initialize!'
	24: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:60:in `run_initializers'
	23: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
	22: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
	21: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
	20: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:347:in `call'
	19: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:347:in `each'
	18: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
	17: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
	16: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	15: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
	14: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:61:in `block in run_initializers'
	13: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `run'
	12: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `instance_exec'
	11: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/railtie.rb:84:in `block in <class:Engine>'
	10: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker.rb:27:in `bootstrap'
	 9: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/commands.rb:14:in `bootstrap'
	 8: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/manifest.rb:18:in `refresh'
	 7: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/manifest.rb:83:in `load'
	 6: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:47:in `public_manifest_path'
	 5: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:43:in `public_output_path'
	 4: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:39:in `public_path'
	 3: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:80:in `fetch'
	 2: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:84:in `data'
	 1: from /home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:87:in `load'
/home/deivid/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:91:in `rescue in load': Webpacker configuration file not found /home/deivid/Code/playground/testapp/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - /home/deivid/Code/playground/testapp/config/webpacker.yml (RuntimeError)
```
2019-09-20 22:37:47 +02:00
John Hawthorn
f8cbd3d5bd Avoid setting up file watcher on cache_classes
Previously, if cache_classes was true we would build a file_watcher and
add it to reloaders though it would never be used. This wasted some
memory for FileUpdateChecker to maintain an array of all watched files,
and added slightly to boot time.

Instead we should avoid building a file watcher it when cache_classes is
true.
2019-09-16 11:16:50 -07:00
Eileen M. Uchitelle
42dea6b0f6
Merge pull request #37185 from seejohnrun/config-symbols
Use symbols everywhere for database configurations
2019-09-13 13:03:11 -04:00
eileencodes
ce9b197cc9 Use symbols everywhere for database configurations
Previously in some places we used symbol keys, and in some places we used
string keys. That made it pretty confusing to figure out in a particular
place what type of configuration object you were working with.

Now internally, all configuration hashes are keyed by symbols and
converted to such on the way in.

A few exceptions:

- `DatabaseConfigurations#to_h` still returns strings for backward compatibility
- Same for `legacy_hash`
- `default_hash` previously could return strings, but the associated
  comment mentions it returns symbol-key `Hash` and now it always does

Because this is a change in behavior, a few method renames have happened:

- `DatabaseConfig#config` is now `DatabaseConfig#configuration_hash` and returns a symbol-key `Hash`
- `ConnectionSpecification#config` is now `ConnectionSpecification#underlying_configuration_hash` and returns the `Hash` of the underlying `DatabaseConfig`
- `DatabaseConfig#config` was added back, returns `String`-keys for backward compatibility, and is deprecated in favor of the new `configuration_hash`

Co-authored-by: eileencodes <eileencodes@gmail.com>
2019-09-13 08:53:22 -04:00
Ryuta Kamizono
4674d77764 Required mysql2 gem 0.5.0
This follows up #36692, `Mysql2::Error::TimeoutError` is introduced from
mysql2 gem 0.5.0. https://github.com/brianmario/mysql2/pull/911
2019-09-13 11:15:44 +09:00
yuuji.yaginuma
b5949f7f12 Fix credentials:diff option
The option name is `enroll` since f1f5024b918ecf303b9908f78d1a6136d9418730.
2019-09-12 17:00:36 +09:00
yuuji.yaginuma
161e622cf2 Bump Capybara require version
System tests depend on Capybara 3.26 or newer. Ref: #36615.
2019-09-06 10:43:48 +09:00
yuuji.yaginuma
1ccc407e9d Fix document formatting of Rails.group [ci skip] 2019-09-05 19:00:20 +09:00
Jean Boussier
86a28b1f8e Safer example in Rails::Railtie documentation 2019-09-04 12:18:24 +02: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
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
Carlos Antonio da Silva
1f325fab01
Merge pull request #37053 from yahonda/ignore_sqlite3_parallel_testing_databases
Ignore SQLite3 database files generated by parallel testing
2019-08-27 09:15:58 -03:00
Yasuo Honda
c5e3c537a4 Ignore SQLite3 database files generated by parallel testing
Rails 6.0 introduces parallel testing and the default degree of parallelism is configured based on the number of CPU.
refer https://github.com/rails/rails/pull/34735 https://github.com/rails/rails/pull/31900

When any minitest executed under the OS where 2 or more CPU available,
SQLite 3 database files are not git-ignored.

Also updated other files which ignores SQLite database files.

* Steps to reproduce

```
$ git clone https://github.com/yahonda/rep_ignore_sqlite3_databases.git
$ cd rep_ignore_sqlite3_databases/
$ bin/rails test
$ git status
```

* Expected behavior:

- No `Untracked files:`

* Actual behavior:

- SQLite 3 database files appeared

```
$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	db/test.sqlite3-0
	db/test.sqlite3-1
	db/test.sqlite3-2
	db/test.sqlite3-3
	db/test.sqlite3-4
	db/test.sqlite3-5

nothing added to commit but untracked files present (use "git add" to track)
$
```
2019-08-27 11:42:04 +00:00
Kasper Timm Hansen
f73093bcdf
Merge pull request #37032 from ttakuru88/remove-whitespace
Remove whitespace in config/environments/test.rb
2019-08-24 22:22:27 +02:00
ttakuru88
fd2853715d
Remove whitespace in environments/test.rb 2019-08-24 15:50:59 +09:00
danglduy
b2f3a8af6c
Update rails js packages to official version
Update rails js packages to official version instead of alpha version
2019-08-22 14:19:52 +07:00
Carlos Antonio da Silva
2a3f759eef Generate new apps with latest puma version 2019-08-21 08:41:41 -03:00
Rafael Mendonça França
04cfbc807f
Generate keep file in tmp/pids
Since 9c913116c634fe5fe2159a94b8f1a244801a4877, if you run `rackup`
in a machine that doesn't have that folder, the server will not start.

This doesn't happen on `rails s` because we create that folder when
starting the server on
8c8b02784a/railties/lib/rails/commands/server/server_command.rb (L70-L74).
2019-08-19 16:53:01 -04:00
Adam Renberg Tamm
af8751fcf8 Fix minor typo in rails/engine docs [ci skip] 2019-08-19 14:26:53 +02:00
utilum
271601ff65 constant Gem::RubyGemsVersion is deprecated
As of ruby/ruby@c4f7c260f9.

```
~/code/rails$ ruby -v
ruby 2.7.0dev (2019-08-17T03:32:34Z master dc020b06ff) [x86_64-linux]

/home/u/.rbenv/versions/2.7.0-dev/bin/ruby -w -Itest -Ilib
-I../activesupport/lib -I../actionpack/lib -I../actionview/lib
-I../activemodel/lib test/rails_info_controller_test.rb
/home/u/code/rails/railties/lib/rails/info.rb:71: warning: constant
Gem::RubyGemsVersion is deprecated

/home/u/.rbenv/versions/2.7.0-dev/bin/ruby -w -Itest -Ilib
-I../activesupport/lib -I../actionpack/lib -I../actionview/lib
-I../activemodel/lib test/rails_info_test.rb
/home/u/code/rails/railties/lib/rails/info.rb:71: warning: constant
Gem::RubyGemsVersion is deprecated

/home/u/.rbenv/versions/2.7.0-dev/bin/ruby -w -Itest -Ilib
-I../activesupport/lib -I../actionpack/lib -I../actionview/lib
-I../activemodel/lib test/application/routing_test.rb
Run options: --seed 26063

....../home/u/code/rails/railties/lib/rails/info.rb:71: warning:
constant Gem::RubyGemsVersion is deprecated
.................../home/u/code/rails/railties/lib/rails/info.rb:71:
warning: constant Gem::RubyGemsVersion is deprecated
.

```
2019-08-17 18:41:56 +02:00
Rafael Mendonça França
1953e0e1ac
Support Rails with sass-rails 6 2019-08-16 18:33:29 -04:00
Rafael França
4614848564
Merge pull request #36946 from eugeneius/return_only_media_type_on_content_type_new_default
Fix new default value for return_only_media_type_on_content_type
2019-08-15 20:26:19 -04:00
Ben Sheldon [he/him]
0c28bddf40
Remove lonely alignment whitespace from Puma config 2019-08-15 16:25:24 -07:00
Rafael França
9ad68a4cf1
Merge pull request #36803 from andrewkress/fix-issue-36799
read webpacker config to populate autoload paths
2019-08-15 18:53:47 -04:00
Eugene Kenny
582401ad73 Fix new default value for return_only_media_type_on_content_type
Uncommenting this line should opt applications in to the new behaviour;
in this case, `false` is the value needed to do that. This is the value
set when `config.load_defaults 6.0` is called:

5a4305f0ec/railties/lib/rails/application/configuration.rb (L133)
2019-08-15 21:09:41 +01:00
Andrew Kress
61c5a14cab rename to javascript_path, make attr_accessor 2019-08-14 12:36:27 -05:00
Andrew Kress
ffaee477bd create an attribute so that webpacker can set its default path instead of hardcoding 2019-08-13 15:20:59 -05:00
Xavier Noria
5a70f33909 defines Rails.autoloaders.log! 2019-08-13 18:14:50 +02:00
yuuji.yaginuma
6170a2a502 Remove feature policy initializer in API only apps
Because `FeaturePolicy::Middleware` is not loaded in API only apps.
Ref: 646dd8c51f/railties/lib/rails/application/default_middleware_stack.rb (L69-L72)
2019-08-08 17:47:07 +09:00
Kasper Timm Hansen
f1f5024b91
Revise flow to what was described in 03e44f9 2019-08-04 02:19:55 +02:00
Kasper Timm Hansen
03e44f9300
Revise credentials diffing flow to use a separate diff command
Didn't like the complicated stuff that happened on credentials:edit. It
would append to .gitattributes multiple times. Though I see why it was
written that way.

I'm cutting off for now, but since this new flow would require each developer
to run --enable perhaps this should really be:

1. Developer enrolls Rails app by running `credentials:diff --enable`
2. credentials:edit checks .gitattributes for `diff=rails_credentials` and
   if the current file is covered by that.
3. If so, set up the "rails_credentials" driver automatically.
2019-08-04 01:32:41 +02:00
Kasper Timm Hansen
6db2c426c0
Extract diffing to separate credentials:diff command 2019-08-04 00:00:16 +02:00
Kasper Timm Hansen
b4112f45b3
Commands already make fileutils available. 2019-08-03 23:19:14 +02:00
Kasper Timm Hansen
af2880bdda
Rename to Diffing and move module into credentials command
Helpers is more for sharing between commands. Since `Diffing` is only
for credentials we should just keep it only for credentials.

Replaces "pretty" with diffing since the former is ambiguous, while
diffing captures what it does. `opt_in` seemed clunky so it's swapped
for the one-word enable.
2019-08-03 23:06:47 +02:00
Rafael Mendonça França
1c7207a22f
1.hour needs core_ext to work
Usually the application requires the entire active support at load time
but the configuration happens before it is loaded. For that reason we
need to require the core_ext that we want to use in this file.
2019-08-02 15:02:59 -04:00
Daniel Colson
159a121044
Remove duplicate method definition
no_color! is already defined in [`Rails::Command::Behavior`][behavior],
which gets [included into `Rails:Generators`][include]. This duplication
came about in 6813edc7d9 when we introduced the Thor command structure.

We have [test coverage][] to ensure this method still behaves correctly
on `Rails:Generators`.

[behavior]: f7e91c7224/railties/lib/rails/command/behavior.rb (L12-L14)
[include]: f7e91c7224/railties/lib/rails/generators.rb (L18)
[test coverage]: f7e91c7224/railties/test/generators_test.rb (L163-L168)
2019-08-01 17:42:44 -04:00
Akira Matsuda
530f7805ed It may be better to explicitly require 'object/try' where we call try
In most cases it works now without explicit require because it's accidentally required through
active_support/core_ext/date_and_time/calculations.rb where we still call `try`,
but that would stop working if we changed the Calculations implementation and remove the require call there.
2019-08-01 18:51:51 +09:00
Ryuta Kamizono
4c8c8c87b0 Address to rubocop offences 2019-07-31 17:48:14 +09:00
meganemura
718c9e5e7f Remove redundant empty line when we don't use system test 2019-07-29 19:11:27 +09:00
Akira Matsuda
0196551e60 Use match? where we don't need MatchData 2019-07-29 14:23:10 +09:00
Akira Matsuda
0d981a2b3d Let the generated initializers/backtrace_silencers.rb code use Regexp#match? 2019-07-29 14:21:30 +09:00
Lachlan Campbell
f1cfe1ee70 Add viewport meta tag to default application template 2019-07-28 19:49:53 -04:00