http-exceptions 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03bd2eec282320ea2757da660f823694333ec23d
4
- data.tar.gz: aa793159eb0c1f53c1528a250f7272664e41f871
3
+ metadata.gz: ca2709a732ea71caea99f426982e5d2926c65319
4
+ data.tar.gz: 8ffa2895cdaac41c5a49d789979c5a452f453b8e
5
5
  SHA512:
6
- metadata.gz: dd355b76607a59d58bb287af11e062e0912ddb08cd0adca784ca96cc373bb0194a9ccfdbe768c66473becd39c1253d4246c1f267f10e4910e597b6b1090fb0dc
7
- data.tar.gz: bbc6ecf77d7ec8913adafe9e7b19ae008d76f3a42f4cf0ee102670882361c2ed83e81dbe5ebeb3454721303f0217ce72886ae89b8e2908aeeb7af5a0a78ab324
6
+ metadata.gz: c00c7cec6eea8270ffbc97b1b6a75e1442729cb2f155e3c1e91de0f0b9a3dd933b33294296481cc064636e6038f19b2f4a4a7cae847088f1fa88c08d58ba681f
7
+ data.tar.gz: e8729b7f920b285d4e43754a39d2913130d2516f1dfd62431a2a2e8c324b16d552e46f3df106cb7708e87931d0cf5ca51389dd6943516cbf0a5d6a25d5974267
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 2.2.0@http-exceptions --create
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Http::Exceptions
4
4
 
5
- Http::Exceptions provides an easy way to rescue exceptions that might be thrown by your Http library.
5
+ Http::Exceptions provides an easy way to rescue exceptions that might be thrown by your Http library. This was developed at Rainforest QA - you can read more in [Introducing Http::Exceptions](https://www.rainforestqa.com/blog/2014-08-15-introducing-http-exceptions/) over on our blog.
6
6
 
7
7
  If you're using a library such as the excellent [HTTParty](https://github.com/jnunemaker/httparty), you still have to deal with various types of exceptions. In an ideal world, the return code of the HTTP request would be the sole indicator of failures, but HTTP libraries can raise a large number of exceptions (such as `SocketError` or `Net::ReadTimeout`) that you need to handle.
8
8
 
@@ -6,11 +6,11 @@ require 'http/exceptions/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "http-exceptions"
8
8
  spec.version = Http::Exceptions::VERSION
9
- spec.authors = ["Simon Mathieu", "Russell Smith"]
10
- spec.email = ["simon.math@gmail.com", "russ@rainforestqa.com"]
11
- spec.summary = %q{An easy way to rescue exceptions that might be thrown by your HTTP library}
12
- spec.description = %q{An easy way to rescue exceptions that might be thrown by your HTTP library}
13
- spec.homepage = "https://github.com/rainforestapp/http-exceptions"
9
+ spec.authors = ["Simon Mathieu"]
10
+ spec.email = ["simon.math@gmail.com"]
11
+ spec.summary = %q{An easy way to rescue exceptions that might be thrown by your Http library}
12
+ spec.description = %q{An easy way to rescue exceptions that might be thrown by your Http library}
13
+ spec.homepage = ""
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -4,22 +4,6 @@ require "http/exceptions/http_exception"
4
4
 
5
5
  module Http
6
6
  module Exceptions
7
- EXCEPTIONS = [
8
- SocketError,
9
- Errno::ETIMEDOUT,
10
- (Net.const_defined?(:ReadTimeout) ? Net::ReadTimeout : EOFError),
11
- (Net.const_defined?(:OpenTimeout) ? Net::OpenTimeout : EOFError),
12
- Net::ProtocolError,
13
- Errno::ECONNREFUSED,
14
- Errno::EHOSTDOWN,
15
- Errno::ECONNRESET,
16
- Errno::ENETUNREACH,
17
- Errno::EHOSTUNREACH,
18
- Errno::ECONNABORTED,
19
- OpenSSL::SSL::SSLError,
20
- EOFError,
21
- ].freeze
22
-
23
7
  def self.wrap_exception
24
8
  begin
25
9
  yield
@@ -1,3 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Some stdlib need to be required for accessing those error classes
4
+ # Required for bundler 1.14.5
5
+ require "net/http"
6
+ require "openssl"
7
+ require "socket"
8
+
1
9
  module Http
2
10
  module Exceptions
3
11
  class Configuration
@@ -1,5 +1,5 @@
1
1
  module Http
2
2
  module Exceptions
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http-exceptions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Mathieu
8
- - Russell Smith
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2016-08-24 00:00:00.000000000 Z
11
+ date: 2018-01-09 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
@@ -39,16 +38,16 @@ dependencies:
39
38
  - - ">="
40
39
  - !ruby/object:Gem::Version
41
40
  version: '0'
42
- description: An easy way to rescue exceptions that might be thrown by your HTTP library
41
+ description: An easy way to rescue exceptions that might be thrown by your Http library
43
42
  email:
44
43
  - simon.math@gmail.com
45
- - russ@rainforestqa.com
46
44
  executables: []
47
45
  extensions: []
48
46
  extra_rdoc_files: []
49
47
  files:
50
48
  - ".gitignore"
51
49
  - ".rspec"
50
+ - ".rvmrc"
52
51
  - ".travis.yml"
53
52
  - Gemfile
54
53
  - LICENSE.txt
@@ -62,7 +61,7 @@ files:
62
61
  - spec/http/exceptions/configuration_spec.rb
63
62
  - spec/http_exception_spec.rb
64
63
  - spec/spec_helper.rb
65
- homepage: https://github.com/rainforestapp/http-exceptions
64
+ homepage: ''
66
65
  licenses:
67
66
  - MIT
68
67
  metadata: {}
@@ -82,10 +81,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
81
  version: '0'
83
82
  requirements: []
84
83
  rubyforge_project:
85
- rubygems_version: 2.5.1
84
+ rubygems_version: 2.5.2
86
85
  signing_key:
87
86
  specification_version: 4
88
- summary: An easy way to rescue exceptions that might be thrown by your HTTP library
87
+ summary: An easy way to rescue exceptions that might be thrown by your Http library
89
88
  test_files:
90
89
  - spec/http/exceptions/configuration_spec.rb
91
90
  - spec/http_exception_spec.rb