organization_audit 1.0.1 → 1.0.2

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: 7276d8df647d20135185f0487b1fd7c9acc82472
4
- data.tar.gz: 918d2dd09a4661595857fdb69f6cab10827bc91f
3
+ metadata.gz: a86cfa3e711256562fb5257c57f79f7a3b114bfd
4
+ data.tar.gz: 1d55f54fd0a0f3f9d7081542ea22858ce3154451
5
5
  SHA512:
6
- metadata.gz: 5507df9dd32ad0c56cac15fefc1f84d67dce618d2e87d56f86464f9dfed8ce1455ce00ce3abb4f8838118aee6a6c50cc7f4509ae64925c29ebca4f9e91b8c1e7
7
- data.tar.gz: 38486ef92ba53ddfec92aa516a90fa0c70170b110b4da8a7153a0fbe6535c71d0ba3c7b5c04a09f34adffd5f891e17bd64c00a2db02b8c43400943f80a8f467b
6
+ metadata.gz: df57eeb368c9d6c9a04badd1109e0f3709badf3e61f1e2be6cf935099afadde9933cb6a3f52c24b593c790b316032096e16e70cec2168e53018915c8febb0c51
7
+ data.tar.gz: d8709d1c8937ee178937aadfe83261c66988e4164f18d2081df64af4083106d69c933199c8e5ad5f1e21ba8848811a7d67a20d182b36805fbbafcbc2aa6a7069
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -76,14 +76,21 @@ module OrganizationAudit
76
76
  end
77
77
  end
78
78
 
79
- def file_list
80
- @file_list ||= call_api("contents?branch=#{branch}").
81
- select { |f| f["type"] == "file" }.
82
- map { |file| file["path"] }
79
+ def file_list(dir=".")
80
+ list(dir).select { |f| f["type"] == "file" }.map { |file| file["path"] }
81
+ end
82
+
83
+ def directory?(folder)
84
+ !!list(File.dirname(folder)).detect { |f| f["path"] == folder && f["type"] == "dir" }
83
85
  end
84
86
 
85
87
  private
86
88
 
89
+ def list(dir)
90
+ @list ||= {}
91
+ @list[dir] ||= call_api("contents/#{dir == "." ? "" : dir}?branch=#{branch}")
92
+ end
93
+
87
94
  def gemspec_file
88
95
  file_list.grep(/\.gemspec$/).first
89
96
  end
@@ -1,3 +1,3 @@
1
1
  module OrganizationAudit
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
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.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
metadata.gz.sig CHANGED
Binary file