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 +4 -4
- data/.travis.yml +2 -1
- data/lib/webhook_system/job.rb +7 -4
- data/lib/webhook_system/version.rb +1 -1
- data/webhook_system.gemspec +1 -1
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 341113a9e842aad6e6425cd7674c14d3122adde0316dd95663e5397d93459446
|
4
|
+
data.tar.gz: d07b90ac598e7a5a929248f649f6a5bcd4a2465c0b81a34c3ecc56acee6cb6bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfc631f53dfbc28294c5d5f25ffc54ba3214c8b52f75a69a375dc1ab138b9f1afa8e0676177177ecf9f79aa8253565e093d9db48f5ac61d7fc4ed687c4a5322c
|
7
|
+
data.tar.gz: 5500acb854e2dee0a695b00354e1bc244861731885f63dea849d4a39d7cb9a53755a22a82af35c47b4b2fe759ad901248f30e023b73fad618e3980d126e8c0fe
|
data/.travis.yml
CHANGED
data/lib/webhook_system/job.rb
CHANGED
@@ -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
|
50
|
+
ensure_success(response, :POST, subscription.url)
|
50
51
|
end
|
51
52
|
|
52
|
-
def self.ensure_success(
|
53
|
+
def self.ensure_success(response, http_method, url)
|
54
|
+
status = response.status
|
53
55
|
unless (200..299).cover? status
|
54
|
-
|
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
|
|
data/webhook_system.gemspec
CHANGED
@@ -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', '
|
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
|
+
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-
|
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.
|
328
|
+
rubygems_version: 3.0.4
|
323
329
|
signing_key:
|
324
330
|
specification_version: 4
|
325
331
|
summary: Webhook system
|