net-http-spdy 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/net/http/spdy.rb +6 -7
- data/lib/net/http/spdy/version.rb +1 -1
- data/net-http-spdy.gemspec +2 -2
- data/test/test_access_to_web.rb +8 -0
- metadata +13 -13
data/lib/net/http/spdy.rb
CHANGED
@@ -1,13 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require "bundler"
|
3
|
-
Bundler.require(:default)
|
4
2
|
require 'net/http'
|
5
3
|
$: << File.join(File.dirname(__FILE__), "../../../vender/spdy/lib/")
|
6
4
|
require 'spdy'
|
7
|
-
require 'net/http/spdy/stream'
|
8
|
-
require 'net/http/spdy/stream_session'
|
9
|
-
require 'net/http/spdy/generic_request'
|
10
|
-
require 'net/http/spdy/response'
|
11
5
|
require 'openssl'
|
12
6
|
|
13
7
|
class Net::HTTP::SPDY < Net::HTTP
|
@@ -52,7 +46,7 @@ class Net::HTTP::SPDY < Net::HTTP
|
|
52
46
|
r.uri = req.uri
|
53
47
|
|
54
48
|
r.reading_body(stream, req.response_body_permitted?) {
|
55
|
-
yield
|
49
|
+
yield r if block_given?
|
56
50
|
}
|
57
51
|
r
|
58
52
|
}
|
@@ -91,3 +85,8 @@ class Net::HTTP::SPDY < Net::HTTP
|
|
91
85
|
return false
|
92
86
|
end
|
93
87
|
end
|
88
|
+
|
89
|
+
require 'net/http/spdy/stream'
|
90
|
+
require 'net/http/spdy/stream_session'
|
91
|
+
require 'net/http/spdy/generic_request'
|
92
|
+
require 'net/http/spdy/response'
|
data/net-http-spdy.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Narihiro Nakamura"]
|
10
10
|
s.email = ["authornari@gmail.com"]
|
11
|
-
s.homepage = "https://github.com/authorNari/spdy"
|
12
|
-
s.summary = "A SPDY HTTP client implementation
|
11
|
+
s.homepage = "https://github.com/authorNari/net-http-spdy"
|
12
|
+
s.summary = "A SPDY HTTP client implementation with extended Net:HTTP"
|
13
13
|
s.description = s.summary
|
14
14
|
|
15
15
|
s.files = `git ls-files`.split($\)
|
data/test/test_access_to_web.rb
CHANGED
@@ -11,6 +11,14 @@ class TestAccessToWeb < Test::Unit::TestCase
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
def test_get_google_simple
|
15
|
+
uri = URI('https://www.google.com/')
|
16
|
+
Net::HTTP::SPDY.start(uri.host, uri.port, use_ssl: true) do |http|
|
17
|
+
res = http.get("/")
|
18
|
+
assert_include ["200", "302"], res.code
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
14
22
|
def test_get_world_flags_parallel
|
15
23
|
flag_uris = %w(
|
16
24
|
images_sm/ad_flag.png images_sm/ae_flag.png
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-http-spdy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,14 +9,14 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bindata
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
30
|
- !ruby/object:Gem::Dependency
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ">="
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '0'
|
38
38
|
type: :runtime
|
@@ -40,17 +40,17 @@ dependencies:
|
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
|
-
description: A SPDY HTTP client implementation
|
46
|
+
description: A SPDY HTTP client implementation with extended Net:HTTP
|
47
47
|
email:
|
48
48
|
- authornari@gmail.com
|
49
49
|
executables: []
|
50
50
|
extensions: []
|
51
51
|
extra_rdoc_files: []
|
52
52
|
files:
|
53
|
-
- .gitignore
|
53
|
+
- ".gitignore"
|
54
54
|
- Gemfile
|
55
55
|
- README.rdoc
|
56
56
|
- Rakefile
|
@@ -72,7 +72,7 @@ files:
|
|
72
72
|
- vender/spdy/lib/spdy/parser.rb
|
73
73
|
- vender/spdy/lib/spdy/protocol.rb
|
74
74
|
- vender/spdy/lib/spdy/version.rb
|
75
|
-
homepage: https://github.com/authorNari/spdy
|
75
|
+
homepage: https://github.com/authorNari/net-http-spdy
|
76
76
|
licenses: []
|
77
77
|
post_install_message:
|
78
78
|
rdoc_options: []
|
@@ -81,21 +81,21 @@ require_paths:
|
|
81
81
|
required_ruby_version: !ruby/object:Gem::Requirement
|
82
82
|
none: false
|
83
83
|
requirements:
|
84
|
-
- -
|
84
|
+
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
88
|
none: false
|
89
89
|
requirements:
|
90
|
-
- -
|
90
|
+
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 1.8.
|
95
|
+
rubygems_version: 1.8.24
|
96
96
|
signing_key:
|
97
97
|
specification_version: 3
|
98
|
-
summary: A SPDY HTTP client implementation
|
98
|
+
summary: A SPDY HTTP client implementation with extended Net:HTTP
|
99
99
|
test_files:
|
100
100
|
- test/run-test.rb
|
101
101
|
- test/test_access_to_web.rb
|