astro-em-http-request 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -93,9 +93,9 @@ begin
93
93
  gemspec.homepage = "http://github.com/igrigorik/em-http-request"
94
94
  gemspec.authors = ["Ilya Grigorik", "Stephan Maka", "Julien Genestoux"]
95
95
  gemspec.extensions = ["ext/buffer/extconf.rb" , "ext/http11_client/extconf.rb"]
96
- gemspec.add_dependency('eventmachine', '>= 0.12.2')
96
+ gemspec.add_dependency('eventmachine', '>= 0.12.9')
97
97
  gemspec.add_dependency('addressable', '>= 2.0.0')
98
- gemspec.rubyforge_project = "em-http-request"
98
+ gemspec.rubyforge_project = "astro-em-http-request"
99
99
  gemspec.files = FileList[`git ls-files`.split]
100
100
  end
101
101
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
@@ -0,0 +1,90 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{astro-em-http-request}
8
+ s.version = "0.2.7"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Ilya Grigorik", "Stephan Maka", "Julien Genestoux"]
12
+ s.date = %q{2010-02-28}
13
+ s.description = %q{EventMachine based, async HTTP Request interface}
14
+ s.email = %q{ilya@igvita.com}
15
+ s.extensions = ["ext/buffer/extconf.rb", "ext/http11_client/extconf.rb"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE",
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "astro-em-http-request.gemspec",
27
+ "examples/fetch.rb",
28
+ "examples/fibered-http.rb",
29
+ "examples/oauth-tweet.rb",
30
+ "ext/buffer/em_buffer.c",
31
+ "ext/buffer/extconf.rb",
32
+ "ext/http11_client/ext_help.h",
33
+ "ext/http11_client/extconf.rb",
34
+ "ext/http11_client/http11_client.c",
35
+ "ext/http11_client/http11_parser.c",
36
+ "ext/http11_client/http11_parser.h",
37
+ "ext/http11_client/http11_parser.rl",
38
+ "lib/em-http.rb",
39
+ "lib/em-http/client.rb",
40
+ "lib/em-http/core_ext/hash.rb",
41
+ "lib/em-http/decoders.rb",
42
+ "lib/em-http/mock.rb",
43
+ "lib/em-http/multi.rb",
44
+ "lib/em-http/request.rb",
45
+ "spec/fixtures/google.ca",
46
+ "spec/hash_spec.rb",
47
+ "spec/helper.rb",
48
+ "spec/mock_spec.rb",
49
+ "spec/multi_spec.rb",
50
+ "spec/request_spec.rb",
51
+ "spec/stallion.rb",
52
+ "spec/stub_server.rb"
53
+ ]
54
+ s.homepage = %q{http://github.com/igrigorik/em-http-request}
55
+ s.rdoc_options = ["--charset=UTF-8"]
56
+ s.require_paths = ["lib"]
57
+ s.rubyforge_project = %q{astro-em-http-request}
58
+ s.rubygems_version = %q{1.3.5}
59
+ s.summary = %q{EventMachine based, async HTTP Request interface}
60
+ s.test_files = [
61
+ "spec/hash_spec.rb",
62
+ "spec/helper.rb",
63
+ "spec/mock_spec.rb",
64
+ "spec/multi_spec.rb",
65
+ "spec/request_spec.rb",
66
+ "spec/stallion.rb",
67
+ "spec/stub_server.rb",
68
+ "test/another_test.rb",
69
+ "examples/fetch.rb",
70
+ "examples/fibered-http.rb",
71
+ "examples/oauth-tweet.rb"
72
+ ]
73
+
74
+ if s.respond_to? :specification_version then
75
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
76
+ s.specification_version = 3
77
+
78
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
79
+ s.add_runtime_dependency(%q<eventmachine>, [">= 0.12.9"])
80
+ s.add_runtime_dependency(%q<addressable>, [">= 2.0.0"])
81
+ else
82
+ s.add_dependency(%q<eventmachine>, [">= 0.12.9"])
83
+ s.add_dependency(%q<addressable>, [">= 2.0.0"])
84
+ end
85
+ else
86
+ s.add_dependency(%q<eventmachine>, [">= 0.12.9"])
87
+ s.add_dependency(%q<addressable>, [">= 2.0.0"])
88
+ end
89
+ end
90
+
@@ -216,7 +216,7 @@ module EventMachine
216
216
  # exchange
217
217
  else
218
218
  if @options[:max_connection_duration]
219
- EM.add_timer(@options[:max_connection_duration]) {
219
+ @max_duration_timer = EM.add_timer(@options[:max_connection_duration]) {
220
220
  @aborted = true
221
221
  on_error("Max Connection Duration Exceeded (#{@options[:max_connection_duration]}s.)")
222
222
  }
@@ -376,6 +376,7 @@ module EventMachine
376
376
  end
377
377
 
378
378
  def unbind
379
+ @max_duration_timer.cancel if @max_duration_timer
379
380
  if @state == :finished || (
380
381
  @state == :body &&
381
382
  @bytes_remaining.nil? &&
@@ -0,0 +1,21 @@
1
+ require 'test/helper'
2
+
3
+ describe EventMachine::HttpRequest do
4
+
5
+ def failed
6
+ EventMachine.stop
7
+ fail
8
+ end
9
+
10
+ it "should return and error if the response side exceeds the :max_bytes option" do
11
+ EventMachine.run {
12
+ http = EventMachine::HttpRequest.new("http://updates.sixapart.com/atom-stream.xml").get(:timeout => 10)
13
+ http.errback { |http|
14
+ http.errors.should match /Max Connection Duration Exceeded/
15
+ EventMachine.stop
16
+ }
17
+ http.callback { failed }
18
+ }
19
+ end
20
+
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: astro-em-http-request
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Grigorik
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2010-01-20 00:00:00 +01:00
14
+ date: 2010-02-28 00:00:00 -08:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -22,7 +22,7 @@ dependencies:
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: 0.12.2
25
+ version: 0.12.9
26
26
  version:
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: addressable
@@ -50,6 +50,7 @@ files:
50
50
  - README.rdoc
51
51
  - Rakefile
52
52
  - VERSION
53
+ - astro-em-http-request.gemspec
53
54
  - examples/fetch.rb
54
55
  - examples/fibered-http.rb
55
56
  - examples/oauth-tweet.rb
@@ -99,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
100
  version:
100
101
  requirements: []
101
102
 
102
- rubyforge_project: em-http-request
103
+ rubyforge_project: astro-em-http-request
103
104
  rubygems_version: 1.3.5
104
105
  signing_key:
105
106
  specification_version: 3
@@ -110,8 +111,9 @@ test_files:
110
111
  - spec/mock_spec.rb
111
112
  - spec/multi_spec.rb
112
113
  - spec/request_spec.rb
113
- - spec/stub_server.rb
114
114
  - spec/stallion.rb
115
- - examples/fibered-http.rb
115
+ - spec/stub_server.rb
116
+ - test/another_test.rb
116
117
  - examples/fetch.rb
118
+ - examples/fibered-http.rb
117
119
  - examples/oauth-tweet.rb