1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
Commit graph

33 commits

Author SHA1 Message Date
Michael Grosser
0886aef3d0 run tests with bundler since that is what our users run (#1317) 2017-06-09 05:20:03 -07:00
Michael Grosser
febef44844 simplify test shellout and make sure no other version of puma is available so we know our tests work (#1311) 2017-06-02 13:24:01 -07:00
Michael Grosser
fec20f0f05 support older versions of bundler that do not have clean_env (#1314)
fixes https://github.com/puma/puma/issues/1312
2017-06-02 07:21:52 -07:00
Michael Grosser
b209db959a
also forget about BUNDLE_GEMFILE etc settings bundler sets up before loading puma
when restarting a symlinked server the BUNDLE_GEMFILE env var
will point to the old releases Gemfile ... which results in running gems that
do not belong to the current release
2017-05-03 13:07:46 -07:00
Michael Grosser
b548b624ea
restore environment to original state before restarting
- prevents apps from forever poisoning the ENV by doing bad things (something overrides PATH/HOME etc)
 - allows use of Dotenv to load new ENV settings from disk (they do not override)

Test:

```
puts "THIS SHOULD CHANGE #{ENV["TEST"] ||= rand.to_s}"
```

then restart the server
2017-04-10 12:05:33 -07:00
schneems
cda9317e71 Split out config into explicit user and file parts 2017-03-09 11:38:26 -06:00
schneems
e80b0cfd7e Make sure default values are not procs 2017-03-09 11:38:26 -06:00
Olle Jonsson
017348f40d typo: argv should be args here (#1174)
- see #1114
2016-12-14 06:47:15 -07:00
Samuel Cochran
0fd42b8fca Prune bundler should inherit fds (#1114)
Ruby 2.0 changed this behaviour so fds are closed by default during an
exec. If using socket activation from systemd however this closes the
fds before they can be activated.

Adding this options seems to fix things.
2016-12-13 13:51:41 -07:00
Francesco Rodriguez
ea22ade352 Require StateFile if needed. 2016-09-08 17:46:24 +02:00
Evan Phoenix
5fdf337790 Move puma.rb to just autoloads. Fixes #1063 2016-09-05 11:29:16 -07:00
Evan Phoenix
eb6468d558 Handle HUP as a stop unless there is IO redirection. Fixes #911 2016-07-24 15:24:42 -07:00
Evan Phoenix
5654d558fd Don't use ENV['PWD'] on windows. Fixes #1023 2016-07-23 21:36:05 -07:00
Vipul A M
bf4a846007 Fix typos at couple of places. 2016-04-07 23:54:45 +05:30
Evan Phoenix
8b05d0a763 Simplify and fix logic for directory to use when restarting for all phases 2016-03-20 14:09:30 -07:00
Evan Phoenix
75b6bd14a2 Disable USR1 usage on JRuby 2016-03-05 21:44:37 -08:00
Evan Phoenix
d7c13dd63f Fix jruby daemonization. Fixes #918 2016-03-05 16:28:39 -08:00
Evan Phoenix
33e0fa9999 Manage nested configuration better 2016-02-07 14:51:54 -08:00
Evan Phoenix
663666c5b7 Add plugin mechanism and initial plugin 2016-02-06 22:28:02 -08:00
Evan Phoenix
f788af0c8f Continue API cleanup, preparing for 3.0 2016-02-06 19:00:29 -08:00
schneems
023c0c8ecd Fix rack handler test to use port 0 2016-02-04 16:55:10 -06:00
schneems
36711207e8 Fix Puma with rails server
The "default" thread in the handler was interpreted as canonical and took precedence over the `config/puma.rb` file. Fixed by using defaults already present in `configuration.rb` which is used by the Launcher.

We only advertise `Puma.cli_config` when puma is set via the cli. Not sure why but if `cli.rb` hasn't been loaded then we don't need to run that code.

Moving requires to Launcher so it can be called as a standalone file (otherwise we get require errors).
2016-02-04 16:55:10 -06:00
schneems
232bb6b17e Fix bad rebase 2016-02-04 16:55:10 -06:00
schneems
15447fedaa Add an app to the example docs 2016-02-04 16:55:10 -06:00
schneems
1d096be25c argv is an array 2016-02-04 16:55:10 -06:00
schneems
6de8beea1f Docs 2016-02-04 16:55:10 -06:00
schneems
da4a33bb4a More explicit options
The "cli_options" aren't always going to be from a CLI, also this makes it explicit that they are an input, and therefore not cannonical. Switch to `launcher_args` because if I was writing this in Ruby 2.1 they would be kwargs, and the "options" word is confusing since there's enough arguments.
2016-02-04 16:55:10 -06:00
schneems
2632e6a481 Remove unused runner method 2016-02-04 16:55:10 -06:00
schneems
256e886a45 Remove config from CLI
Don't store @cli_options in Launcher (there are too many "options" hashes and their roles are confusing, let's make them more obvious, the arguments passed to cli_options are parsed and turned into @options).
2016-02-04 16:55:10 -06:00
schneems
ffae12c40f Move @argv from attr_accessor to initialize 2016-02-04 16:55:10 -06:00
schneems
f646242821 Move binder to launcher 2016-02-04 16:55:10 -06:00
schneems
6ca4c4ca0a Move more logic out of CLI
Focus on removing @options. Delegate all actions to launcher.
2016-02-04 16:55:10 -06:00
schneems
182c836869 Initial Seperation of CLI and Server Launcher work
This is a WIP. This was the minimum I could do to get all tests to pass without changing any tests. Eventually I think we want all high level process controls to come from launcher, I also think we want another separate object that gets passed to Runner/Single/Cluster that will maintain a relationship with the Launcher. We could use this as the object that also gets exposed to the app like the Embeddable class we talked about earlier. 

Moving forwards i'm planning to port out the CLI tests to only test that they are parsing the correct config and launching servers. I'll port all low level unit tests over to the launcher. Making this change we could either keep all the public methods in CLI that delegate to `@launcher`, I'm guessing not many people are using the internals of CLI and we can take them out. It's your call though.

Wanted to kick this over the fence and see if you had any strong reactions or feelings about this approach.
2016-02-04 16:55:10 -06:00