aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Fix the obvious typos detected by github.com/client9/misspellKazuhiro Sera2018-08-081-1/+1
| | | |
* | | | update BacktraceCleaner::RENDER_TEMPLATE_PATTERN to match the ↵Lachlan Sylvester2018-08-071-1/+1
| |/ / |/| | | | | | | | ActionView::Template method names
* | | Log the remote IP addr of clients behind a proxyAtul Bhosale2018-07-311-1/+1
| |/ |/| | | | | [Atul Bhosale, Victor Nawothnig]
* | Enable Start/EndWith and RegexpMatch copsBart de Water2018-07-287-9/+9
| | | | | | | | | | In cases where the MatchData object is not used, this provides a speed-up: https://github.com/JuanitoFatas/fast-ruby/#stringmatch-vs-stringmatch-vs-stringstart_withstringend_with-code-start-code-end
* | Merge pull request #32381 from q-centrix/update-codeclimate-configsRichard Schneeman2018-07-255-18/+6
|\ \ | | | | | | Turn on performance based cops
| * | Turn on performance based copsDillon Welch2018-07-235-18/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use attr_reader/attr_writer instead of methods method is 12% slower Use flat_map over map.flatten(1) flatten is 66% slower Use hash[]= instead of hash.merge! with single arguments merge! is 166% slower See https://github.com/rails/rails/pull/32337 for more conversation
* | | Merge pull request #33229 from ↵Matthew Draper2018-07-2511-18/+18
|\ \ \ | | | | | | | | | | | | | | | | albertoalmagro/albertoalmagro/prefer-rails-command-over-bin-rails Prefer rails command over bin/rails
| * | | Show rails instead of bin/rails on USAGE instructionsAlberto Almagro2018-07-062-2/+2
| | | | | | | | | | | | | | | | | | | | With this commit, rails commands usage instructions display now +rails+ instead of +bin/rails+ within their recommendations.
| * | | Recommend use of rails over bin/railsAlberto Almagro2018-07-069-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in #33203 rails command already looks for, and runs, bin/rails if it is present. We were mixing recommendations within guides and USAGE guidelines, in some files we recommended using rails, in others bin/rails and in some cases we even had both options mixed together.
* | | | Rails guides are now served over httpsPaul McMahon2018-07-2412-13/+13
| |/ / |/| | | | | | | | | | | http links will be redirected to the https version, but still better to just directly link to the https version.
* | | Merge pull request #32984 from chiraggshah/min-thread-env-variableRichard Schneeman2018-07-211-2/+3
|\ \ \ | | | | | | | | Separate min and max threads count environment variable for puma configuration
| * | | Modified the changes to make it backward compatibleChirag Shah2018-07-211-1/+1
| | | |
| * | | Separate min and max threads count for pumaChirag Shah2018-05-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Same environment variable RAILS_MAX_THREADS was being used for setting the minimum and maximum thread count for puma. This change makes it obvious and easy to decide which environment variable to change for setting the min or max. Don't feel like this is a breaking change as the same default is maintained.
* | | | Fix deprecation message for `SOURCE_ANNOTATION_DIRECTORIES`yuuji.yaginuma2018-07-201-1/+1
| | | | | | | | | | | | | | | | Also, added a test that a deprecated message will be output.
* | | | Enable `Layout/EmptyLinesAroundBlockBody` to reduce review cost in the futureRyuta Kamizono2018-07-122-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We sometimes ask "✂️ extra blank lines" to a contributor in reviews like https://github.com/rails/rails/pull/33337#discussion_r201509738. It is preferable to deal automatically without depending on manpower.
* | | | Merge pull request #28266 from Stellenticket/allow_disable_server_stdout_loggingKasper Timm Hansen2018-07-081-2/+9
|\ \ \ \ | | | | | | | | | | rails server: Allow to explicitly specify whether to output Rails's log to stdout
| * | | | Allow to explicitly specify whether to output Rails' log to stdoutMarkus Doits2018-07-081-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before Rails' logger output is mirrored to std out if: * environment is development and * the process is not daemonized It was not possible to change that behaviour, e.g. to disable log output in that case or enable it in other cases. Now you can explicitly disable or enable output with the new command line switch `--log-to-stdout`, regardless of any other circumstances. ``` // enable output in production rails server -e production --log-to-stdout // disable output in development rails server -e development --no-log-to-stdout ``` Enabling output when daemonized still makes no sense (since tty is detached), but this is ignored for now. If the command line flag is not specified, old behaviour still applies, so this change is completely backward compatible.
* | | | | Fix rubocop offense introduced in 161ed37bogdanvlviv2018-07-081-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We prefer double quotes over single quotes. Fixes: ``` railties/lib/rails/commands/server/server_command.rb:279:39: C: Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoi d extra backslashes for escaping. original_options.concat [ '-u', using ] ``` Related to 161ed37d7120e1f391eed19e49a3390e53e4fe91
* | | | 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-071-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge pull request #33220 from anniecodes/notes-commandKasper Timm Hansen2018-07-053-18/+56
|\ \ \ \ | |/ / / |/| | | 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-041-0/+2
| | | | | | | | | | | | | | | | | | | | * 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-041-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-041-2/+2
| |\ \ \
| * | | | Eager load routes on rebuildJonathan Boler2018-06-041-14/+2
| | |/ / | |/| |
* | | | Merge pull request #32706 from ↵Kasper Timm Hansen2018-07-011-5/+9
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | 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-241-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | | | | 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.
* | | | | OS X -> macOS [Closes #30313]Xavier Noria2018-06-231-2/+2
|/ / / / | | | | | | | | | | | | [Jon Moss & Xavier Noria]
* | | | Merge pull request #33152 from bogdanvlviv/fix-ruby-version-fileRafael França2018-06-181-1/+1
|\ \ \ \ | | | | | | | | | | Fix Ruby version in `.ruby-version`
| * | | | Fix Ruby version in `.ruby-version`bogdanvlviv2018-06-181-1/+1
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | / Remove unnecessary testyuuji.yaginuma2018-06-031-2/+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
| | |
* | | 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.
* | | Fix locale selectoraki2018-05-191-7/+10
| | |
* | | Don't generate yarn's contents in `app:update` task if it's skippedTsukuru Tanimichi2018-05-162-3/+2
| | |
* | | Merge pull request #32837 from ttanimichi/app-update-skip-springYuji Yaginuma2018-05-141-0/+1
|\ \ \ | | | | | | | | Don't generate `config/spring.rb` in `app:update` task when spring isn't loaded