whatsup_github 1.0.0 → 1.0.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: 6011fb20af5b86f2b85e7355a07bed05ee27925a4da730016e9235e5fc617b31
4
- data.tar.gz: 06606d117ab0023ab99db64df32a8fb46860a7b9f225f5ab8ddfbc7b62f21423
3
+ metadata.gz: 2b0f2b56ca6f8f7f4ff62318ad9c8dd44c7add49172901ab659740ad028dc10d
4
+ data.tar.gz: 561373dde9c7dbdc2e790ad1b5103eb4a3d0ded7e9f9fee9d1368cc7f01c05d2
5
5
  SHA512:
6
- metadata.gz: a702fd6f297fa9ac740166b873430da82ea1a9fbd53c71668987e26a9a616a8a53582491225fced72ce1e541273c0f0094339ca1ad0d4d6daefc089c4e1d5b08
7
- data.tar.gz: f49151e889c66674200a0752c7a6b2f2e2f2c179486339b5e6e3f420cd822218f10ff9c6d8273a658ec02bec9eb6152c57a9ae1200b3623f582cd7d8b3c51d02
6
+ metadata.gz: 4eec00e901377b84c16a9441c1c2c36c0bf0b977195405ed0889d6b1dccd3cb6a427e4dd3c9cd73a82b8c0e5f20599697f68aa9a77eb4a162248635936e5a771
7
+ data.tar.gz: bc64795d79bbabb3fbe6d304ac5b67cd40a40ab1780f3752c9ed5788d6968805fb8c961666a709fe7e9cf323d2cca514fc4c0810a7dc428a60a172f68731f987
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- whatsup_github (1.0.0)
4
+ whatsup_github (1.0.1)
5
5
  netrc (~> 0.11)
6
6
  octokit (~> 6.0)
7
7
  thor (~> 1.2)
@@ -47,7 +47,7 @@ GEM
47
47
  cucumber-messages (18.0.0)
48
48
  cucumber-tag-expressions (4.1.0)
49
49
  diff-lcs (1.5.0)
50
- faraday (2.7.2)
50
+ faraday (2.7.3)
51
51
  faraday-net_http (>= 2.0, < 3.1)
52
52
  ruby2_keywords (>= 0.0.4)
53
53
  faraday-net_http (3.0.2)
@@ -64,7 +64,7 @@ GEM
64
64
  octokit (6.0.1)
65
65
  faraday (>= 1, < 3)
66
66
  sawyer (~> 0.9)
67
- pry (0.14.1)
67
+ pry (0.14.2)
68
68
  coderay (~> 1.1)
69
69
  method_source (~> 1.0)
70
70
  public_suffix (5.0.1)
@@ -75,10 +75,10 @@ GEM
75
75
  rspec-mocks (~> 3.12.0)
76
76
  rspec-core (3.12.0)
77
77
  rspec-support (~> 3.12.0)
78
- rspec-expectations (3.12.1)
78
+ rspec-expectations (3.12.2)
79
79
  diff-lcs (>= 1.2.0, < 2.0)
80
80
  rspec-support (~> 3.12.0)
81
- rspec-mocks (3.12.1)
81
+ rspec-mocks (3.12.3)
82
82
  diff-lcs (>= 1.2.0, < 2.0)
83
83
  rspec-support (~> 3.12.0)
84
84
  rspec-support (3.12.0)
@@ -31,5 +31,13 @@ module WhatsupGithub
31
31
  Octokit::Client.new(netrc: true)
32
32
  end
33
33
  end
34
+
35
+ def search_issues(query)
36
+ @client.search_issues(query.gsub('enterprise:', ''))
37
+ end
38
+
39
+ def pull_request(repo, number)
40
+ @client.pull_request(repo.delete_prefix('enterprise:'), number)
41
+ end
34
42
  end
35
43
  end
@@ -18,7 +18,11 @@ module WhatsupGithub
18
18
  def data
19
19
  pull_requests = []
20
20
  filtered_numbers.each do |number|
21
- pull_requests << client.pull_request(@repo, number)
21
+ pull_requests << if @repo.start_with? 'enterprise:'
22
+ enterprise_client.pull_request(@repo, number)
23
+ else
24
+ client.pull_request(@repo, number)
25
+ end
22
26
  end
23
27
  pull_requests
24
28
  end
@@ -67,18 +71,12 @@ module WhatsupGithub
67
71
  def call_query(query)
68
72
  puts "Searching on GitHub by query #{query}"
69
73
  if repo.start_with? 'enterprise:'
70
- enterprise_client.search_issues(
71
- enterprise_query(query)
72
- )
74
+ enterprise_client.search_issues(query)
73
75
  else
74
76
  client.search_issues(query)
75
77
  end
76
78
  end
77
79
 
78
- def enterprise_query(query)
79
- query.gsub('enterprise:', '')
80
- end
81
-
82
80
  def query(label)
83
81
  "repo:#{repo} label:\"#{label}\" merged:>=#{since} base:#{base_branch} is:pull-request"
84
82
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WhatsupGithub
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whatsup_github
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dima Shevtsov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-17 00:00:00.000000000 Z
11
+ date: 2023-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: netrc