em-net-http 0.2.0 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/Rakefile +3 -0
- data/VERSION +1 -1
- data/bin/edit_json.rb +14 -0
- data/bin/jeweler +14 -0
- data/bin/prettify_json.rb +14 -0
- data/bin/rubyforge +14 -0
- data/em-net-http.gemspec +12 -3
- data/lib/em-net-http.rb +3 -1
- metadata +65 -14
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -10,6 +10,9 @@ begin
|
|
10
10
|
gem.email = "james@netlagoon.com"
|
11
11
|
gem.homepage = "http://github.com/jfairbairn/em-net-http"
|
12
12
|
gem.authors = ["James Fairbairn"]
|
13
|
+
gem.add_dependency 'eventmachine', '>= 0.12.10'
|
14
|
+
gem.add_dependency 'addressable'
|
15
|
+
gem.add_dependency 'em-http-request', '>= 0.2.10'
|
13
16
|
gem.add_development_dependency "rspec", ">= 1.2.9"
|
14
17
|
gem.add_development_dependency "mimic", ">= 0.3.0"
|
15
18
|
gem.add_development_dependency 'weary'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/bin/edit_json.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'edit_json.rb' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", __FILE__)
|
10
|
+
|
11
|
+
require 'rubygems'
|
12
|
+
require 'bundler/setup'
|
13
|
+
|
14
|
+
load Gem.bin_path('json_pure', 'edit_json.rb')
|
data/bin/jeweler
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'jeweler' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", __FILE__)
|
10
|
+
|
11
|
+
require 'rubygems'
|
12
|
+
require 'bundler/setup'
|
13
|
+
|
14
|
+
load Gem.bin_path('jeweler', 'jeweler')
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'prettify_json.rb' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", __FILE__)
|
10
|
+
|
11
|
+
require 'rubygems'
|
12
|
+
require 'bundler/setup'
|
13
|
+
|
14
|
+
load Gem.bin_path('json_pure', 'prettify_json.rb')
|
data/bin/rubyforge
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rubyforge' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", __FILE__)
|
10
|
+
|
11
|
+
require 'rubygems'
|
12
|
+
require 'bundler/setup'
|
13
|
+
|
14
|
+
load Gem.bin_path('rubyforge', 'rubyforge')
|
data/em-net-http.gemspec
CHANGED
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{em-net-http}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["James Fairbairn"]
|
12
|
-
s.date = %q{2010-08-
|
12
|
+
s.date = %q{2010-08-30}
|
13
13
|
s.description = %q{Monkeypatching Net::HTTP to use em-http-request under the hood.}
|
14
14
|
s.email = %q{james@netlagoon.com}
|
15
|
-
s.executables = ["autospec", "htmldiff", "ldiff", "oauth", "rackup", "rake", "spec", "tumblr"]
|
15
|
+
s.executables = ["autospec", "edit_json.rb", "htmldiff", "jeweler", "ldiff", "oauth", "prettify_json.rb", "rackup", "rake", "rubyforge", "spec", "tumblr"]
|
16
16
|
s.extra_rdoc_files = [
|
17
17
|
"LICENSE",
|
18
18
|
"README.md"
|
@@ -49,12 +49,18 @@ Gem::Specification.new do |s|
|
|
49
49
|
s.specification_version = 3
|
50
50
|
|
51
51
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
52
|
+
s.add_runtime_dependency(%q<eventmachine>, [">= 0.12.10"])
|
53
|
+
s.add_runtime_dependency(%q<addressable>, [">= 0"])
|
54
|
+
s.add_runtime_dependency(%q<em-http-request>, [">= 0.2.10"])
|
52
55
|
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
53
56
|
s.add_development_dependency(%q<mimic>, [">= 0.3.0"])
|
54
57
|
s.add_development_dependency(%q<weary>, [">= 0"])
|
55
58
|
s.add_development_dependency(%q<right_aws>, [">= 0"])
|
56
59
|
s.add_development_dependency(%q<tumblr-rb>, [">= 0"])
|
57
60
|
else
|
61
|
+
s.add_dependency(%q<eventmachine>, [">= 0.12.10"])
|
62
|
+
s.add_dependency(%q<addressable>, [">= 0"])
|
63
|
+
s.add_dependency(%q<em-http-request>, [">= 0.2.10"])
|
58
64
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
59
65
|
s.add_dependency(%q<mimic>, [">= 0.3.0"])
|
60
66
|
s.add_dependency(%q<weary>, [">= 0"])
|
@@ -62,6 +68,9 @@ Gem::Specification.new do |s|
|
|
62
68
|
s.add_dependency(%q<tumblr-rb>, [">= 0"])
|
63
69
|
end
|
64
70
|
else
|
71
|
+
s.add_dependency(%q<eventmachine>, [">= 0.12.10"])
|
72
|
+
s.add_dependency(%q<addressable>, [">= 0"])
|
73
|
+
s.add_dependency(%q<em-http-request>, [">= 0.2.10"])
|
65
74
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
66
75
|
s.add_dependency(%q<mimic>, [">= 0.3.0"])
|
67
76
|
s.add_dependency(%q<weary>, [">= 0"])
|
data/lib/em-net-http.rb
CHANGED
@@ -92,6 +92,7 @@ module Net
|
|
92
92
|
sslopts[:private_key_file] = key if key
|
93
93
|
sslopts[:cert_chain_file] = ca_file if ca_file
|
94
94
|
end
|
95
|
+
opts[:timeout] = self.read_timeout
|
95
96
|
|
96
97
|
headers = opts[:head] = {}
|
97
98
|
req.each do |k, v|
|
@@ -117,8 +118,9 @@ module Net
|
|
117
118
|
end
|
118
119
|
|
119
120
|
httpreq.callback &convert_em_http_response
|
120
|
-
httpreq.errback
|
121
|
+
httpreq.errback {|err|f.resume(:error)}
|
121
122
|
res = Fiber.yield
|
123
|
+
raise 'EM::HttpRequest error - request timed out?' if res == :error
|
122
124
|
yield res if block_given?
|
123
125
|
res
|
124
126
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 3
|
9
|
+
version: 0.2.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- James Fairbairn
|
@@ -14,12 +14,55 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-
|
17
|
+
date: 2010-08-30 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
name:
|
21
|
+
name: eventmachine
|
22
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 12
|
30
|
+
- 10
|
31
|
+
version: 0.12.10
|
32
|
+
type: :runtime
|
33
|
+
prerelease: false
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: addressable
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
version: "0"
|
45
|
+
type: :runtime
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: em-http-request
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
- 2
|
58
|
+
- 10
|
59
|
+
version: 0.2.10
|
60
|
+
type: :runtime
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: rspec
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
23
66
|
none: false
|
24
67
|
requirements:
|
25
68
|
- - ">="
|
@@ -31,10 +74,10 @@ dependencies:
|
|
31
74
|
version: 1.2.9
|
32
75
|
type: :development
|
33
76
|
prerelease: false
|
34
|
-
version_requirements: *
|
77
|
+
version_requirements: *id004
|
35
78
|
- !ruby/object:Gem::Dependency
|
36
79
|
name: mimic
|
37
|
-
requirement: &
|
80
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
38
81
|
none: false
|
39
82
|
requirements:
|
40
83
|
- - ">="
|
@@ -46,10 +89,10 @@ dependencies:
|
|
46
89
|
version: 0.3.0
|
47
90
|
type: :development
|
48
91
|
prerelease: false
|
49
|
-
version_requirements: *
|
92
|
+
version_requirements: *id005
|
50
93
|
- !ruby/object:Gem::Dependency
|
51
94
|
name: weary
|
52
|
-
requirement: &
|
95
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
53
96
|
none: false
|
54
97
|
requirements:
|
55
98
|
- - ">="
|
@@ -59,10 +102,10 @@ dependencies:
|
|
59
102
|
version: "0"
|
60
103
|
type: :development
|
61
104
|
prerelease: false
|
62
|
-
version_requirements: *
|
105
|
+
version_requirements: *id006
|
63
106
|
- !ruby/object:Gem::Dependency
|
64
107
|
name: right_aws
|
65
|
-
requirement: &
|
108
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
66
109
|
none: false
|
67
110
|
requirements:
|
68
111
|
- - ">="
|
@@ -72,10 +115,10 @@ dependencies:
|
|
72
115
|
version: "0"
|
73
116
|
type: :development
|
74
117
|
prerelease: false
|
75
|
-
version_requirements: *
|
118
|
+
version_requirements: *id007
|
76
119
|
- !ruby/object:Gem::Dependency
|
77
120
|
name: tumblr-rb
|
78
|
-
requirement: &
|
121
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
79
122
|
none: false
|
80
123
|
requirements:
|
81
124
|
- - ">="
|
@@ -85,16 +128,20 @@ dependencies:
|
|
85
128
|
version: "0"
|
86
129
|
type: :development
|
87
130
|
prerelease: false
|
88
|
-
version_requirements: *
|
131
|
+
version_requirements: *id008
|
89
132
|
description: Monkeypatching Net::HTTP to use em-http-request under the hood.
|
90
133
|
email: james@netlagoon.com
|
91
134
|
executables:
|
92
135
|
- autospec
|
136
|
+
- edit_json.rb
|
93
137
|
- htmldiff
|
138
|
+
- jeweler
|
94
139
|
- ldiff
|
95
140
|
- oauth
|
141
|
+
- prettify_json.rb
|
96
142
|
- rackup
|
97
143
|
- rake
|
144
|
+
- rubyforge
|
98
145
|
- spec
|
99
146
|
- tumblr
|
100
147
|
extensions: []
|
@@ -119,11 +166,15 @@ files:
|
|
119
166
|
- spec/spec.opts
|
120
167
|
- spec/spec_helper.rb
|
121
168
|
- bin/autospec
|
169
|
+
- bin/edit_json.rb
|
122
170
|
- bin/htmldiff
|
171
|
+
- bin/jeweler
|
123
172
|
- bin/ldiff
|
124
173
|
- bin/oauth
|
174
|
+
- bin/prettify_json.rb
|
125
175
|
- bin/rackup
|
126
176
|
- bin/rake
|
177
|
+
- bin/rubyforge
|
127
178
|
- bin/spec
|
128
179
|
- bin/tumblr
|
129
180
|
has_rdoc: true
|
@@ -140,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
140
191
|
requirements:
|
141
192
|
- - ">="
|
142
193
|
- !ruby/object:Gem::Version
|
143
|
-
hash:
|
194
|
+
hash: -2810802488439209821
|
144
195
|
segments:
|
145
196
|
- 0
|
146
197
|
version: "0"
|