http2 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/http2.gemspec +2 -2
- data/include/errors.rb +6 -2
- data/lib/http2.rb +6 -2
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/http2.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{http2}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
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 = %q{2012-
|
12
|
+
s.date = %q{2012-08-11}
|
13
13
|
s.description = %q{A lightweight framework for doing http-connections in Ruby. Supports cookies, keep-alive, compressing and much more.}
|
14
14
|
s.email = %q{k@spernj.org}
|
15
15
|
s.extra_rdoc_files = [
|
data/include/errors.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
#This class holds various classes for error-handeling.
|
2
2
|
class Http2::Errors
|
3
3
|
#Raised when trying to access something you dont have access to.
|
4
|
-
class Noaccess < RuntimeError
|
4
|
+
class Noaccess < RuntimeError
|
5
|
+
attr_accessor :response
|
6
|
+
end
|
5
7
|
|
6
8
|
#Raised when an internal error occurs on the servers side.
|
7
|
-
class Internalserver < RuntimeError
|
9
|
+
class Internalserver < RuntimeError
|
10
|
+
attr_accessor :response
|
11
|
+
end
|
8
12
|
end
|
data/lib/http2.rb
CHANGED
@@ -531,9 +531,13 @@ class Http2
|
|
531
531
|
return http.get(url)
|
532
532
|
end
|
533
533
|
elsif resp.args[:code].to_s == "500"
|
534
|
-
|
534
|
+
err = Http2::Errors::Internalserver.new
|
535
|
+
err.response = resp
|
536
|
+
raise err
|
535
537
|
elsif resp.args[:code].to_s == "403"
|
536
|
-
|
538
|
+
err = Http2::Errors::Noaccess.new
|
539
|
+
err.response = resp
|
540
|
+
raise err
|
537
541
|
else
|
538
542
|
return resp
|
539
543
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: http2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Kasper Johansen
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-08-11 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -107,7 +107,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
hash:
|
110
|
+
hash: 2447340270284784571
|
111
111
|
segments:
|
112
112
|
- 0
|
113
113
|
version: "0"
|