thin 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4541fb4ab6d2f90d8ca0053e41103ba2faed4f83
4
- data.tar.gz: 0e68ce58e93e07f3bd93a51ab180bc1c64b2757c
3
+ metadata.gz: 31c955b827052e1932230bf04e3818d77ea20a06
4
+ data.tar.gz: 4f21bb96c7a098ea400d5d788b900912e78e2231
5
5
  SHA512:
6
- metadata.gz: be8f1c6914e4f6ae498718595841ee682bc7c41590e0c8128ff2f5233621932e242542502bd4881b24b617b37503c98bb619fdd8c2dec0a0cc5a6b2c3a7de561
7
- data.tar.gz: 5f86ca62b6088e2a778fa8d9b777e7e60ceeea6bd7dfc21a6420e04ded91b03f03dc11c9a988099e11cab9d30e2a809330129b6ae74e974815348c55398c9989
6
+ metadata.gz: 4eb0b26d8523233a49ae1f68c63f765173f8f96d73066a53574aab352e1ccc9b89e4949399fd3e45bab13de08587232c05f7e91565b7ab9ac8fa4ca9f43d98fd
7
+ data.tar.gz: cd0fe1693ed40ec399ca882ca33fecf7c7c14b4925ad462be7df16db89db380f03657e2dec026b0fd2bd0f9eaea8e7e4c7fc1e3484249ff1f43ca28100936030
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 1.7.1 Muffin Mode
2
+ * Ruby 2.4 support (Fixnum deprecation) [nimish-mehta]
3
+ * Allow ERB templates in config files [markets]
4
+
1
5
  == 1.7.0 Dunder Mifflin
2
6
  * Rack 2 support
3
7
  * Ensure Response body.close is called in the same thread
@@ -13,7 +17,6 @@
13
17
  * Check for empty PID files [z1dane]
14
18
  * Update Event Machine version to 1.0.4, Ruby 2.2.0 fix [freemanoid]
15
19
 
16
-
17
20
  == 1.6.3 Protein Powder
18
21
  * Add HTTP 422 status code [rajcybage]
19
22
  * Add warning about EM reactor still running when stopping.
data/README.md CHANGED
@@ -1,35 +1,17 @@
1
- Thin
2
- ====
1
+ # Thin
3
2
 
4
- Tiny, fast & funny HTTP server
5
-
6
- Thin is a Ruby web server that glues together 3 of the best Ruby libraries in web history:
7
-
8
- * The Mongrel parser: the root of Mongrel speed and security
9
- * Event Machine: a network I/O library with extremely high scalability, performance and stability
10
- * Rack: a minimal interface between webservers and Ruby frameworks
11
-
12
- Which makes it, with all humility, the most secure, stable, fast and extensible Ruby web server
13
- bundled in an easy to use gem for your own pleasure.
14
-
15
- Site: http://code.macournoyer.com/thin/
16
- Group: http://groups.google.com/group/thin-ruby/topics
17
- Bugs: http://github.com/macournoyer/thin/issues
18
- Code: http://github.com/macournoyer/thin
19
- IRC: #thin on freenode
3
+ A small and fast Ruby web server
20
4
 
21
5
  ## Installation
22
6
 
23
- For the latest stable version:
24
-
25
- `gem install thin`
7
+ ```
8
+ gem install thin
9
+ ```
26
10
 
27
- Or from source:
11
+ Or add `thin` to your `Gemfile`:
28
12
 
29
- ```
30
- git clone git://github.com/macournoyer/thin.git
31
- cd thin
32
- rake install
13
+ ```ruby
14
+ gem 'thin'
33
15
  ```
34
16
 
35
17
  ## Usage
@@ -37,18 +19,30 @@ rake install
37
19
  A +thin+ script offers an easy way to start your Rack application:
38
20
 
39
21
  ```
40
- cd to/your/app
41
22
  thin start
42
23
  ```
43
24
 
44
- When using with Rails and Bundler, make sure to add `gem 'thin'`
45
- to your Gemfile.
25
+ Browse the `example` directory for sample applications.
26
+
27
+ ## Usage with Rails Action Cable
28
+
29
+ To use Thin with Action Cable, add the following to your `Gemfile`:
30
+
31
+ ```ruby
32
+ gem 'faye-websocket'
33
+ gem 'thin' # If not already done
34
+ ```
35
+
36
+ Create a `config/initializers/thin_action_cable.rb`:
46
37
 
47
- See example directory for samples.
38
+ ```ruby
39
+ Rails.application.config.action_cable.use_faye = true
40
+ Faye::WebSocket.load_adapter 'thin'
41
+ ```
48
42
 
49
- ### Command Line Examples
43
+ ### CLI
50
44
 
51
- Use a rackup file and bind to localhost port 8080:
45
+ Use a rackup (config.ru) file and bind to localhost port 8080:
52
46
 
53
47
  ```
54
48
  thin -R config.ru -a 127.0.0.1 -p 8080 start
@@ -60,11 +54,15 @@ Store the server process ID, log to a file and daemonize:
60
54
  thin -p 9292 -P tmp/pids/thin.pid -l logs/thin.log -d start
61
55
  ```
62
56
 
63
- Thin is quite flexible in that many options can be specified at the command line (see below for usage).
57
+ Thin is quite flexible in that many options can be specified at the command line (see `thin -h` for more).
64
58
 
65
59
  ### Configuration files
66
60
 
67
- You can create configuration files in yaml format and feed them to thin using `thin start -C config.yml`. Here is an example config file:
61
+ You can create a configuration file using `thin config -C config/thin.yml`.
62
+
63
+ You can then use it with all commands, such as: `thin start -C config/thin.yml`.
64
+
65
+ Here is an example config file:
68
66
 
69
67
  ```yaml
70
68
  ---
@@ -87,79 +85,13 @@ chdir: /path/to/your/apps/root
87
85
  tag: a-name-to-show-up-in-ps aux
88
86
  ```
89
87
 
90
- ### Command Line Options
91
-
92
- This is the usage for the thin command which can be obtained by running `thin -h` at the command line.
93
-
94
- ```sh
95
- Usage: thin [options] start|stop|restart|config|install
96
-
97
- Server options:
98
- -a, --address HOST bind to HOST address (default: 0.0.0.0)
99
- -p, --port PORT use PORT (default: 3000)
100
- -S, --socket FILE bind to unix domain socket
101
- -y, --swiftiply [KEY] Run using swiftiply
102
- -A, --adapter NAME Rack adapter to use (default: autodetect)
103
- (rack, rails, ramaze, merb, file)
104
- -R, --rackup FILE Load a Rack config file instead of Rack adapter
105
- -c, --chdir DIR Change to dir before starting
106
- --stats PATH Mount the Stats adapter under PATH
107
-
108
- SSL options:
109
- --ssl Enables SSL
110
- --ssl-key-file PATH Path to private key
111
- --ssl-cert-file PATH Path to certificate
112
- --ssl-disable-verify Disables (optional) client cert requests
113
-
114
- Adapter options:
115
- -e, --environment ENV Framework environment (default: development)
116
- --prefix PATH Mount the app under PATH (start with /)
117
-
118
- Daemon options:
119
- -d, --daemonize Run daemonized in the background
120
- -l, --log FILE File to redirect output (default: /home/robert/log/thin.log)
121
- -P, --pid FILE File to store PID (default: tmp/pids/thin.pid)
122
- -u, --user NAME User to run daemon as (use with -g)
123
- -g, --group NAME Group to run daemon as (use with -u)
124
- --tag NAME Additional text to display in process listing
125
-
126
- Cluster options:
127
- -s, --servers NUM Number of servers to start
128
- -o, --only NUM Send command to only one server of the cluster
129
- -C, --config FILE Load options from config file
130
- --all [DIR] Send command to each config files in DIR
131
- -O, --onebyone Restart the cluster one by one (only works with restart command)
132
- -w, --wait NUM Maximum wait time for server to be started in seconds (use with -O)
133
-
134
- Tuning options:
135
- -b, --backend CLASS Backend to use, full classname
136
- -t, --timeout SEC Request or command timeout in sec (default: 30)
137
- -f, --force Force the execution of the command
138
- --max-conns NUM Maximum number of open file descriptors (default: 1024)
139
- Might require sudo to set higher than 1024
140
- --max-persistent-conns NUM Maximum number of persistent connections
141
- (default: 100)
142
- --threaded Call the Rack application in threads [experimental]
143
- --threadpool-size NUM Sets the size of the EventMachine threadpool.
144
- (default: 20)
145
- --no-epoll Disable the use of epoll
146
-
147
- Common options:
148
- -r, --require FILE require the library
149
- -q, --quiet Silence all logging
150
- -D, --debug Enable debug logging
151
- -V, --trace Set tracing on (log raw request/response)
152
- -h, --help Show this message
153
- -v, --version Show version
154
- ```
155
-
156
88
  ## License
157
89
 
158
90
  Ruby License, http://www.ruby-lang.org/en/LICENSE.txt.
159
91
 
160
92
  ## Credits
161
93
 
162
- The parser was stolen from Mongrel http://mongrel.rubyforge.org by Zed Shaw.
94
+ The parser was originally from Mongrel http://mongrel.rubyforge.org by Zed Shaw.
163
95
  Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed under
164
96
  the Ruby license and the GPL2.
165
97
 
@@ -167,4 +99,4 @@ Thin is copyright Marc-Andre Cournoyer <macournoyer@gmail.com>
167
99
 
168
100
  Get help at http://groups.google.com/group/thin-ruby/
169
101
  Report bugs at https://github.com/macournoyer/thin/issues
170
- and major security issues directly to me macournoyer@gmail.com.
102
+ and major security issues directly to me at macournoyer@gmail.com.
@@ -1,6 +1,7 @@
1
1
  require 'logger'
2
2
  require 'optparse'
3
3
  require 'yaml'
4
+ require 'erb'
4
5
 
5
6
  module Thin
6
7
  # CLI runner.
@@ -219,7 +220,7 @@ module Thin
219
220
  private
220
221
  def load_options_from_config_file!
221
222
  if file = @options.delete(:config)
222
- YAML.load_file(file).each { |key, value| @options[key.to_sym] = value }
223
+ YAML.load(ERB.new(File.read(file)).result).each { |key, value| @options[key.to_sym] = value }
223
224
  end
224
225
  end
225
226
 
@@ -104,9 +104,9 @@ module Thin
104
104
  # received in any order.
105
105
  args.each do |arg|
106
106
  case arg
107
- when Fixnum, /^\d+$/ then port = arg.to_i
108
- when String then host = arg
109
- when Hash then options = arg
107
+ when 0.class, /^\d+$/ then port = arg.to_i
108
+ when String then host = arg
109
+ when Hash then options = arg
110
110
  else
111
111
  @app = arg if arg.respond_to?(:call)
112
112
  end
@@ -6,11 +6,11 @@ module Thin
6
6
  module VERSION #:nodoc:
7
7
  MAJOR = 1
8
8
  MINOR = 7
9
- TINY = 0
9
+ TINY = 1
10
10
 
11
11
  STRING = [MAJOR, MINOR, TINY].join('.')
12
12
 
13
- CODENAME = "Dunder Mifflin".freeze
13
+ CODENAME = "Muffin Mode".freeze
14
14
 
15
15
  RACK = [1, 0].freeze # Rack protocol version
16
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-Andre Cournoyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-27 00:00:00.000000000 Z
11
+ date: 2017-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  version: '0'
148
148
  requirements: []
149
149
  rubyforge_project: thin
150
- rubygems_version: 2.2.2
150
+ rubygems_version: 2.5.1
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: A thin and fast web server