octokitted 0.0.7 → 0.0.8

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/octokitted.rb +6 -3
  3. data/lib/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 930bcddc8ee154391c8deb09e7a2c0e483e49d6cb3091adeb70239d0388d3e5d
4
- data.tar.gz: b64e1ba7b33e4c2eeb73975825bf5fa7cd2eaf37f63383b01427e4adddbd7e4a
3
+ metadata.gz: c7fe4c051e60f41068c020cd9c0fbfe3bae4d1cb673e22de5dc17c3b76e46ea9
4
+ data.tar.gz: b6c569962b05022e655a077f9f692c5d17a2bab406e29722188887dc7be248cc
5
5
  SHA512:
6
- metadata.gz: c2738d3e5a2bb9bb665a8ed84f76ecbe4594b753e46b27a49d504587fbceae86f4a5905bd704368373bf4868551fe5a014716555e274f22fcad95b8d29eb107c
7
- data.tar.gz: 486cf3f74dc41658968876d79d11383c1d8bfe7577f822c4fe17660555e96f4fa5480f180acd86bd140cbd8af7c972ad4068bb74436a8d2127238ba56141afb9
6
+ metadata.gz: b3a9add54171018622c44d309e6ac50435d3c225fe4795eb917c9812a3a567881210fa8f538b6b575eb00cb7bc7d2831da3899cfa9f29115ef30ce42fffa384f
7
+ data.tar.gz: 2cb81e5b5a4e078cfc7dec09202092c01c609a888ffc2c6e176390f45de1ebcdd3f4c9873378a90ccd33fddc4d4425493846af1288886ee2f1489a7e38432dbe
data/lib/octokitted.rb CHANGED
@@ -40,7 +40,7 @@ class Octokitted
40
40
  @cloned_repos = []
41
41
  @event_path = event_path || ENV.fetch("GITHUB_EVENT_PATH", nil)
42
42
  @sha = ENV.fetch("GITHUB_SHA", nil)
43
- org_and_repo_hash = fetch_org_and_repo
43
+ org_and_repo_hash = fetch_org_and_repo(org, repo)
44
44
  @login = login
45
45
  @org = org || org_and_repo_hash[:org]
46
46
  @repo = repo || org_and_repo_hash[:repo]
@@ -137,8 +137,11 @@ class Octokitted
137
137
 
138
138
  # Fetch the org and repo from the environment
139
139
  # :return: A hash containing the org and repo, and the org and repo separately
140
- Contract None => HashOf[Symbol, String]
141
- def fetch_org_and_repo
140
+ Contract Maybe[String], Maybe[String] => Hash
141
+ def fetch_org_and_repo(org, repo)
142
+ # if org and repo are provided, and not nil, use them
143
+ return { org_and_repo: "#{org}/#{repo}", org:, repo: } if org && repo
144
+
142
145
  org_and_repo = ENV.fetch("GITHUB_REPOSITORY", nil)
143
146
  org = nil
144
147
  repo = nil
data/lib/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Octokitted
4
4
  module Version
5
- VERSION = "0.0.7"
5
+ VERSION = "0.0.8"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octokitted
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Birkinbine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-16 00:00:00.000000000 Z
11
+ date: 2023-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contracts