bibliothecary 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bibliothecary/parsers/go.rb +28 -1
- data/lib/bibliothecary/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: ec4d295bd9a1f06e2ed647bc765ca1edf0f31e9d
|
4
|
+
data.tar.gz: a160b8a6a6ac9c2906786f8c4a5aebed556489b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e81044b368f8c8e33e8081b10374ac4dc0e2de41dd7cc86d55046b6d79f65ec6eb6243ded40ef97fd899863e58fd0620d5c45bdcb8566072578a47c27be31d2
|
7
|
+
data.tar.gz: 0f2c53b851a8b0029d781b9b2db982c6eefc27182747f51cd49fc8f21f599e89ed103f3cacc5a455146cfd189ba25696ffac63dc057b09def1c3584393a19561
|
@@ -16,6 +16,9 @@ module Bibliothecary
|
|
16
16
|
elsif filename.match(/^Godeps\/Godeps\.json$/)
|
17
17
|
json = JSON.parse file_contents
|
18
18
|
parse_godep_json(json)
|
19
|
+
elsif filename.match(/^vendor\/manifest$/)
|
20
|
+
json = JSON.parse file_contents
|
21
|
+
parse_gb_manifest(json)
|
19
22
|
else
|
20
23
|
[]
|
21
24
|
end
|
@@ -24,7 +27,8 @@ module Bibliothecary
|
|
24
27
|
def self.analyse(folder_path, file_list)
|
25
28
|
[analyse_glide_yaml(folder_path, file_list),
|
26
29
|
analyse_glide_lockfile(folder_path, file_list),
|
27
|
-
analyse_godep_json(folder_path, file_list)
|
30
|
+
analyse_godep_json(folder_path, file_list),
|
31
|
+
analyse_gb_manifest(folder_path, file_list)]
|
28
32
|
end
|
29
33
|
|
30
34
|
def self.analyse_godep_json(folder_path, file_list)
|
@@ -40,6 +44,19 @@ module Bibliothecary
|
|
40
44
|
}
|
41
45
|
end
|
42
46
|
|
47
|
+
def self.analyse_gb_manifest(folder_path, file_list)
|
48
|
+
path = file_list.find{|path| path.gsub(folder_path, '').gsub(/^\//, '').match(/^vendor\/manifest$/) }
|
49
|
+
return unless path
|
50
|
+
|
51
|
+
manifest = JSON.parse File.open(path).read
|
52
|
+
|
53
|
+
{
|
54
|
+
platform: PLATFORM_NAME,
|
55
|
+
path: path,
|
56
|
+
dependencies: parse_gb_manifest(manifest)
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
43
60
|
def self.analyse_glide_yaml(folder_path, file_list)
|
44
61
|
path = file_list.find{|path| path.gsub(folder_path, '').gsub(/^\//, '').match(/^glide\.yaml$/) }
|
45
62
|
return unless path
|
@@ -101,6 +118,16 @@ module Bibliothecary
|
|
101
118
|
}
|
102
119
|
end
|
103
120
|
end
|
121
|
+
|
122
|
+
def self.parse_gb_manifest(manifest)
|
123
|
+
manifest.fetch('dependencies',[]).map do |dependency|
|
124
|
+
{
|
125
|
+
name: dependency['importpath'],
|
126
|
+
requirement: dependency['revision'],
|
127
|
+
type: 'runtime'
|
128
|
+
}
|
129
|
+
end
|
130
|
+
end
|
104
131
|
end
|
105
132
|
end
|
106
133
|
end
|