http2 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/VERSION +1 -1
  2. data/http2.gemspec +8 -8
  3. data/lib/http2.rb +5 -4
  4. data/spec/http2_spec.rb +2 -2
  5. metadata +51 -53
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.11
1
+ 0.0.12
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "http2"
8
- s.version = "0.0.11"
7
+ s.name = %q{http2}
8
+ s.version = "0.0.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
12
- s.date = "2012-09-30"
13
- s.description = "A lightweight framework for doing http-connections in Ruby. Supports cookies, keep-alive, compressing and much more."
14
- s.email = "k@spernj.org"
12
+ s.date = %q{2012-10-03}
13
+ s.description = %q{A lightweight framework for doing http-connections in Ruby. Supports cookies, keep-alive, compressing and much more.}
14
+ s.email = %q{k@spernj.org}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.rdoc"
@@ -33,11 +33,11 @@ Gem::Specification.new do |s|
33
33
  "spec/http2_spec.rb",
34
34
  "spec/spec_helper.rb"
35
35
  ]
36
- s.homepage = "http://github.com/kaspernj/http2"
36
+ s.homepage = %q{http://github.com/kaspernj/http2}
37
37
  s.licenses = ["MIT"]
38
38
  s.require_paths = ["lib"]
39
- s.rubygems_version = "1.8.24"
40
- s.summary = "A lightweight framework for doing http-connections in Ruby. Supports cookies, keep-alive, compressing and much more."
39
+ s.rubygems_version = %q{1.6.2}
40
+ s.summary = %q{A lightweight framework for doing http-connections in Ruby. Supports cookies, keep-alive, compressing and much more.}
41
41
 
42
42
  if s.respond_to? :specification_version then
43
43
  s.specification_version = 3
@@ -194,7 +194,7 @@ class Http2
194
194
 
195
195
  header_str = "GET /#{args[:url]} HTTP/1.1#{@nl}"
196
196
  header_str << self.header_str(self.default_headers(args), args)
197
- header_str << "#{@nl}"
197
+ header_str << @nl
198
198
 
199
199
  @mutex.synchronize do
200
200
  print "Http2: Writing headers.\n" if @debug
@@ -218,10 +218,10 @@ class Http2
218
218
 
219
219
  begin
220
220
  raise Errno::EPIPE, "The socket is closed." if !@sock or @sock.closed?
221
- self.sock_puts(str)
221
+ self.sock_write(str)
222
222
  rescue Errno::EPIPE #this can also be thrown by puts.
223
223
  self.reconnect
224
- self.sock_puts(str)
224
+ self.sock_write(str)
225
225
  end
226
226
 
227
227
  @request_last = Time.now
@@ -316,8 +316,9 @@ class Http2
316
316
 
317
317
  header_str = "POST /#{args[:url]} HTTP/1.1#{@nl}"
318
318
  header_str << self.header_str(self.default_headers(args).merge("Content-Type" => "application/x-www-form-urlencoded", "Content-Length" => praw.length), args)
319
- header_str << "#{@nl}"
319
+ header_str << @nl
320
320
  header_str << praw
321
+ header_str << @nl
321
322
 
322
323
  print "Header str: #{header_str}\n" if @debug
323
324
 
@@ -62,14 +62,14 @@ describe "Http2" do
62
62
  end
63
63
 
64
64
  it "should be able to do multipart-requests and keep-alive when using multipart." do
65
- Http2.new(:host => "www.partyworm.dk", :follow_redirects => false) do |http|
65
+ Http2.new(:host => "www.partyworm.dk", :follow_redirects => false, :encoding_gzip => false, :debug => false) do |http|
66
66
  0.upto(5) do
67
67
  resp = http.post_multipart(:url => "multipart_test.php", :post => {
68
68
  "test_var" => "true"
69
69
  })
70
70
 
71
71
  if resp.body != "multipart-test-test_var=true"
72
- raise "Expected body to be 'test_var=true' but it wasnt: '#{resp.body}'."
72
+ raise "Expected body to be 'multipart-test-test_var=true' but it wasnt: '#{resp.body}'."
73
73
  end
74
74
  end
75
75
  end
metadata CHANGED
@@ -1,71 +1,70 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: http2
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.12
4
5
  prerelease:
5
- version: 0.0.11
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Kasper Johansen
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-09-30 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2012-10-03 00:00:00.000000000 +02:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
16
  name: rspec
17
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &20083460 !ruby/object:Gem::Requirement
18
18
  none: false
19
- requirements:
19
+ requirements:
20
20
  - - ~>
21
- - !ruby/object:Gem::Version
21
+ - !ruby/object:Gem::Version
22
22
  version: 2.8.0
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
25
+ version_requirements: *20083460
26
+ - !ruby/object:Gem::Dependency
27
27
  name: rdoc
28
- requirement: &id002 !ruby/object:Gem::Requirement
28
+ requirement: &20076900 !ruby/object:Gem::Requirement
29
29
  none: false
30
- requirements:
30
+ requirements:
31
31
  - - ~>
32
- - !ruby/object:Gem::Version
33
- version: "3.12"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.12'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
36
+ version_requirements: *20076900
37
+ - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &id003 !ruby/object:Gem::Requirement
39
+ requirement: &20066380 !ruby/object:Gem::Requirement
40
40
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
44
  version: 1.0.0
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
47
+ version_requirements: *20066380
48
+ - !ruby/object:Gem::Dependency
49
49
  name: jeweler
50
- requirement: &id004 !ruby/object:Gem::Requirement
50
+ requirement: &20060500 !ruby/object:Gem::Requirement
51
51
  none: false
52
- requirements:
52
+ requirements:
53
53
  - - ~>
54
- - !ruby/object:Gem::Version
54
+ - !ruby/object:Gem::Version
55
55
  version: 1.8.4
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *id004
59
- description: A lightweight framework for doing http-connections in Ruby. Supports cookies, keep-alive, compressing and much more.
58
+ version_requirements: *20060500
59
+ description: A lightweight framework for doing http-connections in Ruby. Supports
60
+ cookies, keep-alive, compressing and much more.
60
61
  email: k@spernj.org
61
62
  executables: []
62
-
63
63
  extensions: []
64
-
65
- extra_rdoc_files:
64
+ extra_rdoc_files:
66
65
  - LICENSE.txt
67
66
  - README.rdoc
68
- files:
67
+ files:
69
68
  - .document
70
69
  - .rspec
71
70
  - Gemfile
@@ -81,35 +80,34 @@ files:
81
80
  - lib/http2.rb
82
81
  - spec/http2_spec.rb
83
82
  - spec/spec_helper.rb
83
+ has_rdoc: true
84
84
  homepage: http://github.com/kaspernj/http2
85
- licenses:
85
+ licenses:
86
86
  - MIT
87
87
  post_install_message:
88
88
  rdoc_options: []
89
-
90
- require_paths:
89
+ require_paths:
91
90
  - lib
92
- required_ruby_version: !ruby/object:Gem::Requirement
91
+ required_ruby_version: !ruby/object:Gem::Requirement
93
92
  none: false
94
- requirements:
95
- - - ">="
96
- - !ruby/object:Gem::Version
97
- hash: -3252344485534143672
98
- segments:
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ segments:
99
98
  - 0
100
- version: "0"
101
- required_rubygems_version: !ruby/object:Gem::Requirement
99
+ hash: -4041781090872138595
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
101
  none: false
103
- requirements:
104
- - - ">="
105
- - !ruby/object:Gem::Version
106
- version: "0"
102
+ requirements:
103
+ - - ! '>='
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
107
106
  requirements: []
108
-
109
107
  rubyforge_project:
110
- rubygems_version: 1.8.24
108
+ rubygems_version: 1.6.2
111
109
  signing_key:
112
110
  specification_version: 3
113
- summary: A lightweight framework for doing http-connections in Ruby. Supports cookies, keep-alive, compressing and much more.
111
+ summary: A lightweight framework for doing http-connections in Ruby. Supports cookies,
112
+ keep-alive, compressing and much more.
114
113
  test_files: []
115
-