organization_gem_dependencies 0.2.0 → 0.3.0

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
  SHA1:
3
- metadata.gz: 4417535dea7895998e8e89f8c4c1bce3c00a98ad
4
- data.tar.gz: d0acb5e478eef3f405cb2e155eb3240534f54b24
3
+ metadata.gz: f5e86325abcdad56c8a6c972470c386ad6e291c6
4
+ data.tar.gz: d810b3f3f08ebd8a39f3bc3324f41a3a72559735
5
5
  SHA512:
6
- metadata.gz: 712b8fb611a5a7beb8f96fe6916953eb5a0c8027188497e4a0836b0e008671b9f626135b01af2e76f8461b19759beaab133bb2f42b6ddbc4cc9278a927c5b390
7
- data.tar.gz: 64c6a76d8c24f9e2c9134c65ef2278e3ca257d58407c36dd8c4a42ae0053b48416ee85cc331180fb3cef1848e5688d541587113ae83f0db4bb1106f2c384e8fe
6
+ metadata.gz: 868399d15bddf2c0de91811b6816cea68985bdcdceb289d025a129f909c3fe16fad0dc83509921987dbbc0736ab8abd61ace7aed549cdc96df68bd41e09a6bc1
7
+ data.tar.gz: 2bca65afb937fee2f240716529ae2d22f7f04e8385d39b6d14f312c6e49fa7350d4e1d6f1fc76c9998adeffc47f58a9ea7cbc32bd36a5e824431b337c682bc3a
data/CHANGES.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # Change Log
2
2
 
3
- ## Unreleased
3
+ ## 0.3.0 (2018/07/20)
4
+
5
+ **Added**
6
+
7
+ * Don't include archived repositories.
8
+
9
+
10
+ ## 0.2.0 (2018/07/03)
11
+
12
+ **Added**
13
+
14
+ * Require `GITHUB_ORGANIZATION` to be provided on the command line.
15
+
16
+ ## 0.1.0 (2018/07/03)
4
17
 
5
18
  **Added**
6
19
 
@@ -53,14 +53,37 @@ module OrganizationGemDependencies
53
53
 
54
54
  private
55
55
 
56
+ def archived_repositories(github, organization)
57
+ github.organization_repositories(organization)
58
+ last_response = github.last_response
59
+
60
+ repositories = []
61
+ last_response.data.each do |repository|
62
+ repositories << repository.name if repository.archived
63
+ end
64
+ until last_response.rels[:next].nil?
65
+ last_response = last_response.rels[:next].get
66
+ last_response.data.each do |repository|
67
+ repositories << repository.name if repository.archived
68
+ end
69
+ end
70
+ repositories
71
+ end
72
+
56
73
  def gemfiles(github, organization)
74
+ archived = archived_repositories(github, organization)
57
75
  github.search_code(SEARCH_TERM % organization, per_page: 1000)
58
76
  last_response = github.last_response
59
77
 
60
- matches = last_response.data.items
78
+ matches = []
79
+ last_response.data.items.each do |match|
80
+ matches << match unless archived.include? match.repository.name
81
+ end
61
82
  until last_response.rels[:next].nil?
62
83
  last_response = last_response.rels[:next].get
63
- matches.concat last_response.data.items
84
+ last_response.data.items.each do |match|
85
+ matches << match unless archived.include? match.repository.name
86
+ end
64
87
  end
65
88
 
66
89
  matches.sort_by(&:html_url).each do |match|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OrganizationGemDependencies
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: organization_gem_dependencies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryce Boe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-03 00:00:00.000000000 Z
11
+ date: 2018-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest