iconoclasm 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.4
@@ -7,7 +7,7 @@ module Iconoclasm
7
7
  def initialize(string)
8
8
  header_string = string.dup
9
9
  http_response = header_string.slice!(REGEXP)
10
- @version, @code, @message = parse_http_response(http_response.strip)
10
+ @version, @code, @message = parse_http_response(http_response)
11
11
  @header_hash = parse_header_string(header_string.strip)
12
12
  end
13
13
 
@@ -50,10 +50,10 @@ module Iconoclasm
50
50
  end
51
51
 
52
52
  def parse_http_response(response)
53
- if response.match(REGEXP || "")
53
+ if response && response.match(REGEXP || "")
54
54
  [ $1.to_f, $2.to_i, $3.chomp.strip ]
55
55
  else
56
- raise Iconoclasm::HTTPError.new(nil, response)
56
+ [ nil, nil, nil ]
57
57
  end
58
58
  end
59
59
  end
@@ -15,7 +15,7 @@ describe Iconoclasm::Headers do
15
15
  describe "parsing the HTTP response" do
16
16
 
17
17
  it "should extract the HTTP version from the headers" do
18
- @headers.version.should == "1.1"
18
+ @headers.version.should == 1.1
19
19
  end
20
20
 
21
21
  it "should extract the HTTP response code from the headers" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iconoclasm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sander Hartlage