aboutsummaryrefslogtreecommitdiffstats
path: root/railties
Commit message (Collapse)AuthorAgeFilesLines
* Don't balloon @original_options with --restart on restart.Kasper Timm Hansen2018-07-071-1/+1
| | | | | | | | Our restart_command would pass in `--restart` which means that if the @original_options already contains --restart it would keep getting another --restart appended. Nothing here that would break the bank, but just a nicety.
* Don't show unneeded deprecation warning on server restart.Kasper Timm Hansen2018-07-072-11/+16
| | | | | | | | | | | | | | | | | If booting a server via `rails s -u puma`, we'd convert the option to a `using` positional. When using `rails restart` our `restart_command` would the option converted to the using positional and put that in the restart command. Thus we'd show users deprecation warnings for our own code. Fix that by converting a passed positional to an option instead. Also: fix initialize method signature. The local_options are an array, not a hash. But don't even bother assigning defaults as Thor passes them in.
* Remove restart_command leftover from switching to Thor options.Kasper Timm Hansen2018-07-071-4/+0
| | | | | | | | | | | Ref: https://github.com/rails/rails/commit/654704247eba742e139cfaa8d1385f13605d9e12 Before the commit we had a restart_command in Rails::Server. But after there's another one in Rails::ServerCommand. The command version of the method is the right one as it's used in server_options. Give the leftover method the boot.
* Use only snake cased symbols in commands.Kasper Timm Hansen2018-07-071-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mixing strings and symbols seems aesthetically less than ideal. We can also use underscores just fine. Thor converts them to dashes for the CLI and it makes access in Ruby code nicer. Here's the `server --help` output after this change: ``` Usage: rails server [thin/puma/webrick] [options] Options: -p, [--port=port] # Runs Rails on the specified port - defaults to 3000. -b, [--binding=IP] # Binds Rails to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'. -c, [--config=file] # Uses a custom rackup configuration. # Default: config.ru -d, [--daemon], [--no-daemon] # Runs server as a Daemon. -e, [--environment=name] # Specifies the environment to run this server under (development/test/production). -u, [--using=name] # Specifies the Rack server used to run the application (thin/puma/webrick). -P, [--pid=PID] # Specifies the PID file. # Default: tmp/pids/server.pid -C, [--dev-caching], [--no-dev-caching] # Specifies whether to perform caching in development. [--early-hints], [--no-early-hints] # Enables HTTP/2 early hints. ``` See? Quite dashing ✨
* Merge pull request #32776 from Edouard-chin/ec-as-hooksKasper Timm Hansen2018-07-051-10/+11
|\ | | | | Use testing lazy-load hooks
| * Use testing lazy-load hooks:Edouard CHIN2018-07-041-10/+11
| | | | | | | | - In order to avoid loading classes prematurely, let's use lazy load hooks that are now provided with each test case
* | Make NotesCommand tests more performant by getting rid of unecessary mapAnnie-Claude Côté2018-07-051-12/+12
| | | | | | | | | | | | | | * Get rid of map and replace it with a multiplication of "\n" to generate document with multiple line preceding the annotation * Reduce number from 1000 to 100 since it achieves the same goal * Only keep one test for the multiple lines document since it's unecessary to test multiple times * Update some language in tests names to make it clearer what we are testing
* | Merge pull request #33220 from anniecodes/notes-commandKasper Timm Hansen2018-07-054-18/+184
|\ \ | |/ |/| Adds `Rails::Command::NotesCommand` and makes `rake notes` use it under the hood
| * Port Annotations rake task to use Rails::NotesCommandAnnie-Claude Côté2018-07-042-7/+14
| | | | | | | | | | | | | | * Invokes the notes Rails::Command and passes the rake task ENV variables as annotations options to it * Adds a deprecation warning for unsupported commands * Gets rid of reference to ENV["SOURCE_ANNOTATION_DIRECTORIES"] in SourceAnnotationExtractor since its now dealt with in the NotesCommand * Gets rid of rake desc for each rake notes task so they are not documented while using `rails -T` or `rails --help`
| * Adds support to register directories and extensions to NotesCommandAnnie-Claude Côté2018-07-042-0/+46
| | | | | | | | | | * Require the application and environnement in the notes command in order to load the config files * Adds tests for both register_directories and register_extensions added to a config file
| * Adds a Rails::Command for NotesAnnie-Claude Côté2018-07-042-0/+121
| | | | | | | | | | | | | | | | * It is called with `rails notes` * It defaults to displaying [OPTIMIZE, FIXME and TODO] annotations * It accepts custom annotations by using `rails notes -a CUSTOM_ANNOTATION OTHER_ANNOTATION` * It defaults to look for annotations in [app config db lib test] as dictated by SourceAnnotationExtractor * It supports ENV["SOURCE_ANNOTATION_DIRECTORIES"] but adds a deprecation warning and recommends using register_directories instead
| * [ci skip] Update documentation related to `rails notes`Annie-Claude Côté2018-07-031-11/+3
| | | | | | | | | | | | * Get rid of references to rake notes in the documentation * Get rid of references to environement variables used in SourceAnnotationExtractor * Updates the command line guide to reflect the new rails notes API
* | Remove old TODO commentAlberto Almagro2018-07-041-1/+0
| | | | | | | | | | This TODO comment has been here more than 7 years and doesn't seem to be a temporary implementation anymore.
* | Merge pull request #33054 from jboler/masterRafael França2018-07-032-20/+4
|\ \ | | | | | | Fix route eager loading
| * | Only execute route updater once on app bootJonathan Boler2018-06-192-6/+2
| | |
| * | Merge branch 'master' of github.com:rails/railsJonathan Boler2018-06-042-8/+2
| |\ \
| * | | Eager load routes on rebuildJonathan Boler2018-06-041-14/+2
| | |/ | |/|
* | | Merge pull request #32706 from ↵Kasper Timm Hansen2018-07-012-5/+33
|\ \ \ | | | | | | | | | | | | | | | | yhirano55/fix-app-update-when-hyphenated-name-is-given Fix app:update when hyphenated name is given
| * | | Fix app:update when hyphenated name is givenYoshiyuki Hirano2018-04-242-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | * Fixed app_name's difference between `rails new` and `app:update` * Changed be prefer to const name than directory name. * Kept original app name which use exception message.
* | | | Fix assignment of TESTOPTS in railties test taskutilum2018-07-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | The assignment of `ENV["TESTOPTS"]` to `ARGV`, introduced in 09f9a7a5b, did not take into account passing multiple options, such as `--verbose --seed=1`. This patch fixes it.
* | | | Enable TESTOPTS in railties testsutilum2018-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike the other components' test suites, railties' currently ignores such useful options as `"--verbose"` or `"--name"`. This patch allows us to use them.
* | | | Merge pull request #33191 from ↵George Claghorn2018-06-241-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | bogdanvlviv/change-rails_welcome-image-on-localhost3000 Changes Rails Welcome image on localhost:3000
| * | | | Changes Rails Welcome image on localhost:3000bogdanvlviv2018-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that I used https://www.base64-image.de/ in order to convert the image to Base64 with enabled optimization status. Closes #33181. Closes #33186. Follow up #32735.
* | | | | Add an assertion that `credentials:edit` works when `RAILS_MASTER_KEY` env ↵yuuji.yaginuma2018-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | is specified
* | | | | OS X -> macOS [Closes #30313]Xavier Noria2018-06-232-3/+3
|/ / / / | | | | | | | | | | | | [Jon Moss & Xavier Noria]
* | | | Merge pull request #33152 from bogdanvlviv/fix-ruby-version-fileRafael França2018-06-182-2/+8
|\ \ \ \ | | | | | | | | | | Fix Ruby version in `.ruby-version`
| * | | | Fix Ruby version in `.ruby-version`bogdanvlviv2018-06-182-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since #30016 Rails generates `.ruby-version` file in order to help Ruby version manager tools like `rbenv`, `rvm` determine which Ruby version should be used for the current Rails project. Since #32649 Rails sets Ruby version to the file compatible with MRI/JRuby by default. Pull Request #31496 reports that `.ruby-version` doesn't match ruby version other than stable version and recommends to use `ENV["RBENV_VERSION"]`, and `ENV["rvm_ruby_string"]` in order to set correct Ruby version to the file that `rbenv` or `rvm` can understand. Also, there is another similar issue that reports the same case if use JRuby https://github.com/jruby/jruby/issues/5144. Closes #31496, https://github.com/jruby/jruby/issues/5144.
* | | | | Remove unused requireyuuji.yaginuma2018-06-181-1/+0
|/ / / / | | | | | | | | | | | | `optparse` is unused since #26977.
* | | / Include `ActiveSupport::Testing::MethodCallAssertions` in ↵bogdanvlviv2018-06-092-2/+2
| |_|/ |/| | | | | | | | | | | | | | `railties/test/isolation/abstract_unit.rb` Related to #33102
* | | Remove unnecessary testyuuji.yaginuma2018-06-032-8/+2
| |/ |/| | | | | | | Since #32289, `Spellchecker.suggest` returns only one value, multiple suggestions not output.
* | Merge pull request #30406 from eliotsykes/reduce-spring-watch-callsRafael Mendonça França2018-05-231-6/+6
|\ \ | | | | | | | | | Minimize Spring.watch calls
| * | Minimize Spring.watch callsEliot Sykes2017-08-251-6/+6
| | |
* | | Enable warnings in all test tasksutilum2018-05-231-1/+1
| | | | | | | | | | | | Also normalize AJ task use t, like all other Rails test tasks.
* | | Merge pull request #32699 from printercu/patch-3Rafael França2018-05-221-1/+7
|\ \ \ | | | | | | | | Respect NODE_ENV when running `rails yarn:install`
| * | | Respect NODE_ENV when running `rails yarn:install`printercu2018-04-231-1/+7
| | |/ | |/| | | | | | | | | | | | | `yarn install --prod` removes dev deps, so it's impossible to run `assets:precompile` with dev npm dependencies. This change makes rake task pass NODE_ENV to yarn when explicitly set.
* | | Bump minimum version of Thor to 0.19.0Guillermo Iguaran2018-05-221-1/+1
| | | | | | | | | | | | Thor 0.18 is causing failures in all the generator tests.
* | | Merge pull request #32934 from aki77/fix-locale-selectorRafael França2018-05-221-7/+10
|\ \ \ | | | | | | | | Fix locale selector to email preview
| * | | Fix locale selectoraki2018-05-191-7/+10
| | | |
* | | | Enable `Lint/StringConversionInInterpolation` rubocop ruleRyuta Kamizono2018-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | To prevent redundant `to_s` like https://github.com/rails/rails/pull/32923#discussion_r189460008 automatically in the future.
* | | | Add test case that configure ↵yuuji.yaginuma2018-05-201-0/+17
|/ / / | | | | | | | | | | | | | | | `config.action_view.finalize_compiled_template_methods` Follow up of #32418.
* | | Don't generate yarn's contents in `app:update` task if it's skippedTsukuru Tanimichi2018-05-164-3/+25
| | |
* | | Merge pull request #32837 from ttanimichi/app-update-skip-springYuji Yaginuma2018-05-143-1/+17
|\ \ \ | | | | | | | | Don't generate `config/spring.rb` in `app:update` task when spring isn't loaded
| * | | Don't generate `config/spring.rb` in `app:update` task when spring isn't loadedTsukuru Tanimichi2018-05-133-1/+17
| | | |
* | | | Fix `CustomCops/AssertNot` to allow it to have failure messageRyuta Kamizono2018-05-133-3/+3
| | | | | | | | | | | | | | | | Follow up of #32605.
* | | | Remove unused `remove_file` methodTsukuru Tanimichi2018-05-081-4/+0
|/ / / | | | | | | | | | | | | | | | In #32780, We have supported the `--skip-sprockets` option in the `app:update` task. When `options[:api]` is truthy, `option[:skip_sprockets]` is also truthy. So we can remove this `remove_file` method. https://github.com/rails/rails/blob/42b9e7e50c084e119a679cf155b70b5efc4d36ff/railties/lib/rails/generators/rails/app/app_generator.rb#L281-L283
* | | Skip `bootsnap` contents in `app:update` task if `bootsnap` is not usedyuuji.yaginuma2018-05-072-0/+14
| | |
* | | prefer File.write for bulk writesXavier Noria2018-05-052-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I saw these ones while working on #32362. File.write was introduced in Ruby 1.9.3 and it is the most concise way to perform bulk writes (as File.read is for bulk reading). The existing flags enabled binmode, but we are dumping text here. The portable way to dump text is text mode. The only difference is newlines, and portable code should in particular emit portable newlines. Please note the hard-coded \ns are still correct. In languages with C semantics for newlines like Ruby, Python, Perl, and others, "\n" is a portable newline. Both when writing and when reading. On Windows, the I/O layer is responsible for prepending a CR before each LF on writing, and removing CRs followed by LFs on reading. On Unix, binmode is a no-op.
* | | Merge pull request #32780 from ttanimichi/tmpYuji Yaginuma2018-05-054-1/+22
|\ \ \ | | | | | | | | Don't generate assets' initializer in `app:update` task if sprockets is skipped
| * | | Don't generate assets' initializer in `app:update` task if sprockets is skippedTsukuru Tanimichi2018-05-054-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Execute `rails new myapp -S` and then upgrade the app by using the `app:update` task, `bin/rails c` results in `NoMethodError`. ``` $ bin/rails app:update $ bin/rails c Traceback (most recent call last): 44: from bin/rails:4:in `<main>' (snip) 1: from /Users/tanimichi.tsukuru/ghq/github.com/moneyforward/moneyplus/config/initializers/assets.rb:4:in `<top (required)>' /Users/tanimichi.tsukuru/ghq/github.com/moneyforward/moneyplus/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/railtie/configuration.rb:97:in `method_missing': undefined method `assets' for #<Rails::Application::Configuration:0x00007fcb8d3697e0> (NoMethodError) Did you mean? asset_host ```
* | | | Partly revert #32289 to provide Rails' custom fallback in caseutilum2018-05-011-2/+49
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `DidYouMean::SpellChecker` is not defined. `did_you_mean` is bundled in Ruby but can be uninstalled, and is not always available, sometimes even on our CI: https://travis-ci.org/rails/rails/jobs/372638523#L2405 https://travis-ci.org/rails/rails/jobs/372638523#L2416 https://travis-ci.org/rails/rails/jobs/372638523#L2427 ...