bibliothecary 0.10.0 → 0.11.0

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: 039e2f6d6eff1f2b5e3eb34ed33bddfae48f0019
4
- data.tar.gz: acf89339c17c694405c6d19e4872fb12eeb119e0
3
+ metadata.gz: 7bf47b342e3e120a20a0c6e4350db00f92e0aed2
4
+ data.tar.gz: 21402eed4e826e858d5ea3e0e6bb343199089957
5
5
  SHA512:
6
- metadata.gz: c07e252c8d613ea0faa5ea0328ab186ea3d834f1d914ff910e356cde64783ca56d95407ee002134dd69b9adc5218bb971ce8719557b543c93535a21938aab29d
7
- data.tar.gz: cec68617e4a36ce2b36069d50babef3c169bf71b256ad71b2b13a426cd668d90a5d7231389429a3198b04e2a82a70cd6738d9b26ab13dde5b4304702b2713504
6
+ metadata.gz: f6469739fcc77d598619710296d94db027d3dc08276ec71f779aae2f754b615316decfdaf73f61b4590fd80ec7d41a60d2dc026419902e6da6a70ab215469d2f
7
+ data.tar.gz: 635c482aa015cd395d1b706ca9c1e7bdefc9cd9114769ec3f7ed68a959b60b59e05e72c06b259134312217dcdaaac7b62f777f8dfa4ae076107a2b15a094e8a3
@@ -1 +1,45 @@
1
1
  # REQUIRE
2
+ module Bibliothecary
3
+ module Parsers
4
+ class Julia
5
+ PLATFORM_NAME = 'julia'
6
+
7
+ def self.parse(filename, file_contents)
8
+ if filename.match(/^REQUIRE$/i)
9
+ parse_require(file_contents)
10
+ else
11
+ []
12
+ end
13
+ end
14
+
15
+ def self.analyse(folder_path, file_list)
16
+ [analyse_json(folder_path, file_list),
17
+ analyse_yaml(folder_path, file_list)]
18
+ end
19
+
20
+ def self.analyse_json(folder_path, file_list)
21
+ path = file_list.find{|path| path.gsub(folder_path, '').gsub(/^\//, '').match(/^REQUIRE$/i) }
22
+ return unless path
23
+
24
+ manifest = File.open(path).read
25
+
26
+ {
27
+ platform: PLATFORM_NAME,
28
+ path: path,
29
+ dependencies: parse_require(manifest)
30
+ }
31
+ end
32
+
33
+ def self.parse_require(manifest)
34
+ manifest.split("\n").map do |line|
35
+ match = line.split(/\s/)
36
+ {
37
+ name: match[0],
38
+ requirement: match[1] || '*',
39
+ type: 'runtime'
40
+ }
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "0.10.0"
2
+ VERSION = "0.11.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: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt