machinegun 0.2.0 → 0.2.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: 7137f868e393550a7ea7673c5b6ac8d794e9d878
4
- data.tar.gz: f4a42b7b3a2f75f12ec4749b024015e2ab1e016c
3
+ metadata.gz: 7157a4a84ec46df5aaec38a3e67e80e4ce8d4c4f
4
+ data.tar.gz: 3968ed963ec5c16aebcd851b68c32bc0c27a77e0
5
5
  SHA512:
6
- metadata.gz: 1f903d783b3b56c81546ff11f5610c440c046ea9a19ef7cc89fc3764ce611b37cbea40f219e4e64a7fa56df18b5603e5233da8069e375d8995ce9da8428a01c2
7
- data.tar.gz: 1e8c941cb8a7f8d51ffde2927571759d95f19f678025dd3d1de68cd681401ffaa1609904c446a7463b398b285d14ffc6b82ad52e51c62b0ad59b026afbdb5f2c
6
+ metadata.gz: d1d72c5cb73aad98e43c440a70a6ebce0de81fc50d0da05892d21d1d73c50ea15b1bc1c8f505be1787ba96e3a1726b6320511cbe0ffc9bd8ea95277919f8dba4
7
+ data.tar.gz: 90b636ee9679c2000f92800febd9dfbc9d4bba463f796858ec73e4ac6e84743a85b0fec6b9e2df11c9a2df940aff1e503527419c1b00def387ace381e0cf32b6
@@ -456,8 +456,8 @@
456
456
 
457
457
  <span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
458
458
  <span class='ivar'>@running</span> <span class='op'>=</span> <span class='kw'>true</span>
459
- <span class='id identifier rubyid_interval'>interval</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:interval</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='float'>0.5</span>
460
-
459
+ <span class='id identifier rubyid_interval'>interval</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:interval</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='float'>0.5</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span> <span class='comment'># FileWatcher interval must be numeric.
460
+ </span>
461
461
  <span class='ivar'>@pid</span> <span class='op'>=</span> <span class='id identifier rubyid_start_server'>start_server</span>
462
462
 
463
463
  <span class='ivar'>@watcher</span> <span class='op'>=</span> <span class='const'>FileWatcher</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>./**/*.rb</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
@@ -585,9 +585,9 @@
585
585
  </div>
586
586
 
587
587
  <div id="footer">
588
- Generated on Sat Oct 24 18:31:28 2015 by
588
+ Generated on Mon Oct 26 10:56:35 2015 by
589
589
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
590
- 0.8.7.6 (ruby-2.1.6).
590
+ 0.8.7.6 (ruby-2.1.1).
591
591
  </div>
592
592
 
593
593
  </body>
@@ -104,9 +104,9 @@
104
104
  </div>
105
105
 
106
106
  <div id="footer">
107
- Generated on Sat Oct 24 18:31:28 2015 by
107
+ Generated on Mon Oct 26 10:56:35 2015 by
108
108
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
109
- 0.8.7.6 (ruby-2.1.6).
109
+ 0.8.7.6 (ruby-2.1.1).
110
110
  </div>
111
111
 
112
112
  </body>
@@ -61,59 +61,43 @@
61
61
 
62
62
  <iframe id="search_frame"></iframe>
63
63
 
64
- <div id="content"><div id='filecontents'>
65
- <h1 id="label-machinegun">machinegun</h1>
66
-
67
- <p><a href="https://badge.fury.io/rb/machinegun"><img
68
- src="https://badge.fury.io/rb/machinegun.svg"></a> <a
69
- href="https://coveralls.io/github/amclain/machinegun?branch=master"><img
70
- src="https://coveralls.io/repos/amclain/machinegun/badge.svg?branch=master&service=github"></a>
71
- <a href="http://www.rubydoc.info/gems/machinegun"><img
72
- src="https://img.shields.io/badge/docs-api-blue.svg"></a> <a
73
- href="https://github.com/amclain/machinegun/blob/master/license.txt"><img
74
- src="https://img.shields.io/badge/license-MIT-yellowgreen.svg"></a></p>
64
+ <div id="content"><div id='filecontents'><h1>machinegun</h1>
65
+
66
+ <p><a href="https://badge.fury.io/rb/machinegun"><img src="https://badge.fury.io/rb/machinegun.svg" alt="Gem Version"></a>
67
+ <a href="https://coveralls.io/github/amclain/machinegun?branch=master"><img src="https://coveralls.io/repos/amclain/machinegun/badge.svg?branch=master&amp;service=github" alt="Coverage Status"></a>
68
+ <a href="http://www.rubydoc.info/gems/machinegun"><img src="https://img.shields.io/badge/docs-api-blue.svg" alt="API Documentation"></a>
69
+ <a href="https://github.com/amclain/machinegun/blob/master/license.txt"><img src="https://img.shields.io/badge/license-MIT-yellowgreen.svg" alt="MIT License"></a></p>
75
70
 
76
71
  <p>An automatic reloading Rack development web server for Ruby.</p>
77
72
 
78
- <p>This gem was inspired by <a
79
- href="https://github.com/rtomayko/shotgun">shotgun</a>, which reloads the
80
- application on every request to ensure that the latest code is running.
81
- However, reloading on request can cause performance problems for
82
- applications that consume a lot of memory and/or generate a lot of
83
- requests. machinegun solves this problem by reloading the application when
84
- there are changes to the filesystem, instead of reloading on each request.
85
- This allows for the best of both worlds: A web server that reloads when
86
- changes to the code are made, and also performs quickly when serving
87
- requests.</p>
73
+ <p>This gem was inspired by <a href="https://github.com/rtomayko/shotgun">shotgun</a>, which reloads the application on every request to ensure that the latest code is running. However, reloading on request can cause performance problems for applications that consume a lot of memory and/or generate a lot of requests. machinegun solves this problem by reloading the application when there are changes to the filesystem, instead of reloading on each request. This allows for the best of both worlds: A web server that reloads when changes to the code are made, and also performs quickly when serving requests.</p>
74
+
75
+ <h2>Installation</h2>
88
76
 
89
- <h2 id="label-Installation">Installation</h2>
77
+ <pre class="code text"><code class="text">$ gem install machinegun
78
+ </code></pre>
90
79
 
91
- <pre class="code ruby"><code class="ruby">$ gem install machinegun</code></pre>
80
+ <h2>Use</h2>
92
81
 
93
- <h2 id="label-Use">Use</h2>
82
+ <p>The <code>machinegun</code> command replaces <code>rackup</code>. rackup&#39;s command line options should be compatible with the machinegun executable. Since machinegun is a wrapper around Rack, your project also needs a <a href="https://github.com/rack/rack/wiki/(tutorial)-rackup-howto#config-file-syntax">Rack configuration file</a>, typically <code>config.ru</code>.</p>
94
83
 
95
- <p>The <code>machinegun</code> command replaces <code>rackup</code>.
96
- rackup&#39;s command line options should be compatible with the machinegun
97
- executable. Since machinegun is a wrapper around Rack, your project also
98
- needs a <a
99
- href="https://github.com/rack/rack/wiki/(tutorial)-rackup-howto#config-file-syntax">Rack
100
- configuration file</a>, typically <code>config.ru</code>.</p>
84
+ <p>For example, the following command will launch the web server on port 9393 and bind it to all network adapters:</p>
101
85
 
102
- <p>For example, the following command will launch the web server on port 9393
103
- and bind it to all network adapters:</p>
86
+ <pre class="code text"><code class="text">$ machinegun -p 9393 -o 0.0.0.0
87
+ </code></pre>
104
88
 
105
- <pre class="code ruby"><code class="ruby">$ machinegun -p 9393 -o 0.0.0.0</code></pre>
89
+ <h2>Development</h2>
106
90
 
107
- <h2 id="label-Development">Development</h2>
91
+ <p>To skip the integration tests during development, run the test suite with:</p>
108
92
 
109
- <p>To skip the integration tests during development, run the test suite with:
110
- <code>text $ SKIP_INTEGRATION_TESTS=true bundle exec rake </code></p>
93
+ <pre class="code text"><code class="text">$ SKIP_INTEGRATION_TESTS=true bundle exec rake
94
+ </code></pre>
111
95
  </div></div>
112
96
 
113
97
  <div id="footer">
114
- Generated on Sat Oct 24 18:31:28 2015 by
98
+ Generated on Mon Oct 26 10:56:35 2015 by
115
99
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
116
- 0.8.7.6 (ruby-2.1.6).
100
+ 0.8.7.6 (ruby-2.1.1).
117
101
  </div>
118
102
 
119
103
  </body>
@@ -64,9 +64,9 @@
64
64
  <div id="content"><div id='filecontents'>The MIT License (MIT)<br/><br/>Copyright (c) 2015 Alex McLain<br/><br/>Permission is hereby granted, free of charge, to any person obtaining a copy<br/>of this software and associated documentation files (the &quot;Software&quot;), to deal<br/>in the Software without restriction, including without limitation the rights<br/>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br/>copies of the Software, and to permit persons to whom the Software is<br/>furnished to do so, subject to the following conditions:<br/><br/>The above copyright notice and this permission notice shall be included in<br/>all copies or substantial portions of the Software.<br/><br/>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br/>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br/>FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br/>AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br/>LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br/>OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br/>THE SOFTWARE.</div></div>
65
65
 
66
66
  <div id="footer">
67
- Generated on Sat Oct 24 18:31:28 2015 by
67
+ Generated on Mon Oct 26 10:56:35 2015 by
68
68
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
69
- 0.8.7.6 (ruby-2.1.6).
69
+ 0.8.7.6 (ruby-2.1.1).
70
70
  </div>
71
71
 
72
72
  </body>
@@ -61,59 +61,43 @@
61
61
 
62
62
  <iframe id="search_frame"></iframe>
63
63
 
64
- <div id="content"><div id='filecontents'>
65
- <h1 id="label-machinegun">machinegun</h1>
66
-
67
- <p><a href="https://badge.fury.io/rb/machinegun"><img
68
- src="https://badge.fury.io/rb/machinegun.svg"></a> <a
69
- href="https://coveralls.io/github/amclain/machinegun?branch=master"><img
70
- src="https://coveralls.io/repos/amclain/machinegun/badge.svg?branch=master&service=github"></a>
71
- <a href="http://www.rubydoc.info/gems/machinegun"><img
72
- src="https://img.shields.io/badge/docs-api-blue.svg"></a> <a
73
- href="https://github.com/amclain/machinegun/blob/master/license.txt"><img
74
- src="https://img.shields.io/badge/license-MIT-yellowgreen.svg"></a></p>
64
+ <div id="content"><div id='filecontents'><h1>machinegun</h1>
65
+
66
+ <p><a href="https://badge.fury.io/rb/machinegun"><img src="https://badge.fury.io/rb/machinegun.svg" alt="Gem Version"></a>
67
+ <a href="https://coveralls.io/github/amclain/machinegun?branch=master"><img src="https://coveralls.io/repos/amclain/machinegun/badge.svg?branch=master&amp;service=github" alt="Coverage Status"></a>
68
+ <a href="http://www.rubydoc.info/gems/machinegun"><img src="https://img.shields.io/badge/docs-api-blue.svg" alt="API Documentation"></a>
69
+ <a href="https://github.com/amclain/machinegun/blob/master/license.txt"><img src="https://img.shields.io/badge/license-MIT-yellowgreen.svg" alt="MIT License"></a></p>
75
70
 
76
71
  <p>An automatic reloading Rack development web server for Ruby.</p>
77
72
 
78
- <p>This gem was inspired by <a
79
- href="https://github.com/rtomayko/shotgun">shotgun</a>, which reloads the
80
- application on every request to ensure that the latest code is running.
81
- However, reloading on request can cause performance problems for
82
- applications that consume a lot of memory and/or generate a lot of
83
- requests. machinegun solves this problem by reloading the application when
84
- there are changes to the filesystem, instead of reloading on each request.
85
- This allows for the best of both worlds: A web server that reloads when
86
- changes to the code are made, and also performs quickly when serving
87
- requests.</p>
73
+ <p>This gem was inspired by <a href="https://github.com/rtomayko/shotgun">shotgun</a>, which reloads the application on every request to ensure that the latest code is running. However, reloading on request can cause performance problems for applications that consume a lot of memory and/or generate a lot of requests. machinegun solves this problem by reloading the application when there are changes to the filesystem, instead of reloading on each request. This allows for the best of both worlds: A web server that reloads when changes to the code are made, and also performs quickly when serving requests.</p>
74
+
75
+ <h2>Installation</h2>
88
76
 
89
- <h2 id="label-Installation">Installation</h2>
77
+ <pre class="code text"><code class="text">$ gem install machinegun
78
+ </code></pre>
90
79
 
91
- <pre class="code ruby"><code class="ruby">$ gem install machinegun</code></pre>
80
+ <h2>Use</h2>
92
81
 
93
- <h2 id="label-Use">Use</h2>
82
+ <p>The <code>machinegun</code> command replaces <code>rackup</code>. rackup&#39;s command line options should be compatible with the machinegun executable. Since machinegun is a wrapper around Rack, your project also needs a <a href="https://github.com/rack/rack/wiki/(tutorial)-rackup-howto#config-file-syntax">Rack configuration file</a>, typically <code>config.ru</code>.</p>
94
83
 
95
- <p>The <code>machinegun</code> command replaces <code>rackup</code>.
96
- rackup&#39;s command line options should be compatible with the machinegun
97
- executable. Since machinegun is a wrapper around Rack, your project also
98
- needs a <a
99
- href="https://github.com/rack/rack/wiki/(tutorial)-rackup-howto#config-file-syntax">Rack
100
- configuration file</a>, typically <code>config.ru</code>.</p>
84
+ <p>For example, the following command will launch the web server on port 9393 and bind it to all network adapters:</p>
101
85
 
102
- <p>For example, the following command will launch the web server on port 9393
103
- and bind it to all network adapters:</p>
86
+ <pre class="code text"><code class="text">$ machinegun -p 9393 -o 0.0.0.0
87
+ </code></pre>
104
88
 
105
- <pre class="code ruby"><code class="ruby">$ machinegun -p 9393 -o 0.0.0.0</code></pre>
89
+ <h2>Development</h2>
106
90
 
107
- <h2 id="label-Development">Development</h2>
91
+ <p>To skip the integration tests during development, run the test suite with:</p>
108
92
 
109
- <p>To skip the integration tests during development, run the test suite with:
110
- <code>text $ SKIP_INTEGRATION_TESTS=true bundle exec rake </code></p>
93
+ <pre class="code text"><code class="text">$ SKIP_INTEGRATION_TESTS=true bundle exec rake
94
+ </code></pre>
111
95
  </div></div>
112
96
 
113
97
  <div id="footer">
114
- Generated on Sat Oct 24 18:31:28 2015 by
98
+ Generated on Mon Oct 26 10:56:35 2015 by
115
99
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
116
- 0.8.7.6 (ruby-2.1.6).
100
+ 0.8.7.6 (ruby-2.1.1).
117
101
  </div>
118
102
 
119
103
  </body>
@@ -103,9 +103,9 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Sat Oct 24 18:31:28 2015 by
106
+ Generated on Mon Oct 26 10:56:35 2015 by
107
107
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
- 0.8.7.6 (ruby-2.1.6).
108
+ 0.8.7.6 (ruby-2.1.1).
109
109
  </div>
110
110
 
111
111
  </body>
@@ -20,7 +20,7 @@ class MachineGun
20
20
  # filesystem for changes.
21
21
  def run opts = {}
22
22
  @running = true
23
- interval = opts[:interval] || 0.5
23
+ interval = (opts[:interval] || 0.5).to_f # FileWatcher interval must be numeric.
24
24
 
25
25
  @pid = start_server
26
26
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: machinegun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex McLain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-24 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  version: '0'
205
205
  requirements: []
206
206
  rubyforge_project:
207
- rubygems_version: 2.2.3
207
+ rubygems_version: 2.4.1
208
208
  signing_key:
209
209
  specification_version: 4
210
210
  summary: An automatic reloading Rack development web server for Ruby.