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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 050d965039bd2789e308a39c49e5953b5538e884
4
- data.tar.gz: 92ef43654d7ed7200aa4df4e0ba8c3d2523a05e7
3
+ metadata.gz: ec4d295bd9a1f06e2ed647bc765ca1edf0f31e9d
4
+ data.tar.gz: a160b8a6a6ac9c2906786f8c4a5aebed556489b4
5
5
  SHA512:
6
- metadata.gz: 4e67f9fd1301362f6cbdd0a6fd76fc2750bab93ffc65cd5a118549e63a4b305664c08ca0f243c3bdcf1b7a56a1585529d54803292c2ceb0b40e499d60d93a3ef
7
- data.tar.gz: 2d96d66780426198e4bf76078a955c2b5980e13b84dd01294a089a9bee5609bcf845dfe72530f19e2d7ea0fb229e5ecf69f7a7933b9bab4b663afe9d99dbded1
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
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibliothecary
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt