1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

15 commits

Author SHA1 Message Date
Edouard Chin
868866c1fd
Allow a new server Railtie block:
- This is similar to other railties blocks (such as `console`,
  `tasks` ...). The goal of this block is to allow the application
  or a railtie to load code after the server start.

  The use case can be to fire the webpack or react server in
  development or start some job worker like sidekiq or resque.

  Right now, all these tasks needs to be done in a separate
  shell and gem maintainer needs to add documentation on
  how to run their libraries if another program needs to run
  next to the Rails server.

  This feature can be used like this:

  ```ruby
    class SuperRailtie < Rails::Railtie
      server do
        WebpackServer.run
      end
    end
  ```
2020-11-02 18:11:41 +00:00
David Heinemeier Hansson
3e0cdbeaf4
require, require_relative, load by double quotes (#38841)
* require, require_relative, load by double quotes

We're getting rid of all single quote usage, unless it serves a specific purpose, as per the general style guide.
2020-03-29 16:30:52 -07:00
John Crepezzi
4e66e2dffc Update test to avoid Puma output format change
We are seeing some test failures for this test in #37291. It looks like
what's going on is that Puma has changed the output for this command
between 4.1 and 4.2

Previously:

```
...
* Environment: development
* Listening on tcp://localhost:3000
...

```

Now:

```
...
* Environment: development
* Listening on tcp://127.0.0.1:3000
* Listening on tcp://[::1]:3000
...

```

So to get around this, instead of checking the binding address, just
check for the presence of 'Listening' generally like we do on server
start.

Co-authored-by: eileencodes <eileencodes@gmail.com>
2019-09-25 13:11:58 -04:00
yuuji.yaginuma
efb706daad Fix server restart test on Puma 3.12.1
Since https://github.com/puma/puma/pull/1700, the default host is
correctly used. So `localhost` is used instead of `0.0.0.0`.

As a result, the log output on restart is changed, and the restart test
fails on Puma 3.12.1.
https://travis-ci.org/rails/rails/jobs/509239592#L2303-L2305

Specify binding explicitly to avoid being affected by Puma changes.
2019-03-22 07:49:38 +09:00
yuuji.yaginuma
25d8afb3a6 Fix rubocop violations 2019-02-09 10:50:58 +09:00
Matthew Draper
287920ca7d Respect ENV variables when finding DBs etc for the test suite
If they're not set we'll still fall back to localhost, but this makes it
possible to run the tests against a remote Postgres / Redis / whatever.
2019-02-06 01:20:06 +10:30
Rafael Mendonça França
553b86fc75
Remove deprecated support to old config.ru that use the application class as argument of run 2019-01-17 16:08:34 -05:00
Rafael Mendonça França
3e81490717
Remove all references to slave in the codebase 2018-09-10 16:31:32 -04:00
Ryuta Kamizono
a77447f4da Enable Lint/StringConversionInInterpolation rubocop rule
To prevent redundant `to_s` like https://github.com/rails/rails/pull/32923#discussion_r189460008
automatically in the future.
2018-05-21 21:10:14 +09:00
Prathamesh Sonpatki
b821f95403
Improve the deprecation message for using subclass of Rails::Application to start the Rails server 2018-01-07 20:48:53 +05:30
yuuji.yaginuma
91a4a820fe Ensure to use repo's Gemfile in application
Puma gets bundler's info from `Bundler::ORIGINAL_ENV` for restart.
f6f3892f4d/lib/puma/launcher.rb (L168)

So, specified `BUNDLE_GEMFILE` env for use same Gemfile in the restart.

Fixes #31351
2017-12-25 06:25:10 +09:00
bogdanvlviv
0eb2d6079a
Invoke rails command inside the railties' test app with TestHelpers::Generation#rails
See #30520
2017-10-08 23:28:51 +03:00
yuuji.yaginuma
2904ee23bf Make restart and dev:cache tasks work when customizing pid file path
Originally, it hard-coded pid file path. It can not be removed when customizing
pid file path.
But rake task can not get pid file path. Therefore, do not remove file in rake
task, makes it possible to judge whether it is restart from the argument of the
command and removes the file in server command.

Fixes #29306
2017-08-21 05:44:11 +09:00
Pat Allan
acea68de02 Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
yuuji.yaginuma
f217364893 Deprecate support of older config.ru
Since Rails 4.0, `config.ru` generated by default uses instances of
`Rails.application`.  Therefore, I think that it is good to deprecate
the old behavior.

Related: #9669
2017-08-08 07:47:11 +09:00