em-http-request 1.1.0 → 1.1.1

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

Potentially problematic release.


This version of em-http-request might be problematic. Click here for more details.

@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a80a1bc2ca4e1dda7527f249949cb056b0beb886
4
+ data.tar.gz: 4819cb821fa74543d537416994fbd65b0e0f676c
5
+ SHA512:
6
+ metadata.gz: b7c257493787ea81e1c1b26287aa88e4e98eba7278fa4734bdf4efe136ef1184a9f7d464dc821f35775535c649204b2331a2518bdc02e92167e062e8d5f74919
7
+ data.tar.gz: 1e3f32f26b6bee0e85a11318e1cce1df5fbb9a1c5122e04e9d0610b18e2ce82ec92e04d33482d8981964b33fa36fb61090e8915be3027a86608166997b9549a3
data/Gemfile CHANGED
@@ -1,14 +1,14 @@
1
- source "http://rubygems.org"
1
+ source 'http://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
5
  group :benchmark do
6
+ gem 'curb'
7
+ gem 'excon'
6
8
  gem 'httparty'
7
9
  gem 'rest-client'
8
- gem 'tach', '0.0.8'
9
- gem 'typhoeus'
10
10
  gem 'sinatra'
11
11
  gem 'streamly_ffi'
12
- gem 'curb'
13
- gem 'excon'
14
- end
12
+ gem 'tach', '>= 0.0.8'
13
+ gem 'typhoeus'
14
+ end
data/Rakefile CHANGED
@@ -7,4 +7,4 @@ desc "Run all RSpec tests"
7
7
  RSpec::Core::RakeTask.new(:spec)
8
8
 
9
9
  task :default => :spec
10
- task :test => [:spec]
10
+ task :test => [:spec]
@@ -1,33 +1,33 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "em-http/version"
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'em-http/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
- s.name = "em-http-request"
6
+ s.name = 'em-http-request'
7
7
  s.version = EventMachine::HttpRequest::VERSION
8
8
 
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.authors = ["Ilya Grigorik"]
11
- s.email = ["ilya@igvita.com"]
12
- s.homepage = "http://github.com/igrigorik/em-http-request"
13
- s.summary = "EventMachine based, async HTTP Request client"
11
+ s.email = ['ilya@igvita.com']
12
+ s.homepage = 'http://github.com/igrigorik/em-http-request'
13
+ s.summary = 'EventMachine based, async HTTP Request client'
14
14
  s.description = s.summary
15
- s.rubyforge_project = "em-http-request"
15
+ s.rubyforge_project = 'em-http-request'
16
16
 
17
- s.add_dependency "eventmachine", ">= 1.0.3"
18
- s.add_dependency "addressable", ">= 2.3.4"
19
- s.add_dependency "http_parser.rb", ">= 0.6.0.beta.2"
20
- s.add_dependency "em-socksify", ">= 0.3"
21
- s.add_dependency "cookiejar"
17
+ s.add_dependency 'addressable', '>= 2.3.4'
18
+ s.add_dependency 'cookiejar'
19
+ s.add_dependency 'em-socksify', '>= 0.3'
20
+ s.add_dependency 'eventmachine', '>= 1.0.3'
21
+ s.add_dependency 'http_parser.rb', '>= 0.6.0.beta.2'
22
22
 
23
- s.add_development_dependency "rspec"
24
- s.add_development_dependency "rake"
25
- s.add_development_dependency "rack"
26
- s.add_development_dependency "yajl-ruby"
27
- s.add_development_dependency "mongrel", "~> 1.2.0.pre2"
23
+ s.add_development_dependency 'mongrel', '~> 1.2.0.pre2'
24
+ s.add_development_dependency 'multi_json'
25
+ s.add_development_dependency 'rack'
26
+ s.add_development_dependency 'rake'
27
+ s.add_development_dependency 'rspec'
28
28
 
29
29
  s.files = `git ls-files`.split("\n")
30
30
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
31
31
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
32
- s.require_paths = ["lib"]
32
+ s.require_paths = ['lib']
33
33
  end
@@ -27,13 +27,13 @@ EventMachine.run do
27
27
  Fiber.new{
28
28
 
29
29
  puts "Setting up HTTP request #1"
30
- data = async_fetch('http://0.0.0.0/')
30
+ data = async_fetch('http://0.0.0.0/')
31
31
  puts "Fetched page #1: #{data.response_header.status}"
32
32
 
33
33
  puts "Setting up HTTP request #2"
34
34
  data = async_fetch('http://www.yahoo.com/')
35
35
  puts "Fetched page #2: #{data.response_header.status}"
36
-
36
+
37
37
  puts "Setting up HTTP request #3"
38
38
  data = async_fetch('http://non-existing.domain/')
39
39
  puts "Fetched page #3: #{data.response_header.status}"
@@ -3,4 +3,4 @@ if RUBY_VERSION <= "1.8.6"
3
3
  class String
4
4
  def bytesize; self.size; end
5
5
  end
6
- end
6
+ end
@@ -54,4 +54,4 @@ module EventMachine
54
54
  510 => 'Not Extended'
55
55
  }
56
56
  end
57
- end
57
+ end
@@ -1,11 +1,11 @@
1
- require 'yajl'
1
+ require 'multi_json'
2
2
 
3
3
  module EventMachine
4
4
  module Middleware
5
5
  class JSONResponse
6
6
  def response(resp)
7
7
  begin
8
- body = Yajl::Parser.parse(resp.response)
8
+ body = MultiJson.load(resp.response)
9
9
  resp.response = body
10
10
  rescue Exception => e
11
11
  end
@@ -1,5 +1,5 @@
1
- module EventMachine
2
- class HttpRequest
3
- VERSION = "1.1.0"
4
- end
5
- end
1
+ module EventMachine
2
+ class HttpRequest
3
+ VERSION = "1.1.1"
4
+ end
5
+ end
@@ -3,7 +3,7 @@ require 'bundler/setup'
3
3
 
4
4
  require 'em-http'
5
5
  require 'em-http/middleware/oauth2'
6
- require 'yajl'
6
+ require 'multi_json'
7
7
 
8
8
  require 'stallion'
9
9
  require 'stub_server'
@@ -117,11 +117,11 @@ describe EventMachine::HttpRequest do
117
117
  context "jsonify" do
118
118
  class JSONify
119
119
  def request(client, head, body)
120
- [head, Yajl::Encoder.encode(body)]
120
+ [head, MultiJson.dump(body)]
121
121
  end
122
122
 
123
123
  def response(resp)
124
- resp.response = Yajl::Parser.parse(resp.response)
124
+ resp.response = MultiJson.load(resp.response)
125
125
  end
126
126
  end
127
127
 
@@ -276,11 +276,11 @@ Thread.new do
276
276
 
277
277
  # Take the initial line from the upstream response
278
278
  session.write client.gets
279
-
279
+
280
280
  if proxy
281
281
  session.write "X-Proxy-Auth: #{proxy}\r\n"
282
282
  end
283
-
283
+
284
284
  # What (absolute) uri was requested? Send it back in a header
285
285
  session.write "X-The-Requested-URI: #{destination}\r\n"
286
286
 
metadata CHANGED
@@ -1,176 +1,155 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em-http-request
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
5
- prerelease:
4
+ version: 1.1.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ilya Grigorik
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-23 00:00:00.000000000 Z
11
+ date: 2013-09-24 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: eventmachine
14
+ name: addressable
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
- version: 1.0.3
19
+ version: 2.3.4
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
- version: 1.0.3
26
+ version: 2.3.4
30
27
  - !ruby/object:Gem::Dependency
31
- name: addressable
28
+ name: cookiejar
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
- version: 2.3.4
33
+ version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
- version: 2.3.4
40
+ version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
- name: http_parser.rb
42
+ name: em-socksify
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
- version: 0.6.0.beta.2
47
+ version: '0.3'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
- version: 0.6.0.beta.2
54
+ version: '0.3'
62
55
  - !ruby/object:Gem::Dependency
63
- name: em-socksify
56
+ name: eventmachine
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
- version: '0.3'
61
+ version: 1.0.3
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
- version: '0.3'
68
+ version: 1.0.3
78
69
  - !ruby/object:Gem::Dependency
79
- name: cookiejar
70
+ name: http_parser.rb
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
- version: '0'
75
+ version: 0.6.0.beta.2
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
- version: '0'
82
+ version: 0.6.0.beta.2
94
83
  - !ruby/object:Gem::Dependency
95
- name: rspec
84
+ name: mongrel
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ~>
100
88
  - !ruby/object:Gem::Version
101
- version: '0'
89
+ version: 1.2.0.pre2
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ~>
108
95
  - !ruby/object:Gem::Version
109
- version: '0'
96
+ version: 1.2.0.pre2
110
97
  - !ruby/object:Gem::Dependency
111
- name: rake
98
+ name: multi_json
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: rack
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - '>='
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ! '>='
122
+ - - '>='
140
123
  - !ruby/object:Gem::Version
141
124
  version: '0'
142
125
  - !ruby/object:Gem::Dependency
143
- name: yajl-ruby
126
+ name: rake
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
- - - ! '>='
129
+ - - '>='
148
130
  - !ruby/object:Gem::Version
149
131
  version: '0'
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
- - - ! '>='
136
+ - - '>='
156
137
  - !ruby/object:Gem::Version
157
138
  version: '0'
158
139
  - !ruby/object:Gem::Dependency
159
- name: mongrel
140
+ name: rspec
160
141
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
142
  requirements:
163
- - - ~>
143
+ - - '>='
164
144
  - !ruby/object:Gem::Version
165
- version: 1.2.0.pre2
145
+ version: '0'
166
146
  type: :development
167
147
  prerelease: false
168
148
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
149
  requirements:
171
- - - ~>
150
+ - - '>='
172
151
  - !ruby/object:Gem::Version
173
- version: 1.2.0.pre2
152
+ version: '0'
174
153
  description: EventMachine based, async HTTP Request client
175
154
  email:
176
155
  - ilya@igvita.com
@@ -239,27 +218,26 @@ files:
239
218
  - spec/stub_server.rb
240
219
  homepage: http://github.com/igrigorik/em-http-request
241
220
  licenses: []
221
+ metadata: {}
242
222
  post_install_message:
243
223
  rdoc_options: []
244
224
  require_paths:
245
225
  - lib
246
226
  required_ruby_version: !ruby/object:Gem::Requirement
247
- none: false
248
227
  requirements:
249
- - - ! '>='
228
+ - - '>='
250
229
  - !ruby/object:Gem::Version
251
230
  version: '0'
252
231
  required_rubygems_version: !ruby/object:Gem::Requirement
253
- none: false
254
232
  requirements:
255
- - - ! '>='
233
+ - - '>='
256
234
  - !ruby/object:Gem::Version
257
235
  version: '0'
258
236
  requirements: []
259
237
  rubyforge_project: em-http-request
260
- rubygems_version: 1.8.24
238
+ rubygems_version: 2.0.6
261
239
  signing_key:
262
- specification_version: 3
240
+ specification_version: 4
263
241
  summary: EventMachine based, async HTTP Request client
264
242
  test_files:
265
243
  - spec/client_fiber_spec.rb