webhook_system 2.1.4 → 2.1.5

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
  SHA256:
3
- metadata.gz: 1463e38923bd3c6b355b49fb135ccb37f923d3f2fd0ebbb97e2ae6dade7bc40a
4
- data.tar.gz: fc67b0e5fb362d63b54300fbf34235be71fecea0e151c1bbcd5641b4ef923620
3
+ metadata.gz: 341113a9e842aad6e6425cd7674c14d3122adde0316dd95663e5397d93459446
4
+ data.tar.gz: d07b90ac598e7a5a929248f649f6a5bcd4a2465c0b81a34c3ecc56acee6cb6bd
5
5
  SHA512:
6
- metadata.gz: a3d525be36358903bb683fbd8a752e0fa79f9b0c8f0bd37809852103b44328453871fe7cd88ab527abe1dd7875623ad4b0ebc41c9b3569209e36ca9d38de37af
7
- data.tar.gz: e355807b1dabae35ab8e9ac05d26ceb44fce3d143f129cccaf142927e481848e02f2e31e8dd23dfc13d5daf3f600fcb879e69fa5b852367a11f4939f01e3f059
6
+ metadata.gz: bfc631f53dfbc28294c5d5f25ffc54ba3214c8b52f75a69a375dc1ab138b9f1afa8e0676177177ecf9f79aa8253565e093d9db48f5ac61d7fc4ed687c4a5322c
7
+ data.tar.gz: 5500acb854e2dee0a695b00354e1bc244861731885f63dea849d4a39d7cb9a53755a22a82af35c47b4b2fe759ad901248f30e023b73fad618e3980d126e8c0fe
data/.travis.yml CHANGED
@@ -11,9 +11,10 @@ gemfile:
11
11
  - gemfiles/rails_5.gemfile
12
12
  - gemfiles/rails_5_2.gemfile
13
13
 
14
-
15
14
  matrix:
16
15
  exclude:
16
+ - rvm: 2.5.3
17
+ gemfile: gemfiles/rails_4.gemfile
17
18
  - rvm: 2.1.8
18
19
  gemfile: gemfiles/rails_5.gemfile
19
20
  - rvm: 2.1.8
@@ -5,9 +5,10 @@ module WebhookSystem
5
5
 
6
6
  # Exception class around non 200 responses
7
7
  class RequestFailed < RuntimeError
8
- def initialize(message, code)
8
+ def initialize(message, code, error_message=nil)
9
9
  super(message)
10
10
  @code = code
11
+ @error_message = error_message
11
12
  end
12
13
  end
13
14
 
@@ -46,12 +47,14 @@ module WebhookSystem
46
47
  end
47
48
 
48
49
  log_response(subscription, event, request, response)
49
- ensure_success(response.status, :POST, subscription.url)
50
+ ensure_success(response, :POST, subscription.url)
50
51
  end
51
52
 
52
- def self.ensure_success(status, http_method, url)
53
+ def self.ensure_success(response, http_method, url)
54
+ status = response.status
53
55
  unless (200..299).cover? status
54
- raise RequestFailed.new("#{http_method} request to #{url} failed with code: #{status}", status)
56
+ text = "#{http_method} request to #{url} failed with code: #{status} and error #{response.body}"
57
+ raise RequestFailed.new(text, status, response.body)
55
58
  end
56
59
  end
57
60
 
@@ -1,3 +1,3 @@
1
1
  module WebhookSystem
2
- VERSION = '2.1.4'
2
+ VERSION = '2.1.5'
3
3
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |gem|
26
26
  gem.add_runtime_dependency 'ph_model'
27
27
  gem.add_runtime_dependency 'validate_url', '~> 1.0'
28
28
 
29
- gem.add_development_dependency 'bundler', '~> 1.0'
29
+ gem.add_development_dependency 'bundler', '> 1.0', '< 2.5'
30
30
  gem.add_development_dependency 'rake'
31
31
  gem.add_development_dependency 'rspec', '~> 3.0'
32
32
  gem.add_development_dependency 'rubygems-tasks', '~> 0.2'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webhook_system
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Banasik
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-05-10 00:00:00.000000000 Z
12
+ date: 2019-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -119,16 +119,22 @@ dependencies:
119
119
  name: bundler
120
120
  requirement: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '1.0'
125
+ - - "<"
126
+ - !ruby/object:Gem::Version
127
+ version: '2.5'
125
128
  type: :development
126
129
  prerelease: false
127
130
  version_requirements: !ruby/object:Gem::Requirement
128
131
  requirements:
129
- - - "~>"
132
+ - - ">"
130
133
  - !ruby/object:Gem::Version
131
134
  version: '1.0'
135
+ - - "<"
136
+ - !ruby/object:Gem::Version
137
+ version: '2.5'
132
138
  - !ruby/object:Gem::Dependency
133
139
  name: rake
134
140
  requirement: !ruby/object:Gem::Requirement
@@ -319,7 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
319
325
  - !ruby/object:Gem::Version
320
326
  version: '0'
321
327
  requirements: []
322
- rubygems_version: 3.0.3
328
+ rubygems_version: 3.0.4
323
329
  signing_key:
324
330
  specification_version: 4
325
331
  summary: Webhook system