metadatajson2puppetfile 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metadatajson2puppetfile/version.rb +1 -1
- data/lib/metadatajson2puppetfile.rb +5 -6
- 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: 67028c8afdd92272cb15ba81591c6521a1e81c4c
|
4
|
+
data.tar.gz: 63b3e6bd3fde9d75cf1a3610e629fd4f06ac74d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e35e817c9ed2217ccff812d6129fb19f09411a56f1bfceb7c4e838cc16e1311cec8b883c8de1e036efb8881b607b2dbbb7692c65b0830de414df43bf41d61c8
|
7
|
+
data.tar.gz: d29035bee897ca9d77619008d24b7d7c1902954199f28591eac681ccfc9eefe21a152059b6ce49de1b235e2b921febef886f5d62ae5e33f565c12cbad97b0705
|
@@ -5,18 +5,17 @@ module Metadatajson2puppetfile
|
|
5
5
|
def self.run
|
6
6
|
if File.exists?(METADATA)
|
7
7
|
begin
|
8
|
-
data = JSON.parse(File.
|
8
|
+
data = JSON.parse(File.read(METADATA))
|
9
|
+
puts "# dependences for #{data['name']}"
|
9
10
|
data["dependencies"].each { |pair|
|
10
|
-
|
11
|
-
|
12
|
-
version_string = dep["version_requirement"]
|
11
|
+
if pair["version_requirement"] =~ /^\d+\.\d+\.\d+$/
|
12
|
+
version_string = "'#{pair['version_requirement']}'"
|
13
13
|
else
|
14
14
|
version_string = ":latest"
|
15
15
|
end
|
16
|
-
dep_string = "mod '#{
|
16
|
+
dep_string = "mod '#{pair['name']}', #{version_string}"
|
17
17
|
puts dep_string
|
18
18
|
}
|
19
|
-
puts "done"
|
20
19
|
rescue JSON::ParserError
|
21
20
|
raise "syntax error in #{METADATA}"
|
22
21
|
end
|