goliath 0.9.2 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of goliath might be problematic. Click here for more details.

Files changed (49) hide show
  1. data/Gemfile +1 -1
  2. data/{HISTORY → HISTORY.md} +26 -12
  3. data/README.md +17 -10
  4. data/examples/api_proxy.rb +28 -0
  5. data/examples/async_aroundware_demo.rb +14 -10
  6. data/examples/auth_and_rate_limit.rb +160 -38
  7. data/examples/config/auth_and_rate_limit.rb +8 -5
  8. data/examples/config/content_stream.rb +5 -9
  9. data/examples/early_abort.rb +37 -0
  10. data/examples/env_use_statements.rb +3 -0
  11. data/examples/favicon.rb +40 -0
  12. data/examples/http_log.rb +2 -1
  13. data/examples/public/favicon.ico +0 -0
  14. data/examples/rack_routes.rb +19 -0
  15. data/examples/rasterize/rasterize.rb +2 -1
  16. data/examples/rasterize/rasterize_and_shorten.rb +10 -5
  17. data/goliath.gemspec +7 -9
  18. data/lib/goliath/api.rb +16 -4
  19. data/lib/goliath/connection.rb +8 -7
  20. data/lib/goliath/deprecated/async_aroundware.rb +133 -0
  21. data/lib/goliath/{synchrony → deprecated}/mongo_receiver.rb +28 -8
  22. data/lib/goliath/deprecated/response_receiver.rb +97 -0
  23. data/lib/goliath/env.rb +5 -0
  24. data/lib/goliath/rack.rb +6 -1
  25. data/lib/goliath/rack/async_middleware.rb +34 -12
  26. data/lib/goliath/rack/barrier_aroundware.rb +228 -0
  27. data/lib/goliath/rack/barrier_aroundware_factory.rb +60 -0
  28. data/lib/goliath/rack/builder.rb +22 -6
  29. data/lib/goliath/rack/heartbeat.rb +8 -5
  30. data/lib/goliath/rack/simple_aroundware.rb +114 -0
  31. data/lib/goliath/rack/simple_aroundware_factory.rb +121 -0
  32. data/lib/goliath/rack/validation/required_param.rb +9 -2
  33. data/lib/goliath/request.rb +7 -0
  34. data/lib/goliath/runner.rb +17 -5
  35. data/lib/goliath/server.rb +11 -3
  36. data/lib/goliath/test_helper.rb +14 -14
  37. data/lib/goliath/version.rb +1 -1
  38. data/spec/integration/early_abort_spec.rb +50 -0
  39. data/spec/integration/keepalive_spec.rb +2 -2
  40. data/spec/integration/pipelining_spec.rb +2 -2
  41. data/spec/integration/rack_routes_spec.rb +25 -0
  42. data/spec/integration/template_spec.rb +2 -0
  43. data/spec/unit/rack/heartbeat_spec.rb +11 -1
  44. data/spec/unit/rack/validation/required_param_spec.rb +10 -0
  45. data/spec/unit/runner_spec.rb +13 -0
  46. data/spec/unit/server_spec.rb +4 -0
  47. metadata +218 -265
  48. data/lib/goliath/rack/async_aroundware.rb +0 -56
  49. data/lib/goliath/synchrony/response_receiver.rb +0 -64
@@ -69,11 +69,11 @@ module Goliath
69
69
  #
70
70
  # @return Does not return until the server has halted.
71
71
  def start(&blk)
72
+ EM.epoll
72
73
  EM.synchrony do
73
74
  trap("INT") { EM.stop }
74
75
  trap("TERM") { EM.stop }
75
-
76
- EM.epoll
76
+ trap("HUP") { load_config(options[:config]) }
77
77
 
78
78
  load_config(options[:config])
79
79
  load_plugins
@@ -81,6 +81,14 @@ module Goliath
81
81
  EM.set_effective_user(options[:user]) if options[:user]
82
82
 
83
83
  EM.start_server(address, port, Goliath::Connection) do |conn|
84
+ if options[:ssl]
85
+ conn.start_tls(
86
+ :private_key_file => options[:ssl_key],
87
+ :cert_chain_file => options[:ssl_cert],
88
+ :verify_peer => options[:ssl_verify]
89
+ )
90
+ end
91
+
84
92
  conn.port = port
85
93
  conn.app = app
86
94
  conn.api = api
@@ -99,7 +107,7 @@ module Goliath
99
107
  # @param file [String] The file to load, if not set will use the basename of $0
100
108
  # @return [Nil]
101
109
  def load_config(file = nil)
102
- api_name = api.class.to_s.gsub(/(.)([A-Z])/,'\1_\2').downcase!
110
+ api_name = api.class.to_s.gsub('::', '_').gsub(/([^_A-Z])([A-Z])/,'\1_\2').downcase!
103
111
  file ||= "#{config_dir}/#{api_name}.rb"
104
112
  return unless File.exists?(file)
105
113
 
@@ -29,13 +29,13 @@ module Goliath
29
29
  end
30
30
 
31
31
  # Launches an instance of a given API server. The server
32
- # will launch on the default settings of localhost port 9000.
32
+ # will launch on the specified port.
33
33
  #
34
34
  # @param api [Class] The API class to launch
35
35
  # @param port [Integer] The port to run the server on
36
36
  # @param options [Hash] The options hash to provide to the server
37
37
  # @return [Goliath::Server] The executed server
38
- def server(api, port = 9000, options = {}, &blk)
38
+ def server(api, port, options = {}, &blk)
39
39
  op = OptionParser.new
40
40
 
41
41
  s = Goliath::Server.new
@@ -44,7 +44,7 @@ module Goliath
44
44
  s.app = Goliath::Rack::Builder.build(api, s.api)
45
45
  s.api.options_parser(op, options)
46
46
  s.options = options
47
- s.port = port
47
+ s.port = @test_server_port = port
48
48
  s.start(&blk)
49
49
  s
50
50
  end
@@ -64,7 +64,7 @@ module Goliath
64
64
  # @param blk [Proc] The code to execute after the server is launched.
65
65
  # @note This will not return until stop is called.
66
66
  def with_api(api, options = {}, &blk)
67
- server(api, 9000, options, &blk)
67
+ server(api, options.delete(:port) || 9900, options, &blk)
68
68
  end
69
69
 
70
70
  # Helper method to setup common callbacks for various request methods.
@@ -90,8 +90,7 @@ module Goliath
90
90
  # @param errback [Proc] An error handler to attach
91
91
  # @param blk [Proc] The callback block to execute
92
92
  def head_request(request_data = {}, errback = nil, &blk)
93
- path = request_data.delete(:path) || ''
94
- req = EM::HttpRequest.new("http://localhost:9000#{path}").head(request_data)
93
+ req = test_request(request_data).head(request_data)
95
94
  hookup_request_callbacks(req, errback, &blk)
96
95
  end
97
96
 
@@ -101,8 +100,7 @@ module Goliath
101
100
  # @param errback [Proc] An error handler to attach
102
101
  # @param blk [Proc] The callback block to execute
103
102
  def get_request(request_data = {}, errback = nil, &blk)
104
- path = request_data.delete(:path) || ''
105
- req = EM::HttpRequest.new("http://localhost:9000#{path}").get(request_data)
103
+ req = test_request(request_data).get(request_data)
106
104
  hookup_request_callbacks(req, errback, &blk)
107
105
  end
108
106
 
@@ -112,8 +110,7 @@ module Goliath
112
110
  # @param errback [Proc] An error handler to attach
113
111
  # @param blk [Proc] The callback block to execute
114
112
  def post_request(request_data = {}, errback = nil, &blk)
115
- path = request_data.delete(:path) || ''
116
- req = EM::HttpRequest.new("http://localhost:9000#{path}").post(request_data)
113
+ req = test_request(request_data).post(request_data)
117
114
  hookup_request_callbacks(req, errback, &blk)
118
115
  end
119
116
 
@@ -123,8 +120,7 @@ module Goliath
123
120
  # @param errback [Proc] An error handler to attach
124
121
  # @param blk [Proc] The callback block to execute
125
122
  def put_request(request_data = {}, errback = nil, &blk)
126
- path = request_data.delete(:path) || ''
127
- req = EM::HttpRequest.new("http://localhost:9000#{path}").put(request_data)
123
+ req = test_request(request_data).put(request_data)
128
124
  hookup_request_callbacks(req, errback, &blk)
129
125
  end
130
126
 
@@ -134,9 +130,13 @@ module Goliath
134
130
  # @param errback [Proc] An error handler to attach
135
131
  # @param blk [Proc] The callback block to execute
136
132
  def delete_request(request_data = {}, errback = nil, &blk)
137
- path = request_data.delete(:path) || ''
138
- req = EM::HttpRequest.new("http://localhost:9000#{path}").delete(request_data)
133
+ req = test_request(request_data).delete(request_data)
139
134
  hookup_request_callbacks(req, errback, &blk)
140
135
  end
136
+
137
+ def test_request(request_data)
138
+ path = request_data.delete(:path) || ''
139
+ EM::HttpRequest.new("http://localhost:#{@test_server_port}#{path}")
140
+ end
141
141
  end
142
142
  end
@@ -1,4 +1,4 @@
1
1
  module Goliath
2
2
  # The current version of Goliath
3
- VERSION = '0.9.2'
3
+ VERSION = '0.9.4'
4
4
  end
@@ -0,0 +1,50 @@
1
+ require 'spec_helper'
2
+ require File.join(File.dirname(__FILE__), '../../', 'examples/early_abort')
3
+
4
+ describe EarlyAbort do
5
+ let(:err) { Proc.new { fail "API request failed" } }
6
+
7
+ after do
8
+ File.unlink(EarlyAbort::TEST_FILE) if File.exist?(EarlyAbort::TEST_FILE)
9
+ end
10
+
11
+ it "should return OK" do
12
+ with_api(EarlyAbort) do
13
+ get_request({}, err) do |c|
14
+ c.response.should == "OK"
15
+ end
16
+ end
17
+ end
18
+
19
+ # The following two tests are very brittle, since they depend on the speed
20
+ # of the machine executing the test and the size of the incoming data
21
+ # packets. I hope someone more knowledgeable will be able to refactor these
22
+ # ;-)
23
+ it 'fails without going in the response method if exception is raised in on_header hook' do
24
+ with_api(EarlyAbort) do
25
+ request_data = {
26
+ :body => (["abcd"] * 200_000).join,
27
+ :head => {'X-Crash' => 'true'}
28
+ }
29
+
30
+ post_request(request_data, err) do |c|
31
+ c.response.should == "{\"error\":\"Can't handle requests with X-Crash: true.\"}"
32
+ File.exist?("/tmp/goliath-test-error.log").should be_false
33
+ end
34
+ end
35
+ end
36
+
37
+ it 'fails without going in the response method if exception is raised in on_body hook' do
38
+ with_api(EarlyAbort) do
39
+ request_data = {
40
+ :body => (["abcd"] * 200_000).join
41
+ }
42
+
43
+ post_request(request_data, err) do |c|
44
+ c.response.should =~ /Payload size can't exceed 10 bytes/
45
+ File.exist?("/tmp/goliath-test-error.log").should be_false
46
+ end
47
+ end
48
+ end
49
+
50
+ end
@@ -3,8 +3,8 @@ require File.join(File.dirname(__FILE__), '../../', 'examples/echo')
3
3
 
4
4
  describe 'HTTP Keep-Alive support' do
5
5
  it 'serves multiple requests via single connection' do
6
- with_api(Echo) do
7
- conn = EM::HttpRequest.new('http://localhost:9000')
6
+ with_api(Echo, :port => 9901) do
7
+ conn = EM::HttpRequest.new('http://localhost:9901')
8
8
  r1 = conn.get(:query => {:echo => 'test'}, :keepalive => true)
9
9
 
10
10
  r1.errback { fail }
@@ -13,11 +13,11 @@ end
13
13
 
14
14
  describe 'HTTP Pipelining support' do
15
15
  it 'serves multiple requests via single connection' do
16
- with_api(Interleaving) do
16
+ with_api(Interleaving, :port => 9901) do
17
17
  start = Time.now.to_f
18
18
  res = []
19
19
 
20
- conn = EM::HttpRequest.new('http://localhost:9000')
20
+ conn = EM::HttpRequest.new('http://localhost:9901')
21
21
  r1 = conn.aget :query => {:delay => 0.3}, :keepalive => true
22
22
  r2 = conn.aget :query => {:delay => 0.2}
23
23
 
@@ -75,6 +75,7 @@ describe RackRoutes do
75
75
  end
76
76
  end
77
77
  end
78
+
78
79
  it 'should reject other request methods' do
79
80
  with_api(RackRoutes) do
80
81
  put_request({:path => '/hello_world'}, err) do |c|
@@ -94,6 +95,9 @@ describe RackRoutes do
94
95
  end
95
96
  end
96
97
  end
98
+ end
99
+
100
+ context 'routes defined with head' do
97
101
  it 'should allow head' do
98
102
  with_api(RackRoutes) do
99
103
  head_request({:path => '/hello_world'}, err) do |c|
@@ -140,5 +144,26 @@ describe RackRoutes do
140
144
  end
141
145
  end
142
146
 
147
+ context "with event handlers" do
148
+ it "collects header events" do
149
+ with_api(RackRoutes) do
150
+ get_request({:path => '/headers'}, err) do |c|
151
+ c.response_header.status.should == 200
152
+ c.response.should == 'headers: {"Connection"=>"close", "Host"=>"localhost:9900", "User-Agent"=>"EventMachine HttpClient"}'
153
+ end
154
+ end
155
+ end
156
+
157
+ it "rejects POST request" do
158
+ with_api(RackRoutes) do
159
+ post_request({:path => '/headers'}, err) do |c|
160
+ # the /headers route only supports GET requests
161
+ c.response_header.status.should == 405
162
+ c.response.should == '[:error, "Invalid request method"]'
163
+ c.response_header['ALLOW'].should == 'GET'
164
+ end
165
+ end
166
+ end
167
+ end
143
168
  end
144
169
  end
@@ -1,6 +1,7 @@
1
1
  require 'spec_helper'
2
2
  require File.join(File.dirname(__FILE__), '../../', 'examples/template')
3
3
 
4
+
4
5
  describe Template do
5
6
 
6
7
  def config_file
@@ -10,6 +11,7 @@ describe Template do
10
11
  let(:api_options) { { :config => config_file } }
11
12
 
12
13
  it 'renders haml template with default haml layout' do
14
+
13
15
  with_api(Template, api_options) do
14
16
  get_request do |c|
15
17
  c.response.should =~ %r{<li><a href="/joke">Tell me a joke</a></li>}
@@ -43,5 +43,15 @@ describe Goliath::Rack::Heartbeat do
43
43
  headers.should == {}
44
44
  body.should == 'OK'
45
45
  end
46
+
47
+ it 'allows path and response to be set using options' do
48
+ @hb = Goliath::Rack::Heartbeat.new(@app, :path => '/isup', :response => [204, {}, nil])
49
+ @env['PATH_INFO'] = '/isup'
50
+ status, headers, body = @hb.call(@env)
51
+ status.should == 204
52
+ headers.should == {}
53
+ body.should == nil
54
+ end
46
55
  end
47
- end
56
+ end
57
+
@@ -91,6 +91,16 @@ describe Goliath::Rack::Validation::RequiredParam do
91
91
  @env['params']['mk'] = [1, 2, 3, 4]
92
92
  @rp.key_valid?(@env['params']).should be_true
93
93
  end
94
+
95
+ it "doesn't raise if the key provided is multiline and has blanks" do
96
+ @env['params']['mk'] = "my\n \nvalue"
97
+ @rp.key_valid?(@env['params']).should be_true
98
+ end
99
+
100
+ it "doesn't raise if the key provided is an array and contains multiline with blanks" do
101
+ @env['params']['mk'] = ["my\n \nvalue", "my\n \nother\n \nvalue"]
102
+ @rp.key_valid?(@env['params']).should be_true
103
+ end
94
104
  end
95
105
  end
96
106
  end
@@ -10,6 +10,13 @@ describe Goliath::Runner do
10
10
  @r.stub!(:setup_logger).and_return(@log_mock)
11
11
  end
12
12
 
13
+ after(:each) do
14
+ # Runner default env is development.
15
+ # We do need to revert to test
16
+ Goliath.env = :test
17
+ end
18
+
19
+
13
20
  describe 'server execution' do
14
21
  describe 'daemonization' do
15
22
  it 'daemonizes if specified' do
@@ -30,6 +37,12 @@ describe Goliath::Runner do
30
37
  @r = Goliath::Runner.new([], nil)
31
38
  end
32
39
 
40
+ after(:each) do
41
+ # Runner default env is development.
42
+ # We do need to revert to test
43
+ Goliath.env = :test
44
+ end
45
+
33
46
  describe 'without setting up file logger' do
34
47
  before(:each) do
35
48
  @r.stub!(:setup_file_logger)
@@ -105,6 +105,10 @@ describe Goliath::Server do
105
105
 
106
106
  context 'config parsing' do
107
107
  context 'environment' do
108
+ after(:all) do
109
+ # Be sure to revert to correct env
110
+ Goliath.env = :test
111
+ end
108
112
  it 'executes the block if the environment matches the provided string' do
109
113
  Goliath.env = :development
110
114
  block_run = false
metadata CHANGED
@@ -1,334 +1,281 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: goliath
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.4
4
5
  prerelease:
5
- version: 0.9.2
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - dan sinclair
9
9
  - Ilya Grigorik
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
-
14
- date: 2011-07-21 00:00:00 -04:00
15
- default_executable:
16
- dependencies:
17
- - !ruby/object:Gem::Dependency
13
+ date: 2011-10-20 00:00:00.000000000Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
18
16
  name: eventmachine
19
- prerelease: false
20
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &2152695420 !ruby/object:Gem::Requirement
21
18
  none: false
22
- requirements:
23
- - - ">="
24
- - !ruby/object:Gem::Version
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
25
22
  version: 1.0.0.beta.3
26
23
  type: :runtime
27
- version_requirements: *id001
28
- - !ruby/object:Gem::Dependency
29
- name: em-synchrony
30
24
  prerelease: false
31
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *2152695420
26
+ - !ruby/object:Gem::Dependency
27
+ name: em-synchrony
28
+ requirement: &2152694920 !ruby/object:Gem::Requirement
32
29
  none: false
33
- requirements:
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: 0.3.0.beta.1
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.0
37
34
  type: :runtime
38
- version_requirements: *id002
39
- - !ruby/object:Gem::Dependency
40
- name: http_parser.rb
41
35
  prerelease: false
42
- requirement: &id003 !ruby/object:Gem::Requirement
36
+ version_requirements: *2152694920
37
+ - !ruby/object:Gem::Dependency
38
+ name: http_parser.rb
39
+ requirement: &2152694540 !ruby/object:Gem::Requirement
43
40
  none: false
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: "0"
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
48
45
  type: :runtime
49
- version_requirements: *id003
50
- - !ruby/object:Gem::Dependency
51
- name: log4r
52
46
  prerelease: false
53
- requirement: &id004 !ruby/object:Gem::Requirement
47
+ version_requirements: *2152694540
48
+ - !ruby/object:Gem::Dependency
49
+ name: log4r
50
+ requirement: &2157802800 !ruby/object:Gem::Requirement
54
51
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- version: "0"
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
59
56
  type: :runtime
60
- version_requirements: *id004
61
- - !ruby/object:Gem::Dependency
62
- name: rack
63
57
  prerelease: false
64
- requirement: &id005 !ruby/object:Gem::Requirement
58
+ version_requirements: *2157802800
59
+ - !ruby/object:Gem::Dependency
60
+ name: rack
61
+ requirement: &2157802300 !ruby/object:Gem::Requirement
65
62
  none: false
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
69
66
  version: 1.2.2
70
67
  type: :runtime
71
- version_requirements: *id005
72
- - !ruby/object:Gem::Dependency
73
- name: rack-contrib
74
68
  prerelease: false
75
- requirement: &id006 !ruby/object:Gem::Requirement
69
+ version_requirements: *2157802300
70
+ - !ruby/object:Gem::Dependency
71
+ name: rack-contrib
72
+ requirement: &2157801880 !ruby/object:Gem::Requirement
76
73
  none: false
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- version: "0"
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
81
78
  type: :runtime
82
- version_requirements: *id006
83
- - !ruby/object:Gem::Dependency
84
- name: rack-respond_to
85
79
  prerelease: false
86
- requirement: &id007 !ruby/object:Gem::Requirement
80
+ version_requirements: *2157801880
81
+ - !ruby/object:Gem::Dependency
82
+ name: rack-respond_to
83
+ requirement: &2157801420 !ruby/object:Gem::Requirement
87
84
  none: false
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- version: "0"
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
92
89
  type: :runtime
93
- version_requirements: *id007
94
- - !ruby/object:Gem::Dependency
95
- name: async-rack
96
90
  prerelease: false
97
- requirement: &id008 !ruby/object:Gem::Requirement
91
+ version_requirements: *2157801420
92
+ - !ruby/object:Gem::Dependency
93
+ name: async-rack
94
+ requirement: &2157801000 !ruby/object:Gem::Requirement
98
95
  none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: "0"
96
+ requirements:
97
+ - - ! '>='
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
103
100
  type: :runtime
104
- version_requirements: *id008
105
- - !ruby/object:Gem::Dependency
106
- name: multi_json
107
101
  prerelease: false
108
- requirement: &id009 !ruby/object:Gem::Requirement
102
+ version_requirements: *2157801000
103
+ - !ruby/object:Gem::Dependency
104
+ name: multi_json
105
+ requirement: &2157800580 !ruby/object:Gem::Requirement
109
106
  none: false
110
- requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
113
- version: "0"
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
114
111
  type: :runtime
115
- version_requirements: *id009
116
- - !ruby/object:Gem::Dependency
117
- name: http_router
118
112
  prerelease: false
119
- requirement: &id010 !ruby/object:Gem::Requirement
113
+ version_requirements: *2157800580
114
+ - !ruby/object:Gem::Dependency
115
+ name: http_router
116
+ requirement: &2157800080 !ruby/object:Gem::Requirement
120
117
  none: false
121
- requirements:
118
+ requirements:
122
119
  - - ~>
123
- - !ruby/object:Gem::Version
124
- version: 0.8.9
120
+ - !ruby/object:Gem::Version
121
+ version: 0.9.0
125
122
  type: :runtime
126
- version_requirements: *id010
127
- - !ruby/object:Gem::Dependency
128
- name: rake
129
123
  prerelease: false
130
- requirement: &id011 !ruby/object:Gem::Requirement
124
+ version_requirements: *2157800080
125
+ - !ruby/object:Gem::Dependency
126
+ name: rake
127
+ requirement: &2157799580 !ruby/object:Gem::Requirement
131
128
  none: false
132
- requirements:
133
- - - "="
134
- - !ruby/object:Gem::Version
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
135
132
  version: 0.8.7
136
133
  type: :development
137
- version_requirements: *id011
138
- - !ruby/object:Gem::Dependency
139
- name: rspec
140
134
  prerelease: false
141
- requirement: &id012 !ruby/object:Gem::Requirement
135
+ version_requirements: *2157799580
136
+ - !ruby/object:Gem::Dependency
137
+ name: rspec
138
+ requirement: &2157799120 !ruby/object:Gem::Requirement
142
139
  none: false
143
- requirements:
144
- - - ">"
145
- - !ruby/object:Gem::Version
146
- version: "2.0"
140
+ requirements:
141
+ - - ! '>'
142
+ - !ruby/object:Gem::Version
143
+ version: '2.0'
147
144
  type: :development
148
- version_requirements: *id012
149
- - !ruby/object:Gem::Dependency
150
- name: nokogiri
151
145
  prerelease: false
152
- requirement: &id013 !ruby/object:Gem::Requirement
146
+ version_requirements: *2157799120
147
+ - !ruby/object:Gem::Dependency
148
+ name: nokogiri
149
+ requirement: &2157798740 !ruby/object:Gem::Requirement
153
150
  none: false
154
- requirements:
155
- - - ">="
156
- - !ruby/object:Gem::Version
157
- version: "0"
151
+ requirements:
152
+ - - ! '>='
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
158
155
  type: :development
159
- version_requirements: *id013
160
- - !ruby/object:Gem::Dependency
161
- name: em-http-request
162
156
  prerelease: false
163
- requirement: &id014 !ruby/object:Gem::Requirement
157
+ version_requirements: *2157798740
158
+ - !ruby/object:Gem::Dependency
159
+ name: em-http-request
160
+ requirement: &2157798200 !ruby/object:Gem::Requirement
164
161
  none: false
165
- requirements:
166
- - - ">="
167
- - !ruby/object:Gem::Version
168
- version: 1.0.0.beta.1
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: 1.0.0
169
166
  type: :development
170
- version_requirements: *id014
171
- - !ruby/object:Gem::Dependency
172
- name: em-mongo
173
167
  prerelease: false
174
- requirement: &id015 !ruby/object:Gem::Requirement
168
+ version_requirements: *2157798200
169
+ - !ruby/object:Gem::Dependency
170
+ name: em-mongo
171
+ requirement: &2157797700 !ruby/object:Gem::Requirement
175
172
  none: false
176
- requirements:
177
- - - ">="
178
- - !ruby/object:Gem::Version
179
- version: "0"
173
+ requirements:
174
+ - - ~>
175
+ - !ruby/object:Gem::Version
176
+ version: 0.4.0
180
177
  type: :development
181
- version_requirements: *id015
182
- - !ruby/object:Gem::Dependency
183
- name: yajl-ruby
184
178
  prerelease: false
185
- requirement: &id016 !ruby/object:Gem::Requirement
179
+ version_requirements: *2157797700
180
+ - !ruby/object:Gem::Dependency
181
+ name: yajl-ruby
182
+ requirement: &2157797320 !ruby/object:Gem::Requirement
186
183
  none: false
187
- requirements:
188
- - - ">="
189
- - !ruby/object:Gem::Version
190
- version: "0"
184
+ requirements:
185
+ - - ! '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
191
188
  type: :development
192
- version_requirements: *id016
193
- - !ruby/object:Gem::Dependency
194
- name: rack-rewrite
195
189
  prerelease: false
196
- requirement: &id017 !ruby/object:Gem::Requirement
190
+ version_requirements: *2157797320
191
+ - !ruby/object:Gem::Dependency
192
+ name: rack-rewrite
193
+ requirement: &2157796860 !ruby/object:Gem::Requirement
197
194
  none: false
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: "0"
195
+ requirements:
196
+ - - ! '>='
197
+ - !ruby/object:Gem::Version
198
+ version: '0'
202
199
  type: :development
203
- version_requirements: *id017
204
- - !ruby/object:Gem::Dependency
205
- name: multipart_body
206
200
  prerelease: false
207
- requirement: &id018 !ruby/object:Gem::Requirement
201
+ version_requirements: *2157796860
202
+ - !ruby/object:Gem::Dependency
203
+ name: multipart_body
204
+ requirement: &2157796440 !ruby/object:Gem::Requirement
208
205
  none: false
209
- requirements:
210
- - - ">="
211
- - !ruby/object:Gem::Version
212
- version: "0"
206
+ requirements:
207
+ - - ! '>='
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
213
210
  type: :development
214
- version_requirements: *id018
215
- - !ruby/object:Gem::Dependency
216
- name: amqp
217
211
  prerelease: false
218
- requirement: &id019 !ruby/object:Gem::Requirement
212
+ version_requirements: *2157796440
213
+ - !ruby/object:Gem::Dependency
214
+ name: amqp
215
+ requirement: &2157795940 !ruby/object:Gem::Requirement
219
216
  none: false
220
- requirements:
221
- - - ">="
222
- - !ruby/object:Gem::Version
217
+ requirements:
218
+ - - ! '>='
219
+ - !ruby/object:Gem::Version
223
220
  version: 0.7.1
224
221
  type: :development
225
- version_requirements: *id019
226
- - !ruby/object:Gem::Dependency
227
- name: tilt
228
222
  prerelease: false
229
- requirement: &id020 !ruby/object:Gem::Requirement
223
+ version_requirements: *2157795940
224
+ - !ruby/object:Gem::Dependency
225
+ name: tilt
226
+ requirement: &2157795440 !ruby/object:Gem::Requirement
230
227
  none: false
231
- requirements:
232
- - - ">="
233
- - !ruby/object:Gem::Version
228
+ requirements:
229
+ - - ! '>='
230
+ - !ruby/object:Gem::Version
234
231
  version: 1.2.2
235
232
  type: :development
236
- version_requirements: *id020
237
- - !ruby/object:Gem::Dependency
238
- name: haml
239
233
  prerelease: false
240
- requirement: &id021 !ruby/object:Gem::Requirement
234
+ version_requirements: *2157795440
235
+ - !ruby/object:Gem::Dependency
236
+ name: haml
237
+ requirement: &2157811340 !ruby/object:Gem::Requirement
241
238
  none: false
242
- requirements:
243
- - - ">="
244
- - !ruby/object:Gem::Version
239
+ requirements:
240
+ - - ! '>='
241
+ - !ruby/object:Gem::Version
245
242
  version: 3.0.25
246
243
  type: :development
247
- version_requirements: *id021
248
- - !ruby/object:Gem::Dependency
249
- name: yard
250
244
  prerelease: false
251
- requirement: &id022 !ruby/object:Gem::Requirement
245
+ version_requirements: *2157811340
246
+ - !ruby/object:Gem::Dependency
247
+ name: yard
248
+ requirement: &2157810960 !ruby/object:Gem::Requirement
252
249
  none: false
253
- requirements:
254
- - - ">="
255
- - !ruby/object:Gem::Version
256
- version: "0"
250
+ requirements:
251
+ - - ! '>='
252
+ - !ruby/object:Gem::Version
253
+ version: '0'
257
254
  type: :development
258
- version_requirements: *id022
259
- - !ruby/object:Gem::Dependency
260
- name: bluecloth
261
255
  prerelease: false
262
- requirement: &id023 !ruby/object:Gem::Requirement
256
+ version_requirements: *2157810960
257
+ - !ruby/object:Gem::Dependency
258
+ name: bluecloth
259
+ requirement: &2157810500 !ruby/object:Gem::Requirement
263
260
  none: false
264
- requirements:
265
- - - ">="
266
- - !ruby/object:Gem::Version
267
- version: "0"
261
+ requirements:
262
+ - - ! '>='
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
268
265
  type: :development
269
- version_requirements: *id023
270
- description: Framework for writing API servers
271
- email:
266
+ prerelease: false
267
+ version_requirements: *2157810500
268
+ description: Async framework for writing API servers
269
+ email:
272
270
  - dj2@everburning.com
273
271
  - ilya@igvita.com
274
272
  executables: []
275
-
276
273
  extensions: []
277
-
278
274
  extra_rdoc_files: []
279
-
280
- files:
281
- - doc/_index.html
282
- - doc/class_list.html
283
- - doc/css/common.css
284
- - doc/css/full_list.css
285
- - doc/css/style.css
286
- - doc/file.LICENSE.html
287
- - doc/file.README.html
288
- - doc/file_list.html
289
- - doc/frames.html
290
- - doc/Goliath/API.html
291
- - doc/Goliath/Constants.html
292
- - doc/Goliath/Env.html
293
- - doc/Goliath/Plugin/Latency.html
294
- - doc/Goliath/Plugin.html
295
- - doc/Goliath/Rack/AsyncMiddleware.html
296
- - doc/Goliath/Rack/Builder.html
297
- - doc/Goliath/Rack/DefaultMimeType.html
298
- - doc/Goliath/Rack/DefaultResponseFormat.html
299
- - doc/Goliath/Rack/Formatters/HTML.html
300
- - doc/Goliath/Rack/Formatters/JSON.html
301
- - doc/Goliath/Rack/Formatters/XML.html
302
- - doc/Goliath/Rack/Formatters/YAML.html
303
- - doc/Goliath/Rack/Formatters.html
304
- - doc/Goliath/Rack/Heartbeat.html
305
- - doc/Goliath/Rack/JSONP.html
306
- - doc/Goliath/Rack/Params.html
307
- - doc/Goliath/Rack/Render.html
308
- - doc/Goliath/Rack/Templates.html
309
- - doc/Goliath/Rack/Tracer.html
310
- - doc/Goliath/Rack/Validation/BooleanValue.html
311
- - doc/Goliath/Rack/Validation/DefaultParams.html
312
- - doc/Goliath/Rack/Validation/NumericRange.html
313
- - doc/Goliath/Rack/Validation/RequestMethod.html
314
- - doc/Goliath/Rack/Validation/RequiredParam.html
315
- - doc/Goliath/Rack/Validation/RequiredValue.html
316
- - doc/Goliath/Rack/Validation.html
317
- - doc/Goliath/Rack/Validator.html
318
- - doc/Goliath/Rack.html
319
- - doc/Goliath/Runner.html
320
- - doc/Goliath/TestHelper.html
321
- - doc/Goliath/Validation/Error.html
322
- - doc/Goliath/Validation.html
323
- - doc/Goliath.html
324
- - doc/index.html
325
- - doc/js/app.js
326
- - doc/js/full_list.js
327
- - doc/js/jquery.js
328
- - doc/method_list.html
329
- - doc/top-level-namespace.html
275
+ files:
330
276
  - examples/activerecord/config/srv.rb
331
277
  - examples/activerecord/srv.rb
278
+ - examples/api_proxy.rb
332
279
  - examples/async_aroundware_demo.rb
333
280
  - examples/async_upload.rb
334
281
  - examples/auth_and_rate_limit.rb
@@ -343,12 +290,14 @@ files:
343
290
  - examples/config/template.rb
344
291
  - examples/content_stream.rb
345
292
  - examples/custom_server.rb
293
+ - examples/early_abort.rb
346
294
  - examples/echo.rb
347
295
  - examples/env_use_statements.rb
348
- - examples/Gemfile.lock
296
+ - examples/favicon.rb
349
297
  - examples/gziped.rb
350
298
  - examples/hello_world.rb
351
299
  - examples/http_log.rb
300
+ - examples/public/favicon.ico
352
301
  - examples/public/stylesheets/style.css
353
302
  - examples/rack_routes.rb
354
303
  - examples/rasterize/rasterize.js
@@ -366,18 +315,22 @@ files:
366
315
  - examples/views/root.haml
367
316
  - Gemfile
368
317
  - goliath.gemspec
369
- - HISTORY
318
+ - HISTORY.md
370
319
  - lib/goliath/api.rb
371
320
  - lib/goliath/application.rb
372
321
  - lib/goliath/connection.rb
373
322
  - lib/goliath/constants.rb
323
+ - lib/goliath/deprecated/async_aroundware.rb
324
+ - lib/goliath/deprecated/mongo_receiver.rb
325
+ - lib/goliath/deprecated/response_receiver.rb
374
326
  - lib/goliath/env.rb
375
327
  - lib/goliath/goliath.rb
376
328
  - lib/goliath/headers.rb
377
329
  - lib/goliath/http_status_codes.rb
378
330
  - lib/goliath/plugins/latency.rb
379
- - lib/goliath/rack/async_aroundware.rb
380
331
  - lib/goliath/rack/async_middleware.rb
332
+ - lib/goliath/rack/barrier_aroundware.rb
333
+ - lib/goliath/rack/barrier_aroundware_factory.rb
381
334
  - lib/goliath/rack/builder.rb
382
335
  - lib/goliath/rack/default_mime_type.rb
383
336
  - lib/goliath/rack/default_response_format.rb
@@ -391,6 +344,8 @@ files:
391
344
  - lib/goliath/rack/jsonp.rb
392
345
  - lib/goliath/rack/params.rb
393
346
  - lib/goliath/rack/render.rb
347
+ - lib/goliath/rack/simple_aroundware.rb
348
+ - lib/goliath/rack/simple_aroundware_factory.rb
394
349
  - lib/goliath/rack/templates.rb
395
350
  - lib/goliath/rack/tracer.rb
396
351
  - lib/goliath/rack/validation/boolean_value.rb
@@ -406,8 +361,6 @@ files:
406
361
  - lib/goliath/response.rb
407
362
  - lib/goliath/runner.rb
408
363
  - lib/goliath/server.rb
409
- - lib/goliath/synchrony/mongo_receiver.rb
410
- - lib/goliath/synchrony/response_receiver.rb
411
364
  - lib/goliath/test_helper.rb
412
365
  - lib/goliath/validation/error.rb
413
366
  - lib/goliath/validation/standard_http_errors.rb
@@ -415,10 +368,13 @@ files:
415
368
  - lib/goliath/version.rb
416
369
  - lib/goliath.rb
417
370
  - LICENSE
418
- - pkg/goliath-0.9.1.gem
371
+ - pkg/data.tar.gz
372
+ - pkg/goliath-0.9.3.gem
373
+ - pkg/metadata
419
374
  - Rakefile
420
375
  - README.md
421
376
  - spec/integration/async_request_processing.rb
377
+ - spec/integration/early_abort_spec.rb
422
378
  - spec/integration/echo_spec.rb
423
379
  - spec/integration/empty_body_spec.rb
424
380
  - spec/integration/http_log_spec.rb
@@ -458,36 +414,33 @@ files:
458
414
  - .gitignore
459
415
  - .rspec
460
416
  - .yardopts
461
- has_rdoc: true
462
- homepage: http://labs.postrank.com/
417
+ homepage: http://goliath.io/
463
418
  licenses: []
464
-
465
419
  post_install_message:
466
420
  rdoc_options: []
467
-
468
- require_paths:
421
+ require_paths:
469
422
  - lib
470
- required_ruby_version: !ruby/object:Gem::Requirement
423
+ required_ruby_version: !ruby/object:Gem::Requirement
471
424
  none: false
472
- requirements:
473
- - - ">="
474
- - !ruby/object:Gem::Version
475
- version: 1.9.2
476
- required_rubygems_version: !ruby/object:Gem::Requirement
425
+ requirements:
426
+ - - ! '>='
427
+ - !ruby/object:Gem::Version
428
+ version: '0'
429
+ required_rubygems_version: !ruby/object:Gem::Requirement
477
430
  none: false
478
- requirements:
479
- - - ">="
480
- - !ruby/object:Gem::Version
481
- version: "0"
431
+ requirements:
432
+ - - ! '>='
433
+ - !ruby/object:Gem::Version
434
+ version: '0'
482
435
  requirements: []
483
-
484
436
  rubyforge_project:
485
- rubygems_version: 1.6.2
437
+ rubygems_version: 1.8.5
486
438
  signing_key:
487
439
  specification_version: 3
488
- summary: Framework for writing API servers
489
- test_files:
440
+ summary: Async framework for writing API servers
441
+ test_files:
490
442
  - spec/integration/async_request_processing.rb
443
+ - spec/integration/early_abort_spec.rb
491
444
  - spec/integration/echo_spec.rb
492
445
  - spec/integration/empty_body_spec.rb
493
446
  - spec/integration/http_log_spec.rb