anypow 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -22,7 +22,21 @@ Or install it yourself as:
22
22
 
23
23
  $ cat config.ru
24
24
  require "anypow"
25
- run Anypow::App.new("python -m SimpleHTTPServer $PORT")
25
+ extend Anypow
26
+ run_pow "plackup -p $PORT"
27
+
28
+ You can also use [foreman](https://github.com/ddollar/foreman) with pow!
29
+
30
+ $ cat config.ru
31
+ require "anypow"
32
+ extend Anypow
33
+ run_pow "foreman start -p $PORT"
34
+ require ::File.expand_path('../config/environment', __FILE__)
35
+ run Rails.application
36
+
37
+ $ cat Procfile
38
+ web: rackup -p $PORT
39
+ worker: rake worker:start
26
40
 
27
41
  ## Contributing
28
42
 
data/config.ru CHANGED
@@ -3,4 +3,4 @@ require "anypow"
3
3
  extend Anypow
4
4
  run_pow "foreman start -p $PORT"
5
5
 
6
- run Proc.new {|env| [200, {"Content-Type" => "text/plain", "Content-Length" => "11"}, ["Hello Rack!"]]}
6
+ run Proc.new {|env| [200, {"Content-Type" => "text/plain"}, ["Hello Rack!"]]}
@@ -15,6 +15,9 @@ module Anypow
15
15
  end
16
16
 
17
17
  def run_pow(command)
18
+ require 'rack'
19
+ use Rack::Chunked
20
+ use Rack::ContentLength
18
21
  run Anypow::App.new(command) if is_pow?
19
22
  end
20
23
 
@@ -19,6 +19,12 @@ class Anypow::App < Rack::Proxy
19
19
  super(opts)
20
20
  end
21
21
 
22
+ def rewrite_response(triplet)
23
+ status, headers, body = triplet
24
+ headers.delete('Transfer-Encoding')
25
+ triplet
26
+ end
27
+
22
28
  private
23
29
 
24
30
  def spawn_server(server_env, server_cmd)
@@ -1,3 +1,3 @@
1
1
  module Anypow
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anypow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-27 00:00:00.000000000 Z
12
+ date: 2013-07-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack-proxy