organization_audit 1.0.2 → 1.0.3

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
  SHA1:
3
- metadata.gz: a86cfa3e711256562fb5257c57f79f7a3b114bfd
4
- data.tar.gz: 1d55f54fd0a0f3f9d7081542ea22858ce3154451
3
+ metadata.gz: 2bf9677823e9a2a8a32cfdf9987b7e0b093c27d7
4
+ data.tar.gz: 6238a73d10846157e2919dc4b07ed3011bba2312
5
5
  SHA512:
6
- metadata.gz: df57eeb368c9d6c9a04badd1109e0f3709badf3e61f1e2be6cf935099afadde9933cb6a3f52c24b593c790b316032096e16e70cec2168e53018915c8febb0c51
7
- data.tar.gz: d8709d1c8937ee178937aadfe83261c66988e4164f18d2081df64af4083106d69c933199c8e5ad5f1e21ba8848811a7d67a20d182b36805fbbafcbc2aa6a7069
6
+ metadata.gz: 34071371de71ce57e439f4ae7fd003a31f8e5b06a657e221aa46bd41950c0b561318b4760f057dd43f08b7039f1b3cd6673ee4379030298540ee563ec4475bc9
7
+ data.tar.gz: 3db19e81ccb7d006b4edfdad5aed5e1af07df4128e31a90439c2196696bbabf68746b0e4a8f9655c28fc1617c1a7815311825adc90c9f059549cd9ba31f5c0d0
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -5,9 +5,9 @@ module OrganizationAudit
5
5
 
6
6
  class << self
7
7
  def all(options={})
8
+ ignore = (options[:ignore] || [])
8
9
  Repo.all(options).reject do |repo|
9
- ignored = (options[:ignore] || [])
10
- ignored.include?(repo.url) or ignored.include?(repo.name)
10
+ matches_ignore?(ignore, repo) or (options[:ignore_public] and repo.public?)
11
11
  end
12
12
  end
13
13
 
@@ -15,7 +15,15 @@ module OrganizationAudit
15
15
  parser.on("--user USER", "Use this github user") { |user| options[:user] = user }
16
16
  parser.on("--organization ORGANIZATION", "Use this github organization") { |organization| options[:organization] = organization }
17
17
  parser.on("--token TOKEN", "Use this github token") { |token| options[:token] = token }
18
- parser.on("--ignore REPO", "Ignore given repo name or url (use multiple times)") { |repo_name| options[:ignore] << repo_name }
18
+ parser.on("--ignore REPO", "Ignore given repo name or url or name /regexp/ (use multiple times)") { |repo_name| options[:ignore] << repo_name }
19
+ parser.on("--ignore-public", "Ignore public repos") { options[:ignore_public] = true }
20
+ end
21
+
22
+ private
23
+
24
+ def matches_ignore?(ignore, repo)
25
+ ignore_regexp = ignore.select { |i| i =~ /^\/.*\/$/ }.map { |i| Regexp.new(i[1..-2]) }
26
+ ignore.include?(repo.url) or ignore.include?(repo.name) or ignore_regexp.any? { |i| i =~ repo.name }
19
27
  end
20
28
  end
21
29
  end
@@ -62,6 +62,10 @@ module OrganizationAudit
62
62
  @data["private"]
63
63
  end
64
64
 
65
+ def public?
66
+ !private?
67
+ end
68
+
65
69
  def last_commiter
66
70
  response = call_api("commits/#{branch}")
67
71
  committer = response["commit"]["committer"]
@@ -1,3 +1,3 @@
1
1
  module OrganizationAudit
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: organization_audit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
@@ -29,7 +29,7 @@ cert_chain:
29
29
  y0kCSWmK6D+x/SbfS6r7Ke07MRqziJdB9GuE1+0cIRuFh8EQ+LN6HXCKM5pon/GU
30
30
  ycwMXfl0
31
31
  -----END CERTIFICATE-----
32
- date: 2014-01-21 00:00:00.000000000 Z
32
+ date: 2014-01-30 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: json
metadata.gz.sig CHANGED
Binary file