repos_report 2.0.1 → 2.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 +4 -4
- data/lib/repos_report/repo_finder.rb +11 -26
- data/lib/repos_report/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d129f122271f340349a4a78749ac82baf33f271b
|
4
|
+
data.tar.gz: 70537a1d76d6e11e36c1079625631da9e1b1974a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e152954230055922dc2d899b5f273ce04706e0b92613c9da7a8d2027c89bfebf0fc7e4fa058677afe45b6b7bd79a120e0c13241725a664ecb7cecb9a13cba869
|
7
|
+
data.tar.gz: 1b7aa9f5c59788ef9d24822927eb756e0ff754f5d8f7a22351b3975478cde228cca3be81f1d5b9bceb3efdc1da3a910580b08e23923790e19b059fbda93c25a8
|
@@ -4,50 +4,35 @@ module RepoFinder
|
|
4
4
|
class << self
|
5
5
|
|
6
6
|
def repos_in_or_below(directory)
|
7
|
-
|
8
|
-
repos_in(directory)
|
9
|
-
|
10
|
-
else
|
11
|
-
repos = repos_in(directory)
|
12
|
-
|
13
|
-
folders_without_repos_in(directory).each do |folder|
|
14
|
-
repos += repos_in_or_below(folder)
|
15
|
-
end
|
16
|
-
|
17
|
-
repos
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def repos_in(directory)
|
22
|
-
return [] if folders_in(directory).empty?
|
23
|
-
|
24
|
-
folders_with_repos_in(directory).map { |d| Repo.new(d) }
|
7
|
+
repos_in(directory) + repos_in_subdirectories_of(directory)
|
25
8
|
end
|
26
9
|
|
27
10
|
|
28
11
|
|
29
12
|
private
|
30
13
|
|
31
|
-
def
|
32
|
-
|
33
|
-
|
34
|
-
directories.reject { |d| contains_repo?(d) }
|
14
|
+
def repos_in(directory)
|
15
|
+
folders_with_repos_in(directory).map { |d| Repo.new(d) }
|
35
16
|
end
|
36
17
|
|
37
18
|
def folders_with_repos_in(directory)
|
38
|
-
directories =
|
19
|
+
directories = subdirectories_in(directory)
|
39
20
|
directories.select { |d| contains_repo?(d) }
|
40
21
|
end
|
41
22
|
|
42
|
-
def
|
43
|
-
|
23
|
+
def repos_in_subdirectories_of(directory)
|
24
|
+
subdirectories = subdirectories_in(directory)
|
25
|
+
|
26
|
+
subdirectories.reduce([]) do |repos, subdirectory|
|
27
|
+
repos += repos_in_or_below(subdirectory)
|
28
|
+
end
|
44
29
|
end
|
45
30
|
|
46
31
|
def contains_repo?(directory_path)
|
47
32
|
Dir.glob("#{directory_path}/.git").any?
|
48
33
|
end
|
49
34
|
|
50
|
-
def
|
35
|
+
def subdirectories_in(directory)
|
51
36
|
Dir.glob("#{directory}/*")
|
52
37
|
end
|
53
38
|
end
|
data/lib/repos_report/version.rb
CHANGED