noticed 2.5.0 → 2.5.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e02a5a52bcb1a03842de3987b485c1b9dcfa061ec9ebec81c30188d1f7f17ac
|
4
|
+
data.tar.gz: e53c49649b8e3fb960f2bf00ba041e2c6790e755dcf5e470ca6a22d95c7e9e7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94906ad5fdc52cd42968466db06b9d013732bff427e758626fd255b7405a4741c355bf2fe3451a4b2c554362e5084e42590ab9f1253e3a8bac091c7e2ea93c94
|
7
|
+
data.tar.gz: c78a8e906f66e791f22410466d1b80319689060249dd17702c9c5c85bd836ab6ea5212bd5258733973f9f790f0d20e3226e0e6920f9dbf1b16b879a5d5a074d3
|
@@ -6,12 +6,25 @@ module Noticed
|
|
6
6
|
required_options :json
|
7
7
|
|
8
8
|
def deliver
|
9
|
-
|
9
|
+
headers = evaluate_option(:headers)
|
10
|
+
json = evaluate_option(:json)
|
11
|
+
response = post_request url, headers: headers, json: json
|
12
|
+
|
13
|
+
if raise_if_not_ok?
|
14
|
+
raise ResponseUnsuccessful.new(response, url, {headers: headers, json: json}) unless JSON.parse(response.body)["ok"]
|
15
|
+
end
|
16
|
+
|
17
|
+
response
|
10
18
|
end
|
11
19
|
|
12
20
|
def url
|
13
21
|
evaluate_option(:url) || DEFAULT_URL
|
14
22
|
end
|
23
|
+
|
24
|
+
def raise_if_not_ok?
|
25
|
+
value = evaluate_option(:raise_if_not_ok)
|
26
|
+
value.nil? ? true : value
|
27
|
+
end
|
15
28
|
end
|
16
29
|
end
|
17
30
|
end
|
@@ -6,12 +6,25 @@ module Noticed
|
|
6
6
|
required_options :json
|
7
7
|
|
8
8
|
def deliver
|
9
|
-
|
9
|
+
headers = evaluate_option(:headers)
|
10
|
+
json = evaluate_option(:json)
|
11
|
+
response = post_request url, headers: headers, json: json
|
12
|
+
|
13
|
+
if raise_if_not_ok?
|
14
|
+
raise ResponseUnsuccessful.new(response, url, {headers: headers, json: json}) unless JSON.parse(response.body)["ok"]
|
15
|
+
end
|
16
|
+
|
17
|
+
response
|
10
18
|
end
|
11
19
|
|
12
20
|
def url
|
13
21
|
evaluate_option(:url) || DEFAULT_URL
|
14
22
|
end
|
23
|
+
|
24
|
+
def raise_if_not_ok?
|
25
|
+
value = evaluate_option(:raise_if_not_ok)
|
26
|
+
value.nil? ? true : value
|
27
|
+
end
|
15
28
|
end
|
16
29
|
end
|
17
30
|
end
|
data/lib/noticed/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noticed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Oliver
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-09 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rails
|
@@ -86,7 +85,6 @@ homepage: https://github.com/excid3/noticed
|
|
86
85
|
licenses:
|
87
86
|
- MIT
|
88
87
|
metadata: {}
|
89
|
-
post_install_message:
|
90
88
|
rdoc_options: []
|
91
89
|
require_paths:
|
92
90
|
- lib
|
@@ -101,8 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
99
|
- !ruby/object:Gem::Version
|
102
100
|
version: '0'
|
103
101
|
requirements: []
|
104
|
-
rubygems_version: 3.
|
105
|
-
signing_key:
|
102
|
+
rubygems_version: 3.6.2
|
106
103
|
specification_version: 4
|
107
104
|
summary: Notifications for Ruby on Rails applications
|
108
105
|
test_files: []
|