puppet-forge-server 1.7.1 → 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/puppet_forge_server/backends/directory.rb +18 -5
- data/lib/puppet_forge_server/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f1449614786bc09ef0b3ea9d05b0b95bc73c61b
|
4
|
+
data.tar.gz: cc504debfd84730de1ac4bfb9dc7c97f4d425979
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 990ad7b68a7d9c98879657691f8b641708430a454c3dc423ccb6ca897d98f7d54fffc05c389e0e624e1d5f79567e1e4b3a6645846bcd5ce8e11d3e202e90f1eb
|
7
|
+
data.tar.gz: dc67162f5bbca82fd01549bd8ec4233a68ea38edd17b328c80138b80a734e6ec6371c9aea17151619732a8878b0ffc3926f588ab8e032014c3c6f3d52defe5cb
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
#
|
3
|
-
# Copyright
|
3
|
+
# Copyright 2015 North Development AB
|
4
4
|
#
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
# you may not use this file except in compliance with the License.
|
@@ -27,6 +27,7 @@ module PuppetForgeServer::Backends
|
|
27
27
|
|
28
28
|
def initialize(url)
|
29
29
|
@module_dir = url
|
30
|
+
@log = PuppetForgeServer::Logger.get
|
30
31
|
end
|
31
32
|
|
32
33
|
def query_metadata(query, options = {})
|
@@ -61,6 +62,11 @@ module PuppetForgeServer::Backends
|
|
61
62
|
return nil
|
62
63
|
end
|
63
64
|
|
65
|
+
def normalize_metadata(metadata)
|
66
|
+
metadata['name'] = metadata['name'].gsub('/', '-')
|
67
|
+
metadata
|
68
|
+
end
|
69
|
+
|
64
70
|
def parse_dependencies(metadata)
|
65
71
|
metadata.dependencies = metadata.dependencies.dup.map do |dependency|
|
66
72
|
PuppetForgeServer::Models::Dependency.new({:name => dependency['name'], :version_requirement => dependency['version_requirement']})
|
@@ -70,13 +76,20 @@ module PuppetForgeServer::Backends
|
|
70
76
|
|
71
77
|
def get_file_metadata(file_name, options)
|
72
78
|
options = ({:with_checksum => true}).merge(options)
|
73
|
-
|
74
|
-
|
75
|
-
|
79
|
+
file_metadata = []
|
80
|
+
Dir["#{@module_dir}/**/#{file_name}"].each do |path|
|
81
|
+
metadata_raw = read_metadata(path)
|
82
|
+
if metadata_raw
|
83
|
+
file_metadata << {
|
84
|
+
:metadata => parse_dependencies(PuppetForgeServer::Models::Metadata.new(normalize_metadata(metadata_raw))),
|
76
85
|
:checksum => options[:with_checksum] == true ? Digest::MD5.file(path).hexdigest : nil,
|
77
86
|
:path => "/#{Pathname.new(path).relative_path_from(Pathname.new(@module_dir))}"
|
78
|
-
|
87
|
+
}
|
88
|
+
else
|
89
|
+
@log.error "Failed reading metadata from #{path}"
|
90
|
+
end
|
79
91
|
end
|
92
|
+
file_metadata
|
80
93
|
end
|
81
94
|
end
|
82
95
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-forge-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilja Bobkevic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|