mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
7cc2b57b8d
* Refactor railsrc file location to be xdg compliant The XDG Base Directory Specification (which is currently used by FOSS projects such as Git, Tmux, Pry, Rspec) provides a default location for various file formats, including config/rc files. This comment refactors app_generator.rb to load railsrc from XDG_CONFIG_HOME if both XDG_CONFIG_HOME is set and rails/railrc exists within the XDG_CONFIG_HOME location. To maintain backwards compatibility it defaults back to ~/.railsrc if either XDG_CONFIG_HOME is not set or there is no rails/railsrc. * Refactor default_rc_file based on jonathanhefner PR feedback * Update generators/rails/app/USAGE to explain railsrc XDG compliance * Refactor default_rc_file based on sinsoku PR feedback * Add test for ARGVScrubber.default_rc_file method fileutils is required because tmpdir does not allow you to create a new temp directory with a set title 'inside' another temporary directory, a file is created for railsrc because tempfile creates a custom and unique name preventing the specification of a file called 'railsrc' Currently this test is failing because the ARGVScrubber class seems to be loading directly from the gem (which still has the previous code) rather than from the file itself. (loading the code in a pry session and using show-method ARGVScrubber.default_rc_file reveals it is coming from gems/railties-6.0.3.3/lib/rails/generators/rails/app/app_generator.rb:536 instead of railties/lib/rails/generators/rails/app/app_generator.rb * Switch to double quote strings * Add file deletion for argv_scrubber test * Refactor test_xdg_config_no_custom_rc with jonathanhefner feedback * Add Changelog for railsrc xdg-specification compliance * Apply backtick and whitespace refactoring suggestsions from jonathanhefner * Apply jonathanhefner suggested Changelog refactoring [Rafael Mendonça França + Nick Wolf + Jonathan Hefner] |
||
---|---|---|
.. | ||
application | ||
command | ||
commands | ||
configuration | ||
engine | ||
fixtures/lib | ||
generators | ||
isolation | ||
minitest | ||
railties | ||
test_unit | ||
abstract_unit.rb | ||
app_loader_test.rb | ||
backtrace_cleaner_test.rb | ||
chdir_helpers.rb | ||
code_statistics_calculator_test.rb | ||
code_statistics_test.rb | ||
console_helpers.rb | ||
engine_test.rb | ||
env_helpers.rb | ||
generators_test.rb | ||
initializable_test.rb | ||
json_params_parsing_test.rb | ||
path_generation_test.rb | ||
paths_test.rb | ||
rack_logger_test.rb | ||
rails_info_controller_test.rb | ||
rails_info_test.rb | ||
secrets_test.rb | ||
version_test.rb |