usps-support 0.2.32 → 0.2.34

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6dd7254a5f59aa252cd188286d4b1bbdb365b7897a4501ccd1d2af6e7d4674b7
4
- data.tar.gz: 822c2f45772cd5917917d1371582d5c7740946ff192893d26165e36e54da8b12
3
+ metadata.gz: 02f8fb6837863f1db65a53e28ea9d5024a1950f77da7b996d069bf5b590b2000
4
+ data.tar.gz: 5c8d8c959ab8d05117f1b062d0805d99a29c462c112848d71fcd4cd74677303a
5
5
  SHA512:
6
- metadata.gz: 0d7bee79730a699e6f24da6f38bec176bcfc61855959e0c011b79689313f66cf158b4b701dfd7c97f187fca3bd7aaf7fab9fb6cc1f4259d1a3883ec0a0068feb
7
- data.tar.gz: 629ceef5d2ac5dc7d4898a094360e51d4d35860dd1cd9e5538bf30fef5be852db907684b34ebe33a7cde6408bc31d0348be0bfa5878f578e1d85b3879806f975
6
+ metadata.gz: b26fc468f75a235640d8787872cd6dc0f404a34590ce577e6a294ce946541c9ec553d6ddcb79af75084e3ae5846d2901c25e504f00d03613f9228504500905a6
7
+ data.tar.gz: b35ed5d1aa5692066b740f2d0f11cefcbd4d604106304b0676ebfb6aa61fbad57a014e421347d8dcb181d8a9eb7dbf0cebad08db10f895d24f685366ddce3811
@@ -5,12 +5,17 @@ module Usps::Support::Models
5
5
  #
6
6
  module GitHub
7
7
  ORG = 'unitedstatespowersquadrons'
8
+ CLIENT_MUTEX = Mutex.new
8
9
 
9
10
  class << self
10
11
  def check_suites(repo, branch)
11
12
  client.check_suites_for_ref("#{ORG}/#{repo}", branch).check_suites
12
13
  end
13
14
 
15
+ def graphql(query, variables = {})
16
+ client.post('/graphql', { query:, variables: }.to_json)
17
+ end
18
+
14
19
  def check_runs(repo, check_suite_id)
15
20
  client.check_runs_for_check_suite("#{ORG}/#{repo}", check_suite_id).check_runs
16
21
  end
@@ -20,6 +25,10 @@ module Usps::Support::Models
20
25
  client.commit("#{ORG}/#{repo}", sha).commit
21
26
  end
22
27
 
28
+ def repository_workflow_runs(repo, head_sha:)
29
+ client.repository_workflow_runs("#{ORG}/#{repo}", head_sha:).workflow_runs
30
+ end
31
+
23
32
  def latest_tag(repo, include_prereleases: false)
24
33
  client
25
34
  .tags("#{ORG}/#{repo}")
@@ -41,6 +50,10 @@ module Usps::Support::Models
41
50
  def client
42
51
  return @client if @client && !expired?
43
52
 
53
+ CLIENT_MUTEX.synchronize { @client && !expired? ? @client : client! }
54
+ end
55
+
56
+ def client!
44
57
  payload = {
45
58
  iat: Time.now.to_i - 60,
46
59
  exp: Time.now.to_i + (10 * 60),
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module Support
5
- VERSION = '0.2.32'
5
+ VERSION = '0.2.34'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usps-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.32
4
+ version: 0.2.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander