site_hook 1.0.29 → 1.0.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/site_hook/version.rb +1 -1
- data/lib/site_hook/webhook.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fde22ad63f7ac462b49b6197447eaf2fa6ce2a91a8d86c87634f9c5767e6a31
|
4
|
+
data.tar.gz: aad3371a801f543b3a930a6f76d25fbbd4b6ca9a8e4ca240f40f8e03ed3aae44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53eeea729fdbb9b16eb033c69a799a02f5fec3ff1943a603828819b0873ef93dd33c5ebf736659fbd2f70b49a30120d9ef926467501cd438d8d6a39313e9c23f
|
7
|
+
data.tar.gz: cfcafc748a5b67a26af2d3e521d2c88c05b63a36e1921f9084d0e2b2732979361216794a95459a2e82e848234d2395da0d9a1b23bd34981d41900a2a1342d3a3
|
data/lib/site_hook/version.rb
CHANGED
data/lib/site_hook/webhook.rb
CHANGED
@@ -111,13 +111,13 @@ module SiteHook
|
|
111
111
|
event = 'push'
|
112
112
|
service = events.select { |_key, value| value }.keys.first
|
113
113
|
when false
|
114
|
-
halt 400, {message: 'events are mutually exclusive', status: 'failure'}.to_json, {CONTENT_TYPE => APPLICATION_JSON}
|
114
|
+
halt 400, {message: 'events are mutually exclusive', status: 'failure'}.to_json, {"CONTENT_TYPE" => APPLICATION_JSON}
|
115
115
|
|
116
116
|
else
|
117
|
-
halt 400, {'status': 'failure', 'message': 'something weird happened'}, {CONTENT_TYPE => APPLICATION_JSON}
|
117
|
+
halt 400, {'status': 'failure', 'message': 'something weird happened'}, {"CONTENT_TYPE" => APPLICATION_JSON}
|
118
118
|
end
|
119
119
|
if event != 'push' && event.nil?
|
120
|
-
halt 400, {message: 'no event header', status: 'failure'}.to_json, {CONTENT_TYPE => APPLICATION_JSON}
|
120
|
+
halt 400, {message: 'no event header', status: 'failure'}.to_json, {"CONTENT_TYPE" => APPLICATION_JSON}
|
121
121
|
end
|
122
122
|
case service
|
123
123
|
when 'gitlab'
|
@@ -143,15 +143,15 @@ module SiteHook
|
|
143
143
|
status 200
|
144
144
|
{status: 'success'}
|
145
145
|
when -1, -2, -3
|
146
|
-
halt 400, {'status': 'exception', error: jekyll_status.fetch(:message).to_s}, {CONTENT_TYPE => APPLICATION_JSON}
|
146
|
+
halt 400, {'status': 'exception', error: jekyll_status.fetch(:message).to_s}, {"CONTENT_TYPE" => APPLICATION_JSON}
|
147
147
|
else
|
148
148
|
# This shouldn't happen
|
149
149
|
end
|
150
150
|
rescue => e
|
151
|
-
halt 500, {'status': 'exception', error: e.to_s}, {CONTENT_TYPE => APPLICATION_JSON}
|
151
|
+
halt 500, {'status': 'exception', error: e.to_s}, {"CONTENT_TYPE" => APPLICATION_JSON}
|
152
152
|
end
|
153
153
|
else
|
154
|
-
halt 403, {message: 'incorrect secret', 'status': 'failure'}.to_json, {CONTENT_TYPE => APPLICATION_JSON}
|
154
|
+
halt 403, {message: 'incorrect secret', 'status': 'failure'}.to_json, {"CONTENT_TYPE" => APPLICATION_JSON}
|
155
155
|
end
|
156
156
|
end
|
157
157
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: site_hook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken Spencer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: after_do
|