pdk 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +10 -0
- data/lib/pdk/cli/bundle.rb +12 -3
- data/lib/pdk/cli/exec.rb +16 -2
- data/lib/pdk/cli/new/task.rb +28 -0
- data/lib/pdk/cli/new.rb +3 -3
- data/lib/pdk/cli/test.rb +1 -1
- data/lib/pdk/cli/util/option_validator.rb +1 -0
- data/lib/pdk/generate.rb +1 -0
- data/lib/pdk/generators/module.rb +4 -1
- data/lib/pdk/generators/puppet_object.rb +31 -5
- data/lib/pdk/generators/task.rb +86 -0
- data/lib/pdk/validators/base_validator.rb +5 -3
- data/lib/pdk/validators/metadata/metadata_json_lint.rb +1 -1
- data/lib/pdk/validators/metadata/metadata_syntax.rb +3 -3
- data/lib/pdk/validators/metadata/task_metadata_lint.rb +149 -0
- data/lib/pdk/validators/metadata_validator.rb +2 -1
- data/lib/pdk/version.rb +1 -1
- data/locales/pdk.pot +121 -69
- metadata +20 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de851b0858e7870cf46b71f5a8647d3f9bc018a4
|
4
|
+
data.tar.gz: ab01700a2ec0373c82224f0566948298eb0d1cb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 325be6b7a78f09fa93e9f2b04a53251961cf21ad370e2d33ed8db251993c1529052123896382bccf5a39742507c81c11e38582b3c290d593796b32d5a6674028
|
7
|
+
data.tar.gz: f21d503b3737b16874e7ef8d3410789104a93e8e7f76064fe82bd590d42fbbb8e6b3c6ae9a3bd76953677c3d2e093b87fbe68f9fa4e0456fbd9b8d2fda7ce0c1
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,24 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
5
|
|
6
|
+
## [v1.2.0](https://github.com/puppetlabs/pdk/tree/v1.2.0) (2017-10-05)
|
7
|
+
|
8
|
+
[Full Changelog](https://github.com/puppetlabs/pdk/compare/v1.1.0...v1.2.0)
|
9
|
+
|
10
|
+
**Implemented enhancements:**
|
11
|
+
|
12
|
+
- \(PDK-479\) new module: create examples/, and files/ directory [\#308](https://github.com/puppetlabs/pdk/pull/308) ([DavidS](https://github.com/DavidS))
|
13
|
+
- \(PDK-470\) Validation of task metadata. [\#301](https://github.com/puppetlabs/pdk/pull/301) ([bmjen](https://github.com/bmjen))
|
14
|
+
- \(PDK-468\) `new task` command [\#299](https://github.com/puppetlabs/pdk/pull/299) ([rodjek](https://github.com/rodjek))
|
15
|
+
|
16
|
+
**Fixed bugs:**
|
17
|
+
|
18
|
+
- \(PDK-408\) Explain PowerShell escaping for -- on `bundle` [\#309](https://github.com/puppetlabs/pdk/pull/309) ([DavidS](https://github.com/DavidS))
|
19
|
+
- \(PDK-482\) Update help messages to be less ambiguous [\#307](https://github.com/puppetlabs/pdk/pull/307) ([DavidS](https://github.com/DavidS))
|
20
|
+
- \(PDK-555\) Handle windows style \(backslash separated\) paths when validating [\#306](https://github.com/puppetlabs/pdk/pull/306) ([rodjek](https://github.com/rodjek))
|
21
|
+
- \(PDK-543\) Fix spdx.org URLs in messages [\#303](https://github.com/puppetlabs/pdk/pull/303) ([farkasmate](https://github.com/farkasmate))
|
22
|
+
- \(PDK-502\) make the private git available to module commands [\#298](https://github.com/puppetlabs/pdk/pull/298) ([rodjek](https://github.com/rodjek))
|
23
|
+
|
6
24
|
## [v1.1.0](https://github.com/puppetlabs/pdk/tree/v1.1.0) (2017-09-13)
|
7
25
|
|
8
26
|
[Full Changelog](https://github.com/puppetlabs/pdk/compare/v1.0.1...v1.1.0)
|
data/README.md
CHANGED
@@ -67,6 +67,16 @@ pdk new defined_type defined_type_name
|
|
67
67
|
|
68
68
|
PDK creates the new defined\_type manifest and a test file (as `defined_type_name_spec.rb`) in your module's `/spec/defines` directory.
|
69
69
|
|
70
|
+
### Generate a task
|
71
|
+
|
72
|
+
To generate a task in your module, use the `pdk new task` command, specifying the name of your new task.
|
73
|
+
|
74
|
+
1. From the command line, in your module's directory, run:
|
75
|
+
```
|
76
|
+
pdk new task task_name
|
77
|
+
```
|
78
|
+
|
79
|
+
PDK creates the new task file and metadata.
|
70
80
|
|
71
81
|
### Validating a module
|
72
82
|
|
data/lib/pdk/cli/bundle.rb
CHANGED
@@ -2,10 +2,19 @@
|
|
2
2
|
module PDK::CLI
|
3
3
|
@bundle_cmd = @base_cmd.define_command do
|
4
4
|
name 'bundle'
|
5
|
-
|
5
|
+
if Gem.win_platform?
|
6
|
+
usage _('bundle `-- [bundler_options]')
|
7
|
+
else
|
8
|
+
usage _('bundle -- [bundler_options]')
|
9
|
+
end
|
6
10
|
summary _('(Experimental) Command pass-through to bundler')
|
7
|
-
description _(
|
8
|
-
|
11
|
+
description _(<<-EOF
|
12
|
+
[experimental] For advanced users, pdk bundle runs arbitrary commands in the bundler environment that pdk manages.
|
13
|
+
Careless use of this command can lead to errors that pdk can't help recover from.
|
14
|
+
|
15
|
+
Note that for PowerShell the '--' needs to be escaped using a backtick: '`--' to avoid it being parsed by the shell.
|
16
|
+
EOF
|
17
|
+
)
|
9
18
|
|
10
19
|
be_hidden
|
11
20
|
|
data/lib/pdk/cli/exec.rb
CHANGED
@@ -25,6 +25,20 @@ module PDK
|
|
25
25
|
@git_dir ||= File.join('private', 'git', Gem.win_platform? ? 'cmd' : 'bin')
|
26
26
|
end
|
27
27
|
|
28
|
+
def self.git_paths
|
29
|
+
@paths ||= begin
|
30
|
+
paths = [File.join(PDK::Util.pdk_package_basedir, git_bindir)]
|
31
|
+
|
32
|
+
if Gem.win_platform?
|
33
|
+
paths << File.join(PDK::Util.pdk_package_basedir, 'private', 'git', 'mingw64', 'bin')
|
34
|
+
paths << File.join(PDK::Util.pdk_package_basedir, 'private', 'git', 'mingw64', 'libexec', 'git-core')
|
35
|
+
paths << File.join(PDK::Util.pdk_package_basedir, 'private', 'git', 'usr', 'bin')
|
36
|
+
end
|
37
|
+
|
38
|
+
paths
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
28
42
|
def self.git_bin
|
29
43
|
git_bin = Gem.win_platform? ? 'git.exe' : 'git'
|
30
44
|
vendored_bin_path = File.join(git_bindir, git_bin)
|
@@ -154,9 +168,9 @@ module PDK
|
|
154
168
|
File.join(@process.environment['GEM_HOME'], 'bin'),
|
155
169
|
File.join(@process.environment['GEM_PATH'], 'bin'),
|
156
170
|
package_binpath,
|
157
|
-
PDK::Util.package_install? ? PDK::CLI::Exec.git_bindir : nil,
|
158
171
|
ENV['PATH'],
|
159
|
-
|
172
|
+
PDK::Util.package_install? ? PDK::CLI::Exec.git_paths : nil,
|
173
|
+
].compact.flatten.join(File::PATH_SEPARATOR)
|
160
174
|
|
161
175
|
mod_root = PDK::Util.module_root
|
162
176
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module PDK::CLI
|
2
|
+
@new_task_cmd = @new_cmd.define_command do
|
3
|
+
name 'task'
|
4
|
+
usage _('task [options] <name>')
|
5
|
+
summary _('Create a new task named <name> using given options')
|
6
|
+
|
7
|
+
PDK::CLI.template_url_option(self)
|
8
|
+
option nil, :description, _('A short description of the purpose of the task'), argument: :required
|
9
|
+
|
10
|
+
run do |opts, args, _cmd|
|
11
|
+
PDK::CLI::Util.ensure_in_module!
|
12
|
+
|
13
|
+
task_name = args[0]
|
14
|
+
module_dir = Dir.pwd
|
15
|
+
|
16
|
+
if task_name.nil? || task_name.empty?
|
17
|
+
puts command.help
|
18
|
+
exit 1
|
19
|
+
end
|
20
|
+
|
21
|
+
unless Util::OptionValidator.valid_task_name?(task_name)
|
22
|
+
raise PDK::CLI::ExitWithError, _("'%{name}' is not a valid task name") % { name: task_name }
|
23
|
+
end
|
24
|
+
|
25
|
+
PDK::Generate::Task.new(module_dir, task_name, opts).run
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/pdk/cli/new.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
|
2
1
|
module PDK::CLI
|
3
2
|
@new_cmd = @base_cmd.define_command do
|
4
3
|
name 'new'
|
5
|
-
usage _('new <
|
4
|
+
usage _('new <thing> [options]')
|
6
5
|
summary _('create a new module, etc.')
|
7
|
-
description _('Creates a new
|
6
|
+
description _('Creates a new <thing> using relevant options.')
|
8
7
|
default_subcommand 'help'
|
9
8
|
end
|
10
9
|
|
@@ -14,3 +13,4 @@ end
|
|
14
13
|
require 'pdk/cli/new/class'
|
15
14
|
require 'pdk/cli/new/defined_type'
|
16
15
|
require 'pdk/cli/new/module'
|
16
|
+
require 'pdk/cli/new/task'
|
data/lib/pdk/cli/test.rb
CHANGED
@@ -22,6 +22,7 @@ module PDK
|
|
22
22
|
def self.valid_module_name?(string)
|
23
23
|
!(string =~ %r{\A[a-z][a-z0-9_]*\Z}).nil?
|
24
24
|
end
|
25
|
+
singleton_class.send(:alias_method, :valid_task_name?, :valid_module_name?)
|
25
26
|
|
26
27
|
# Validate a Puppet namespace against the regular expression in the
|
27
28
|
# documentation: https://docs.puppet.com/puppet/4.10/lang_reserved.html#classes-and-defined-resource-types
|
data/lib/pdk/generate.rb
CHANGED
@@ -150,8 +150,11 @@ module PDK
|
|
150
150
|
|
151
151
|
def self.prepare_module_directory(target_dir)
|
152
152
|
[
|
153
|
+
File.join(target_dir, 'examples'),
|
154
|
+
File.join(target_dir, 'files'),
|
153
155
|
File.join(target_dir, 'manifests'),
|
154
156
|
File.join(target_dir, 'templates'),
|
157
|
+
File.join(target_dir, 'tasks'),
|
155
158
|
].each do |dir|
|
156
159
|
begin
|
157
160
|
FileUtils.mkdir_p(dir)
|
@@ -194,7 +197,7 @@ module PDK
|
|
194
197
|
{
|
195
198
|
name: 'license',
|
196
199
|
question: _('What license does this module code fall under?'),
|
197
|
-
help: _('This should be an identifier from https://
|
200
|
+
help: _('This should be an identifier from https://spdx.org/licenses/. Common values are "Apache-2.0", "MIT", or "proprietary".'),
|
198
201
|
required: true,
|
199
202
|
default: metadata.data['license'],
|
200
203
|
},
|
@@ -11,6 +11,7 @@ module PDK
|
|
11
11
|
class PuppetObject
|
12
12
|
attr_reader :module_dir
|
13
13
|
attr_reader :object_name
|
14
|
+
attr_reader :options
|
14
15
|
|
15
16
|
# Initialises the PDK::Generate::PuppetObject object.
|
16
17
|
#
|
@@ -30,6 +31,7 @@ module PDK
|
|
30
31
|
def initialize(module_dir, object_name, options = {})
|
31
32
|
@module_dir = module_dir
|
32
33
|
@options = options
|
34
|
+
@object_name = object_name
|
33
35
|
|
34
36
|
if [:class, :defined_type].include?(object_type) # rubocop:disable Style/GuardClause
|
35
37
|
object_name_parts = object_name.split('::')
|
@@ -83,10 +85,13 @@ module PDK
|
|
83
85
|
#
|
84
86
|
# @api public
|
85
87
|
def run
|
86
|
-
[target_object_path, target_spec_path].each do |target_file|
|
87
|
-
|
88
|
-
|
89
|
-
|
88
|
+
[target_object_path, target_spec_path].compact.each do |target_file|
|
89
|
+
next unless File.exist?(target_file)
|
90
|
+
|
91
|
+
raise PDK::CLI::ExitWithError, _("Unable to generate %{object_type}; '%{file}' already exists.") % {
|
92
|
+
file: target_file,
|
93
|
+
object_type: object_type,
|
94
|
+
}
|
90
95
|
end
|
91
96
|
|
92
97
|
with_templates do |template_path, config_hash|
|
@@ -115,8 +120,29 @@ module PDK
|
|
115
120
|
#
|
116
121
|
# @api private
|
117
122
|
def render_file(dest_path, template_path, data)
|
123
|
+
write_file(dest_path) do
|
124
|
+
PDK::TemplateFile.new(template_path, data).render
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
# Write the result of the block to disk.
|
129
|
+
#
|
130
|
+
# @param dest_path [String] The path that the rendered file should be
|
131
|
+
# written to. Any necessary directories will be automatically created.
|
132
|
+
# @param &block [String] The content to be written
|
133
|
+
#
|
134
|
+
# @raise [PDK::CLI::FatalError] if the parent directories to `dest_path`
|
135
|
+
# do not exist and could not be created.
|
136
|
+
# @raise [PDK::CLI::FatalError] if the rendered file could not be written
|
137
|
+
# to `dest_path`.
|
138
|
+
#
|
139
|
+
# @return [void]
|
140
|
+
#
|
141
|
+
# @api private
|
142
|
+
def write_file(dest_path)
|
118
143
|
PDK.logger.info(_("Creating '%{file}' from template.") % { file: dest_path })
|
119
|
-
|
144
|
+
|
145
|
+
file_content = yield
|
120
146
|
|
121
147
|
begin
|
122
148
|
FileUtils.mkdir_p(File.dirname(dest_path))
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'pdk/generators/puppet_object'
|
2
|
+
|
3
|
+
module PDK
|
4
|
+
module Generate
|
5
|
+
class Task < PuppetObject
|
6
|
+
OBJECT_TYPE = :task
|
7
|
+
|
8
|
+
# Prepares the data needed to render the new task template.
|
9
|
+
#
|
10
|
+
# @return [Hash{Symbol => Object}] a hash of information that will be
|
11
|
+
# provided to the task template during rendering. Additionally, this hash
|
12
|
+
# (with the :name key removed) makes up the task metadata.
|
13
|
+
def template_data
|
14
|
+
{
|
15
|
+
name: object_name,
|
16
|
+
puppet_task_version: 1,
|
17
|
+
supports_noop: false,
|
18
|
+
description: options.fetch(:description, 'A short description of this task'),
|
19
|
+
parameters: {},
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Calculates the path to the file where the new task will be written.
|
24
|
+
#
|
25
|
+
# @return [String] the path to the task file.
|
26
|
+
def target_object_path
|
27
|
+
@target_object_path ||= File.join(module_dir, 'tasks', "#{task_name}.sh")
|
28
|
+
end
|
29
|
+
|
30
|
+
# Calculates the path to the file where the tests for the new task will
|
31
|
+
# be written.
|
32
|
+
#
|
33
|
+
# @return [nil] as there is currently no test framework for Tasks.
|
34
|
+
def target_spec_path
|
35
|
+
nil
|
36
|
+
end
|
37
|
+
|
38
|
+
def run
|
39
|
+
check_if_task_already_exists
|
40
|
+
|
41
|
+
super
|
42
|
+
|
43
|
+
write_task_metadata
|
44
|
+
end
|
45
|
+
|
46
|
+
# Checks that the task has not already been defined with a different
|
47
|
+
# extension.
|
48
|
+
#
|
49
|
+
# @raise [PDK::CLI::ExitWithError] if files with the same name as the
|
50
|
+
# task exist in the <module>/tasks/ directory
|
51
|
+
#
|
52
|
+
# @api private
|
53
|
+
def check_if_task_already_exists
|
54
|
+
error = _("A task named '%{name}' already exists in this module; defined in %{file}")
|
55
|
+
allowed_extensions = %w[.md .conf]
|
56
|
+
|
57
|
+
Dir.glob(File.join(module_dir, 'tasks', "#{task_name}.*")).each do |file|
|
58
|
+
next if allowed_extensions.include?(File.extname(file))
|
59
|
+
|
60
|
+
raise PDK::CLI::ExitWithError, error % { name: task_name, file: file }
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Writes the <module>/tasks/<task_name>.json metadata file for the task.
|
65
|
+
#
|
66
|
+
# @api private
|
67
|
+
def write_task_metadata
|
68
|
+
write_file(File.join(module_dir, 'tasks', "#{task_name}.json")) do
|
69
|
+
task_metadata = template_data.dup
|
70
|
+
task_metadata.delete(:name)
|
71
|
+
JSON.pretty_generate(task_metadata)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Calculates the file name of the task files ('init' if the task has the
|
76
|
+
# same name as the module, otherwise use the specified task name).
|
77
|
+
#
|
78
|
+
# @return [String] the base name of the file(s) for the task.
|
79
|
+
#
|
80
|
+
# @api private
|
81
|
+
def task_name
|
82
|
+
(object_name == module_name) ? 'init' : object_name
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -36,18 +36,20 @@ module PDK
|
|
36
36
|
options[:targets]
|
37
37
|
end
|
38
38
|
|
39
|
+
targets.map! { |r| r.gsub(File::ALT_SEPARATOR, File::SEPARATOR) } if File::ALT_SEPARATOR
|
39
40
|
skipped = []
|
40
41
|
invalid = []
|
41
42
|
matched = targets.map { |target|
|
42
43
|
if respond_to?(:pattern)
|
43
44
|
if File.directory?(target)
|
44
|
-
|
45
|
+
pattern_glob = Array(pattern).map { |p| Dir.glob(File.join(PDK::Util.module_root, p)) }
|
46
|
+
target_list = pattern_glob.flatten.select { |file| File.fnmatch(File.join(File.expand_path(target), '*'), file) }
|
45
47
|
skipped << target if target_list.flatten.empty?
|
46
48
|
target_list
|
47
49
|
elsif File.file?(target)
|
48
|
-
if
|
50
|
+
if Array(pattern).include? target
|
49
51
|
target
|
50
|
-
elsif Array
|
52
|
+
elsif Array(pattern).any? { |p| File.fnmatch(File.expand_path(p), File.expand_path(target)) }
|
51
53
|
target
|
52
54
|
else
|
53
55
|
skipped << target
|
@@ -11,12 +11,12 @@ module PDK
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.pattern
|
14
|
-
'metadata.json'
|
14
|
+
['metadata.json', 'tasks/*.json']
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.spinner_text(
|
17
|
+
def self.spinner_text(_targets = [])
|
18
18
|
_('Checking metadata syntax (%{targets}).') % {
|
19
|
-
targets:
|
19
|
+
targets: pattern.join(' '),
|
20
20
|
}
|
21
21
|
end
|
22
22
|
|
@@ -0,0 +1,149 @@
|
|
1
|
+
require 'pdk'
|
2
|
+
require 'pdk/cli/exec'
|
3
|
+
require 'pdk/validators/base_validator'
|
4
|
+
require 'pdk/util'
|
5
|
+
require 'pathname'
|
6
|
+
require 'json-schema'
|
7
|
+
|
8
|
+
module PDK
|
9
|
+
module Validate
|
10
|
+
class TaskMetadataLint < BaseValidator
|
11
|
+
FORGE_SCHEMA_URL = 'https://forgeapi.puppet.com/schemas/task.json'.freeze
|
12
|
+
|
13
|
+
def self.name
|
14
|
+
'task-metadata-lint'
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.pattern
|
18
|
+
'tasks/*.json'
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.spinner_text(_targets = [])
|
22
|
+
_('Checking task metadata style (%{targets}).') % {
|
23
|
+
targets: pattern,
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.create_spinner(targets = [], options = {})
|
28
|
+
return if PDK.logger.debug?
|
29
|
+
options = options.merge(PDK::CLI::Util.spinner_opts_for_platform)
|
30
|
+
|
31
|
+
exec_group = options[:exec_group]
|
32
|
+
@spinner = if exec_group
|
33
|
+
exec_group.add_spinner(spinner_text(targets), options)
|
34
|
+
else
|
35
|
+
TTY::Spinner.new("[:spinner] #{spinner_text(targets)}", options)
|
36
|
+
end
|
37
|
+
@spinner.auto_spin
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.stop_spinner(exit_code)
|
41
|
+
if exit_code.zero? && @spinner
|
42
|
+
@spinner.success
|
43
|
+
elsif @spinner
|
44
|
+
@spinner.error
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.vendored_task_schema_path
|
49
|
+
@vendored_task_schema_path ||= File.join(PDK::Util.package_cachedir, 'task.json')
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.schema_file
|
53
|
+
schema = if PDK::Util.package_install? && File.exist?(vendored_task_schema_path)
|
54
|
+
File.read(vendored_task_schema_path)
|
55
|
+
else
|
56
|
+
download_schema_from_forge
|
57
|
+
end
|
58
|
+
|
59
|
+
JSON.parse(schema)
|
60
|
+
rescue JSON::ParserError
|
61
|
+
raise PDK::CLI::FatalError, _('Failed to parse Task Metadata Schema file.')
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.download_schema_from_forge
|
65
|
+
PDK.logger.debug(_('Task Metadata Schema was not found in the cache. Now downloading from the forge.'))
|
66
|
+
require 'net/https'
|
67
|
+
require 'openssl'
|
68
|
+
|
69
|
+
uri = URI.parse(FORGE_SCHEMA_URL)
|
70
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
71
|
+
http.use_ssl = true
|
72
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if Gem.win_platform?
|
73
|
+
request = Net::HTTP::Get.new(uri.request_uri)
|
74
|
+
response = http.request(request)
|
75
|
+
|
76
|
+
raise PDK::CLI::FatalError, _('Unable to download Task Metadata Schema file. %{code}: %{message}.') % { code: response.code, message: response.message } unless response.code == '200'
|
77
|
+
|
78
|
+
response.body
|
79
|
+
rescue StandardError => e
|
80
|
+
raise PDK::CLI::FatalError, _('Unable to download Task Metadata Schema file. Please check internet connectivity and retry this action. %{error}') % { error: e }
|
81
|
+
end
|
82
|
+
|
83
|
+
def self.invoke(report, options = {})
|
84
|
+
targets, skipped, invalid = parse_targets(options)
|
85
|
+
|
86
|
+
process_skipped(report, skipped)
|
87
|
+
process_invalid(report, invalid)
|
88
|
+
|
89
|
+
return 0 if targets.empty?
|
90
|
+
|
91
|
+
return_val = 0
|
92
|
+
create_spinner(targets, options)
|
93
|
+
|
94
|
+
targets.each do |target|
|
95
|
+
unless File.readable?(target)
|
96
|
+
report.add_event(
|
97
|
+
file: target,
|
98
|
+
source: name,
|
99
|
+
state: :failure,
|
100
|
+
severity: 'error',
|
101
|
+
message: _('Could not be read.'),
|
102
|
+
)
|
103
|
+
return_val = 1
|
104
|
+
next
|
105
|
+
end
|
106
|
+
|
107
|
+
begin
|
108
|
+
# Need to set the JSON Parser and State Generator to the Native one to be
|
109
|
+
# compatible with the multi_json adapter.
|
110
|
+
JSON.parser = JSON::Ext::Parser if defined?(JSON::Ext::Parser)
|
111
|
+
JSON.generator = JSON::Ext::Generator
|
112
|
+
|
113
|
+
begin
|
114
|
+
errors = JSON::Validator.fully_validate(schema_file, File.read(target)) || []
|
115
|
+
rescue JSON::Schema::SchemaError => e
|
116
|
+
raise PDK::CLI::FatalError, _('Unable to validate Task Metadata. %{error}.') % { error: e.message }
|
117
|
+
end
|
118
|
+
|
119
|
+
if errors.empty?
|
120
|
+
report.add_event(
|
121
|
+
file: target,
|
122
|
+
source: name,
|
123
|
+
state: :passed,
|
124
|
+
severity: 'ok',
|
125
|
+
)
|
126
|
+
else
|
127
|
+
errors.each do |error|
|
128
|
+
# strip off the trailing parts that aren't relevant
|
129
|
+
error = error.split('in schema').first if error.include? 'in schema'
|
130
|
+
|
131
|
+
report.add_event(
|
132
|
+
file: target,
|
133
|
+
source: name,
|
134
|
+
state: :failure,
|
135
|
+
severity: 'error',
|
136
|
+
message: error,
|
137
|
+
)
|
138
|
+
end
|
139
|
+
return_val = 1
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
stop_spinner(return_val)
|
145
|
+
return_val
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
@@ -3,6 +3,7 @@ require 'pdk/cli/exec'
|
|
3
3
|
require 'pdk/validators/base_validator'
|
4
4
|
require 'pdk/validators/metadata/metadata_json_lint'
|
5
5
|
require 'pdk/validators/metadata/metadata_syntax'
|
6
|
+
require 'pdk/validators/metadata/task_metadata_lint'
|
6
7
|
|
7
8
|
module PDK
|
8
9
|
module Validate
|
@@ -12,7 +13,7 @@ module PDK
|
|
12
13
|
end
|
13
14
|
|
14
15
|
def self.metadata_validators
|
15
|
-
[MetadataSyntax, MetadataJSONLint]
|
16
|
+
[MetadataSyntax, MetadataJSONLint, TaskMetadataLint]
|
16
17
|
end
|
17
18
|
|
18
19
|
def self.invoke(report, options = {})
|
data/lib/pdk/version.rb
CHANGED
data/locales/pdk.pot
CHANGED
@@ -6,11 +6,11 @@
|
|
6
6
|
#, fuzzy
|
7
7
|
msgid ""
|
8
8
|
msgstr ""
|
9
|
-
"Project-Id-Version: puppet development kit v1.0
|
9
|
+
"Project-Id-Version: puppet development kit v1.1.0-17-g347e75a\n"
|
10
10
|
"\n"
|
11
11
|
"Report-Msgid-Bugs-To: docs@puppet.com\n"
|
12
|
-
"POT-Creation-Date: 2017-
|
13
|
-
"PO-Revision-Date: 2017-
|
12
|
+
"POT-Creation-Date: 2017-10-05 10:26-0700\n"
|
13
|
+
"PO-Revision-Date: 2017-10-05 10:26-0700\n"
|
14
14
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
15
15
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
16
16
|
"Language: \n"
|
@@ -79,16 +79,24 @@ msgstr ""
|
|
79
79
|
msgid "Path to an answer file."
|
80
80
|
msgstr ""
|
81
81
|
|
82
|
-
#: ../lib/pdk/cli/bundle.rb:
|
82
|
+
#: ../lib/pdk/cli/bundle.rb:6
|
83
|
+
msgid "bundle `-- [bundler_options]"
|
84
|
+
msgstr ""
|
85
|
+
|
86
|
+
#: ../lib/pdk/cli/bundle.rb:8
|
83
87
|
msgid "bundle -- [bundler_options]"
|
84
88
|
msgstr ""
|
85
89
|
|
86
|
-
#: ../lib/pdk/cli/bundle.rb:
|
90
|
+
#: ../lib/pdk/cli/bundle.rb:10
|
87
91
|
msgid "(Experimental) Command pass-through to bundler"
|
88
92
|
msgstr ""
|
89
93
|
|
90
|
-
#: ../lib/pdk/cli/bundle.rb:
|
91
|
-
msgid "
|
94
|
+
#: ../lib/pdk/cli/bundle.rb:11
|
95
|
+
msgid ""
|
96
|
+
"[experimental] For advanced users, pdk bundle runs arbitrary commands in the bundler environment that pdk manages.\n"
|
97
|
+
"Careless use of this command can lead to errors that pdk can't help recover from.\n"
|
98
|
+
"\n"
|
99
|
+
"Note that for PowerShell the '--' needs to be escaped using a backtick: '`--' to avoid it being parsed by the shell.\n"
|
92
100
|
msgstr ""
|
93
101
|
|
94
102
|
#: ../lib/pdk/cli/errors.rb:6
|
@@ -99,39 +107,39 @@ msgstr ""
|
|
99
107
|
msgid "Unable to find `%{name}`. Check that it is installed and try again."
|
100
108
|
msgstr ""
|
101
109
|
|
102
|
-
#: ../lib/pdk/cli/exec.rb:
|
110
|
+
#: ../lib/pdk/cli/exec.rb:70
|
103
111
|
msgid "PDK package installation not found. Trying '%{fallback}' from the system PATH instead."
|
104
112
|
msgstr ""
|
105
113
|
|
106
|
-
#: ../lib/pdk/cli/exec.rb:
|
114
|
+
#: ../lib/pdk/cli/exec.rb:75
|
107
115
|
msgid "Using '%{vendored_bin_path}' from PDK package."
|
108
116
|
msgstr ""
|
109
117
|
|
110
|
-
#: ../lib/pdk/cli/exec.rb:
|
118
|
+
#: ../lib/pdk/cli/exec.rb:78
|
111
119
|
msgid "Could not find '%{vendored_bin_path}' in PDK package. Trying '%{fallback}' from the system PATH instead."
|
112
120
|
msgstr ""
|
113
121
|
|
114
|
-
#: ../lib/pdk/cli/exec.rb:
|
122
|
+
#: ../lib/pdk/cli/exec.rb:116
|
115
123
|
msgid "Expected execution context to be :system or :module but got '%{context}'."
|
116
124
|
msgstr ""
|
117
125
|
|
118
|
-
#: ../lib/pdk/cli/exec.rb:
|
126
|
+
#: ../lib/pdk/cli/exec.rb:180
|
119
127
|
msgid "Current working directory is not part of a module. (No metadata.json was found.)"
|
120
128
|
msgstr ""
|
121
129
|
|
122
|
-
#: ../lib/pdk/cli/exec.rb:
|
130
|
+
#: ../lib/pdk/cli/exec.rb:234
|
123
131
|
msgid "Executing '%{command}'"
|
124
132
|
msgstr ""
|
125
133
|
|
126
|
-
#: ../lib/pdk/cli/exec.rb:
|
134
|
+
#: ../lib/pdk/cli/exec.rb:236
|
127
135
|
msgid "Command environment: GEM_HOME is '%{gem_home}' and GEM_PATH is '%{gem_path}'"
|
128
136
|
msgstr ""
|
129
137
|
|
130
|
-
#: ../lib/pdk/cli/exec.rb:
|
138
|
+
#: ../lib/pdk/cli/exec.rb:243
|
131
139
|
msgid "Failed to execute '%{command}': %{message}"
|
132
140
|
msgstr ""
|
133
141
|
|
134
|
-
#: ../lib/pdk/cli/exec.rb:
|
142
|
+
#: ../lib/pdk/cli/exec.rb:257
|
135
143
|
msgid "Execution of '%{command}' complete (duration: %{duration_in_seconds}s; exit code: %{exit_code})"
|
136
144
|
msgstr ""
|
137
145
|
|
@@ -163,16 +171,16 @@ msgstr ""
|
|
163
171
|
msgid "Creating new module: %{modname}"
|
164
172
|
msgstr ""
|
165
173
|
|
166
|
-
#: ../lib/pdk/cli/new.rb:
|
167
|
-
msgid "new <
|
174
|
+
#: ../lib/pdk/cli/new.rb:4
|
175
|
+
msgid "new <thing> [options]"
|
168
176
|
msgstr ""
|
169
177
|
|
170
|
-
#: ../lib/pdk/cli/new.rb:
|
178
|
+
#: ../lib/pdk/cli/new.rb:5
|
171
179
|
msgid "create a new module, etc."
|
172
180
|
msgstr ""
|
173
181
|
|
174
|
-
#: ../lib/pdk/cli/new.rb:
|
175
|
-
msgid "Creates a new
|
182
|
+
#: ../lib/pdk/cli/new.rb:6
|
183
|
+
msgid "Creates a new <thing> using relevant options."
|
176
184
|
msgstr ""
|
177
185
|
|
178
186
|
#: ../lib/pdk/cli/new/class.rb:4
|
@@ -211,8 +219,24 @@ msgstr ""
|
|
211
219
|
msgid "Specifies the license this module is written under. This should be a identifier from https://spdx.org/licenses/. Common values are 'Apache-2.0', 'MIT', or 'proprietary'."
|
212
220
|
msgstr ""
|
213
221
|
|
222
|
+
#: ../lib/pdk/cli/new/task.rb:4
|
223
|
+
msgid "task [options] <name>"
|
224
|
+
msgstr ""
|
225
|
+
|
226
|
+
#: ../lib/pdk/cli/new/task.rb:5
|
227
|
+
msgid "Create a new task named <name> using given options"
|
228
|
+
msgstr ""
|
229
|
+
|
230
|
+
#: ../lib/pdk/cli/new/task.rb:8
|
231
|
+
msgid "A short description of the purpose of the task"
|
232
|
+
msgstr ""
|
233
|
+
|
234
|
+
#: ../lib/pdk/cli/new/task.rb:22
|
235
|
+
msgid "'%{name}' is not a valid task name"
|
236
|
+
msgstr ""
|
237
|
+
|
214
238
|
#: ../lib/pdk/cli/test.rb:5
|
215
|
-
msgid "test [
|
239
|
+
msgid "test [subcommand] [options]"
|
216
240
|
msgstr ""
|
217
241
|
|
218
242
|
#: ../lib/pdk/cli/test.rb:6
|
@@ -287,7 +311,7 @@ msgstr ""
|
|
287
311
|
msgid "Error: the following values are invalid: %{invalid_entries}"
|
288
312
|
msgstr ""
|
289
313
|
|
290
|
-
#: ../lib/pdk/cli/util/option_validator.rb:
|
314
|
+
#: ../lib/pdk/cli/util/option_validator.rb:70
|
291
315
|
msgid "Non-standard data type '%{type}', make sure the type is available in your code, or dependencies"
|
292
316
|
msgstr ""
|
293
317
|
|
@@ -366,87 +390,87 @@ msgstr ""
|
|
366
390
|
msgid "Your username is not a valid Forge username. Proceeding with the username %{username}. You can fix this later in metadata.json."
|
367
391
|
msgstr ""
|
368
392
|
|
369
|
-
#: ../lib/pdk/generators/module.rb:
|
393
|
+
#: ../lib/pdk/generators/module.rb:162
|
370
394
|
msgid "Unable to create directory '%{dir}': %{message}"
|
371
395
|
msgstr ""
|
372
396
|
|
373
|
-
#: ../lib/pdk/generators/module.rb:
|
397
|
+
#: ../lib/pdk/generators/module.rb:174
|
374
398
|
msgid "If you have a Puppet Forge username, add it here."
|
375
399
|
msgstr ""
|
376
400
|
|
377
|
-
#: ../lib/pdk/generators/module.rb:
|
401
|
+
#: ../lib/pdk/generators/module.rb:175
|
378
402
|
msgid "We can use this to upload your module to the Forge when it's complete."
|
379
403
|
msgstr ""
|
380
404
|
|
381
|
-
#: ../lib/pdk/generators/module.rb:
|
405
|
+
#: ../lib/pdk/generators/module.rb:178
|
382
406
|
msgid "Forge usernames can only contain lowercase letters and numbers"
|
383
407
|
msgstr ""
|
384
408
|
|
385
|
-
#: ../lib/pdk/generators/module.rb:
|
409
|
+
#: ../lib/pdk/generators/module.rb:183
|
386
410
|
msgid "What version is this module?"
|
387
411
|
msgstr ""
|
388
412
|
|
389
|
-
#: ../lib/pdk/generators/module.rb:
|
413
|
+
#: ../lib/pdk/generators/module.rb:184
|
390
414
|
msgid "Puppet uses Semantic Versioning (semver.org) to version modules."
|
391
415
|
msgstr ""
|
392
416
|
|
393
|
-
#: ../lib/pdk/generators/module.rb:
|
417
|
+
#: ../lib/pdk/generators/module.rb:187
|
394
418
|
msgid "Semantic Version numbers must be in the form MAJOR.MINOR.PATCH"
|
395
419
|
msgstr ""
|
396
420
|
|
397
|
-
#: ../lib/pdk/generators/module.rb:
|
421
|
+
#: ../lib/pdk/generators/module.rb:192
|
398
422
|
msgid "Who wrote this module?"
|
399
423
|
msgstr ""
|
400
424
|
|
401
|
-
#: ../lib/pdk/generators/module.rb:
|
425
|
+
#: ../lib/pdk/generators/module.rb:193
|
402
426
|
msgid "This is used to credit the module's author."
|
403
427
|
msgstr ""
|
404
428
|
|
405
|
-
#: ../lib/pdk/generators/module.rb:
|
429
|
+
#: ../lib/pdk/generators/module.rb:199
|
406
430
|
msgid "What license does this module code fall under?"
|
407
431
|
msgstr ""
|
408
432
|
|
409
|
-
#: ../lib/pdk/generators/module.rb:
|
410
|
-
msgid "This should be an identifier from https://
|
433
|
+
#: ../lib/pdk/generators/module.rb:200
|
434
|
+
msgid "This should be an identifier from https://spdx.org/licenses/. Common values are \"Apache-2.0\", \"MIT\", or \"proprietary\"."
|
411
435
|
msgstr ""
|
412
436
|
|
413
|
-
#: ../lib/pdk/generators/module.rb:
|
437
|
+
#: ../lib/pdk/generators/module.rb:206
|
414
438
|
msgid "What operating systems does this module support?"
|
415
439
|
msgstr ""
|
416
440
|
|
417
|
-
#: ../lib/pdk/generators/module.rb:
|
441
|
+
#: ../lib/pdk/generators/module.rb:207
|
418
442
|
msgid "Use the up and down keys to move between the choices, space to select and enter to continue."
|
419
443
|
msgstr ""
|
420
444
|
|
421
|
-
#: ../lib/pdk/generators/module.rb:
|
445
|
+
#: ../lib/pdk/generators/module.rb:263
|
422
446
|
msgid "Summarize the purpose of this module in a single sentence."
|
423
447
|
msgstr ""
|
424
448
|
|
425
|
-
#: ../lib/pdk/generators/module.rb:
|
449
|
+
#: ../lib/pdk/generators/module.rb:264
|
426
450
|
msgid "This helps other Puppet users understand what the module does."
|
427
451
|
msgstr ""
|
428
452
|
|
429
|
-
#: ../lib/pdk/generators/module.rb:
|
453
|
+
#: ../lib/pdk/generators/module.rb:270
|
430
454
|
msgid "If there is a source code repository for this module, enter the URL here."
|
431
455
|
msgstr ""
|
432
456
|
|
433
|
-
#: ../lib/pdk/generators/module.rb:
|
457
|
+
#: ../lib/pdk/generators/module.rb:271
|
434
458
|
msgid "Skip this if no repository exists yet. You can update this later in the metadata.json."
|
435
459
|
msgstr ""
|
436
460
|
|
437
|
-
#: ../lib/pdk/generators/module.rb:
|
461
|
+
#: ../lib/pdk/generators/module.rb:277
|
438
462
|
msgid "If there is a URL where others can learn more about this module, enter it here."
|
439
463
|
msgstr ""
|
440
464
|
|
441
|
-
#: ../lib/pdk/generators/module.rb:
|
465
|
+
#: ../lib/pdk/generators/module.rb:278 ../lib/pdk/generators/module.rb:284
|
442
466
|
msgid "Optional. You can update this later in the metadata.json."
|
443
467
|
msgstr ""
|
444
468
|
|
445
|
-
#: ../lib/pdk/generators/module.rb:
|
469
|
+
#: ../lib/pdk/generators/module.rb:283
|
446
470
|
msgid "If there is a public issue tracker for this module, enter its URL here."
|
447
471
|
msgstr ""
|
448
472
|
|
449
|
-
#: ../lib/pdk/generators/module.rb:
|
473
|
+
#: ../lib/pdk/generators/module.rb:297
|
450
474
|
msgid ""
|
451
475
|
"\n"
|
452
476
|
"We need to create a metadata.json file for this module, so we're going to ask you %{count} questions.\n"
|
@@ -454,58 +478,62 @@ msgid ""
|
|
454
478
|
"\n"
|
455
479
|
msgstr ""
|
456
480
|
|
457
|
-
#: ../lib/pdk/generators/module.rb:
|
481
|
+
#: ../lib/pdk/generators/module.rb:308 ../lib/pdk/generators/module.rb:330
|
458
482
|
msgid "Interview cancelled; not generating the module."
|
459
483
|
msgstr ""
|
460
484
|
|
461
|
-
#: ../lib/pdk/generators/module.rb:
|
485
|
+
#: ../lib/pdk/generators/module.rb:319
|
462
486
|
msgid "SUMMARY"
|
463
487
|
msgstr ""
|
464
488
|
|
465
|
-
#: ../lib/pdk/generators/module.rb:
|
489
|
+
#: ../lib/pdk/generators/module.rb:326
|
466
490
|
msgid "About to generate this module; continue?"
|
467
491
|
msgstr ""
|
468
492
|
|
469
|
-
#: ../lib/pdk/generators/module.rb:
|
493
|
+
#: ../lib/pdk/generators/module.rb:327
|
470
494
|
msgid "Answer \"Y\" to continue or \"n\" to cancel."
|
471
495
|
msgstr ""
|
472
496
|
|
473
|
-
#: ../lib/pdk/generators/module.rb:
|
497
|
+
#: ../lib/pdk/generators/module.rb:335
|
474
498
|
msgid "Module not generated."
|
475
499
|
msgstr ""
|
476
500
|
|
477
|
-
#: ../lib/pdk/generators/puppet_object.rb:
|
501
|
+
#: ../lib/pdk/generators/puppet_object.rb:91
|
478
502
|
msgid "Unable to generate %{object_type}; '%{file}' already exists."
|
479
503
|
msgstr ""
|
480
504
|
|
481
|
-
#: ../lib/pdk/generators/puppet_object.rb:
|
505
|
+
#: ../lib/pdk/generators/puppet_object.rb:123
|
482
506
|
msgid "Creating '%{file}' from template."
|
483
507
|
msgstr ""
|
484
508
|
|
485
|
-
#: ../lib/pdk/generators/puppet_object.rb:
|
509
|
+
#: ../lib/pdk/generators/puppet_object.rb:129
|
486
510
|
msgid "Unable to create directory '%{path}': %{message}"
|
487
511
|
msgstr ""
|
488
512
|
|
489
|
-
#: ../lib/pdk/generators/puppet_object.rb:
|
513
|
+
#: ../lib/pdk/generators/puppet_object.rb:137
|
490
514
|
msgid "Unable to write to file '%{path}': %{message}"
|
491
515
|
msgstr ""
|
492
516
|
|
493
|
-
#: ../lib/pdk/generators/puppet_object.rb:
|
517
|
+
#: ../lib/pdk/generators/puppet_object.rb:160
|
494
518
|
msgid "No %{dir_type} template specified; trying next template directory."
|
495
519
|
msgstr ""
|
496
520
|
|
497
|
-
#: ../lib/pdk/generators/puppet_object.rb:
|
521
|
+
#: ../lib/pdk/generators/puppet_object.rb:173
|
498
522
|
msgid "Unable to find a %{type} template in %{url}; trying next template directory."
|
499
523
|
msgstr ""
|
500
524
|
|
501
|
-
#: ../lib/pdk/generators/puppet_object.rb:
|
525
|
+
#: ../lib/pdk/generators/puppet_object.rb:175
|
502
526
|
msgid "Unable to find the %{type} template in %{url}."
|
503
527
|
msgstr ""
|
504
528
|
|
505
|
-
#: ../lib/pdk/generators/puppet_object.rb:
|
529
|
+
#: ../lib/pdk/generators/puppet_object.rb:232
|
506
530
|
msgid "'%{dir}' does not contain valid Puppet module metadata: %{msg}"
|
507
531
|
msgstr ""
|
508
532
|
|
533
|
+
#: ../lib/pdk/generators/task.rb:54
|
534
|
+
msgid "A task named '%{name}' already exists in this module; defined in %{file}"
|
535
|
+
msgstr ""
|
536
|
+
|
509
537
|
#: ../lib/pdk/module/metadata.rb:47
|
510
538
|
msgid "'%{file}' does not exist or is not a file."
|
511
539
|
msgstr ""
|
@@ -637,11 +665,11 @@ msgid "Failed to prepare to run the unit tests."
|
|
637
665
|
msgstr ""
|
638
666
|
|
639
667
|
#: ../lib/pdk/tests/unit.rb:70
|
640
|
-
msgid "Running unit tests
|
668
|
+
msgid "Running unit tests."
|
641
669
|
msgstr ""
|
642
670
|
|
643
671
|
#: ../lib/pdk/tests/unit.rb:70
|
644
|
-
msgid "Running unit tests."
|
672
|
+
msgid "Running unit tests in parallel."
|
645
673
|
msgstr ""
|
646
674
|
|
647
675
|
#: ../lib/pdk/tests/unit.rb:84
|
@@ -710,28 +738,28 @@ msgid ""
|
|
710
738
|
"%{output}"
|
711
739
|
msgstr ""
|
712
740
|
|
713
|
-
#: ../lib/pdk/validators/base_validator.rb:
|
741
|
+
#: ../lib/pdk/validators/base_validator.rb:74
|
714
742
|
msgid "Invoking %{cmd}"
|
715
743
|
msgstr ""
|
716
744
|
|
717
|
-
#: ../lib/pdk/validators/base_validator.rb:
|
745
|
+
#: ../lib/pdk/validators/base_validator.rb:79
|
718
746
|
msgid "%{validator}: Skipped '%{target}'. Target does not contain any files to validate (%{pattern})."
|
719
747
|
msgstr ""
|
720
748
|
|
721
|
-
#: ../lib/pdk/validators/base_validator.rb:
|
749
|
+
#: ../lib/pdk/validators/base_validator.rb:83
|
722
750
|
msgid "Target does not contain any files to validate (%{pattern})."
|
723
751
|
msgstr ""
|
724
752
|
|
725
|
-
#: ../lib/pdk/validators/base_validator.rb:
|
753
|
+
#: ../lib/pdk/validators/base_validator.rb:92
|
726
754
|
msgid "%{validator}: Skipped '%{target}'. Target file not found."
|
727
755
|
msgstr ""
|
728
756
|
|
729
|
-
#: ../lib/pdk/validators/base_validator.rb:
|
757
|
+
#: ../lib/pdk/validators/base_validator.rb:96
|
730
758
|
msgid "File does not exist."
|
731
759
|
msgstr ""
|
732
760
|
|
733
761
|
#: ../lib/pdk/validators/metadata/metadata_json_lint.rb:23
|
734
|
-
msgid "Checking metadata style (%{targets})."
|
762
|
+
msgid "Checking module metadata style (%{targets})."
|
735
763
|
msgstr ""
|
736
764
|
|
737
765
|
#: ../lib/pdk/validators/metadata/metadata_json_lint.rb:40
|
@@ -742,10 +770,34 @@ msgstr ""
|
|
742
770
|
msgid "Checking metadata syntax (%{targets})."
|
743
771
|
msgstr ""
|
744
772
|
|
745
|
-
#: ../lib/pdk/validators/metadata/metadata_syntax.rb:69
|
773
|
+
#: ../lib/pdk/validators/metadata/metadata_syntax.rb:69 ../lib/pdk/validators/metadata/task_metadata_lint.rb:101
|
746
774
|
msgid "Could not be read."
|
747
775
|
msgstr ""
|
748
776
|
|
777
|
+
#: ../lib/pdk/validators/metadata/task_metadata_lint.rb:22
|
778
|
+
msgid "Checking task metadata style (%{targets})."
|
779
|
+
msgstr ""
|
780
|
+
|
781
|
+
#: ../lib/pdk/validators/metadata/task_metadata_lint.rb:61
|
782
|
+
msgid "Failed to parse Task Metadata Schema file."
|
783
|
+
msgstr ""
|
784
|
+
|
785
|
+
#: ../lib/pdk/validators/metadata/task_metadata_lint.rb:65
|
786
|
+
msgid "Task Metadata Schema was not found in the cache. Now downloading from the forge."
|
787
|
+
msgstr ""
|
788
|
+
|
789
|
+
#: ../lib/pdk/validators/metadata/task_metadata_lint.rb:76
|
790
|
+
msgid "Unable to download Task Metadata Schema file. %{code}: %{message}."
|
791
|
+
msgstr ""
|
792
|
+
|
793
|
+
#: ../lib/pdk/validators/metadata/task_metadata_lint.rb:80
|
794
|
+
msgid "Unable to download Task Metadata Schema file. Please check internet connectivity and retry this action. %{error}"
|
795
|
+
msgstr ""
|
796
|
+
|
797
|
+
#: ../lib/pdk/validators/metadata/task_metadata_lint.rb:116
|
798
|
+
msgid "Unable to validate Task Metadata. %{error}."
|
799
|
+
msgstr ""
|
800
|
+
|
749
801
|
#: ../lib/pdk/validators/puppet/puppet_lint.rb:22
|
750
802
|
msgid "Checking Puppet manifest style (%{pattern})."
|
751
803
|
msgstr ""
|
@@ -758,11 +810,11 @@ msgstr ""
|
|
758
810
|
msgid "Checking Ruby code style (%{pattern})."
|
759
811
|
msgstr ""
|
760
812
|
|
761
|
-
#: ../lib/puppet/util/windows/api_types.rb:
|
813
|
+
#: ../lib/puppet/util/windows/api_types.rb:72
|
762
814
|
msgid "Unable to read wide strings with %{null_terminator} terminal nulls"
|
763
815
|
msgstr ""
|
764
816
|
|
765
|
-
#: ../lib/puppet/util/windows/api_types.rb:
|
817
|
+
#: ../lib/puppet/util/windows/api_types.rb:203
|
766
818
|
msgid "Bad GUID format."
|
767
819
|
msgstr ""
|
768
820
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 2.1.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: json-schema
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.8.0
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.8.0
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: tty-which
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,6 +175,7 @@ files:
|
|
161
175
|
- lib/pdk/cli/new/class.rb
|
162
176
|
- lib/pdk/cli/new/defined_type.rb
|
163
177
|
- lib/pdk/cli/new/module.rb
|
178
|
+
- lib/pdk/cli/new/task.rb
|
164
179
|
- lib/pdk/cli/test.rb
|
165
180
|
- lib/pdk/cli/test/unit.rb
|
166
181
|
- lib/pdk/cli/util.rb
|
@@ -174,6 +189,7 @@ files:
|
|
174
189
|
- lib/pdk/generators/module.rb
|
175
190
|
- lib/pdk/generators/puppet_class.rb
|
176
191
|
- lib/pdk/generators/puppet_object.rb
|
192
|
+
- lib/pdk/generators/task.rb
|
177
193
|
- lib/pdk/i18n.rb
|
178
194
|
- lib/pdk/logger.rb
|
179
195
|
- lib/pdk/module/metadata.rb
|
@@ -190,6 +206,7 @@ files:
|
|
190
206
|
- lib/pdk/validators/base_validator.rb
|
191
207
|
- lib/pdk/validators/metadata/metadata_json_lint.rb
|
192
208
|
- lib/pdk/validators/metadata/metadata_syntax.rb
|
209
|
+
- lib/pdk/validators/metadata/task_metadata_lint.rb
|
193
210
|
- lib/pdk/validators/metadata_validator.rb
|
194
211
|
- lib/pdk/validators/puppet/puppet_lint.rb
|
195
212
|
- lib/pdk/validators/puppet/puppet_syntax.rb
|
@@ -222,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
239
|
version: '0'
|
223
240
|
requirements: []
|
224
241
|
rubyforge_project:
|
225
|
-
rubygems_version: 2.
|
242
|
+
rubygems_version: 2.5.2
|
226
243
|
signing_key:
|
227
244
|
specification_version: 4
|
228
245
|
summary: A key part of the Puppet Development Kit, the shortest path to better modules
|