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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bee9a781cd867b78ce3c81c3e4d59f7d9319cc8a
4
- data.tar.gz: 854fae92542721938aa9443be17aae9baff2b225
3
+ metadata.gz: 67028c8afdd92272cb15ba81591c6521a1e81c4c
4
+ data.tar.gz: 63b3e6bd3fde9d75cf1a3610e629fd4f06ac74d3
5
5
  SHA512:
6
- metadata.gz: 821cea9d341392e173b63bc3bea195cdbbd581c3b8f73181d09bcfb20985efb6d5075afd217c97cda9042728e39f48d2e46c62da21459eca48b0c7439ab44aa0
7
- data.tar.gz: 00cc59f269998d248c111261032aac0bbc08123937317f764be98bad411dbc968003e38652127c1afadfd14330e2322cacb87789c62d2906fb0a4a70e9e17f3b
6
+ metadata.gz: 8e35e817c9ed2217ccff812d6129fb19f09411a56f1bfceb7c4e838cc16e1311cec8b883c8de1e036efb8881b607b2dbbb7692c65b0830de414df43bf41d61c8
7
+ data.tar.gz: d29035bee897ca9d77619008d24b7d7c1902954199f28591eac681ccfc9eefe21a152059b6ce49de1b235e2b921febef886f5d62ae5e33f565c12cbad97b0705
@@ -1,3 +1,3 @@
1
1
  module Metadatajson2puppetfile
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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.readlines(METADATA).to_s)
8
+ data = JSON.parse(File.read(METADATA))
9
+ puts "# dependences for #{data['name']}"
9
10
  data["dependencies"].each { |pair|
10
- puts pair
11
- if dep["version_requirement"] =~ /\d+\.\d+\.\d+/
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 '#{dep['name']}', '#{version_string}'"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metadatajson2puppetfile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Williams