gitall 1.1.20 → 1.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gitall.rb +7 -38
  3. data/lib/gitall/version.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63df4d0ad03f2a22db3768a65c13245b26ca9191a0316acce90cbc5dcff80564
4
- data.tar.gz: 880a73ade68f6d468c9fe5095826d8c1ae772a3e22638fe0b3057b349da8ee26
3
+ metadata.gz: d70f1c9c6f9ddbad7270a887e973ccead3e2bfdf5e221948bf2bcb6c137be1a7
4
+ data.tar.gz: c077267d0532827b53e97a8540ddee4226aa071140fa553f55e97696be62130b
5
5
  SHA512:
6
- metadata.gz: f76603d2500cc79bf91ca4c62e1803a8c4da59cd21035007c16a49cee3c7383c68f77ceae168786ff5be8fae69c68c52f1e3576140457604c2df48ea7a469d82
7
- data.tar.gz: ed7c586fbb911273009a178c4d272285ffa54c442634f31e36661684f6020c8ad7f253af093689c10b4d009bad0e0b3a45c2d9050632ef1237710ae8683dff12
6
+ metadata.gz: ce918931c2b39ea02f80c50893b4a24344e4f9b61493453c98750158eb478e1507f93a6f3bd499061a4f3a4855cf3b6ab946cb289f0352e4b8642f597fe77575
7
+ data.tar.gz: b582287fbef7b67bae3139ca4f8b3f3f3545d5465b78a3b1f32250c8133cb1c863735e9227713df50670f7887fd361b099b1db64a01e0983d0574e8b830ef635
@@ -170,7 +170,7 @@ module GitAll
170
170
  set :port, 8008
171
171
  set :bind, '127.0.0.1'
172
172
  set :environment, 'production'
173
- set :threaded, false
173
+ set :threaded, true
174
174
  post '/hook/?' do
175
175
  request.body.rewind
176
176
  payload = request.body.read
@@ -181,7 +181,7 @@ module GitAll
181
181
  repo = j.project.path_with_namespace.to_s.downcase
182
182
  resp = GitLabParser.parse json
183
183
  phash = GitAll::PROJECTS[repo.downcase]
184
- if phash['token'] == request.env['HTTP_X_GITLAB_TOKEN']
184
+ if phash[:token] == request.env['HTTP_X_GITLAB_TOKEN']
185
185
  channels = phash['channels']
186
186
  channels.each do |channet|
187
187
  channel = channet.split(',')[0]
@@ -192,11 +192,8 @@ module GitAll
192
192
  end
193
193
  end
194
194
  elsif request.env.key? 'HTTP_X_HUB_SIGNATURE'
195
- if !j.repository.full_name.nil?
195
+ unless j.repository.full_name.nil?
196
196
  repo = j.repository.full_name.downcase
197
- elsif !j.organization.login.nil?
198
- repo = j.organization.login.downcase
199
- else
200
197
  end
201
198
  # phash includes orgs and repos
202
199
  phash = GitAll::PROJECTS[repo.downcase]
@@ -206,41 +203,13 @@ module GitAll
206
203
  resp = GitHubParser.parse json, request.env['HTTP_X_GITHUB_EVENT']
207
204
  if signature.to_s == sent_token.to_s
208
205
  channels = phash['channels'.to_sym]
209
- channels.each {
210
- |channet|
211
- channel = channet.split(',')[0]
212
- network = channet.split(',')[1]
213
- resp.each {
214
- |n|
215
- GitAll::Bot::Bots.bots[network].Channel(channel).send("#{n}")
216
- }
217
- }
218
- end
219
-
220
- elsif request.env.key?('HTTP_X_GOGS_EVENT')
221
- if !j.repository.full_name.nil?
222
- repo = j.repository.full_name
223
- elsif !j.organization.login.nil?
224
- repo = j.organization.login
225
- else
226
- end
227
- # phash includes orgs and repos
228
- phash = GitAll::PROJECTS[repo.to_sym]
229
- token = phash['token']
230
- sent_token = request.env['HTTP_X_HUB_SIGNATURE']
231
- signature = "sha1=#{OpenSSL::HMAC.hexdigest('sha1', token, payload.strip).chomp}"
232
- resp = GitHubParser.parse json, request.env['HTTP_X_GITHUB_EVENT']
233
- if signature.to_s == sent_token.to_s
234
- channels = phash['channels'.to_sym]
235
- channels.each {
236
- |channet|
206
+ channels.each do |channet|
237
207
  channel = channet.split(',')[0]
238
208
  network = channet.split(',')[1]
239
- resp.each {
240
- |n|
209
+ resp.each do |n|
241
210
  GitAll::Bot::Bots.bots[network].Channel(channel).send("#{n}")
242
- }
243
- }
211
+ end
212
+ end
244
213
  end
245
214
  elsif request.env.key?('HTTP_X_EVENT_KEY')
246
215
  # BitBucket's Webhooks
@@ -1,3 +1,3 @@
1
1
  module GitAll
2
- VERSION = '1.1.20'
2
+ VERSION = '1.1.21'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitall
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.20
4
+ version: 1.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Spencer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-02 00:00:00.000000000 Z
11
+ date: 2019-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cinch
@@ -323,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
323
323
  version: '0'
324
324
  requirements: []
325
325
  rubyforge_project:
326
- rubygems_version: 2.7.6
326
+ rubygems_version: 2.7.6.2
327
327
  signing_key:
328
328
  specification_version: 4
329
329
  summary: Git Based Webservices Webhook Receiver