pdk 0.1.0 → 0.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 +50 -0
- data/README.md +3 -9
- data/exe/pdk +1 -1
- data/lib/pdk.rb +5 -4
- data/lib/pdk/cli.rb +62 -59
- data/lib/pdk/cli/errors.rb +1 -1
- data/lib/pdk/cli/exec.rb +154 -29
- data/lib/pdk/cli/input.rb +2 -2
- data/lib/pdk/cli/new.rb +12 -27
- data/lib/pdk/cli/new/class.rb +28 -41
- data/lib/pdk/cli/new/module.rb +30 -41
- data/lib/pdk/cli/test.rb +9 -20
- data/lib/pdk/cli/test/unit.rb +38 -0
- data/lib/pdk/cli/util/option_normalizer.rb +45 -19
- data/lib/pdk/cli/util/option_validator.rb +24 -20
- data/lib/pdk/cli/validate.rb +65 -65
- data/lib/pdk/generate.rb +5 -0
- data/lib/pdk/generators/module.rb +37 -33
- data/lib/pdk/generators/puppet_class.rb +1 -1
- data/lib/pdk/generators/puppet_object.rb +19 -20
- data/lib/pdk/logger.rb +1 -1
- data/lib/pdk/module/metadata.rb +35 -18
- data/lib/pdk/module/templatedir.rb +40 -33
- data/lib/pdk/report.rb +76 -19
- data/lib/pdk/report/event.rb +276 -0
- data/lib/pdk/template_file.rb +8 -6
- data/lib/pdk/tests/unit.rb +8 -3
- data/lib/pdk/util.rb +65 -0
- data/lib/pdk/util/bundler.rb +167 -0
- data/lib/pdk/util/version.rb +34 -0
- data/lib/pdk/validate.rb +3 -4
- data/lib/pdk/validators/base_validator.rb +60 -4
- data/lib/pdk/validators/metadata.rb +29 -0
- data/lib/pdk/validators/puppet/puppet_lint.rb +47 -0
- data/lib/pdk/validators/puppet/puppet_parser.rb +34 -0
- data/lib/pdk/validators/puppet_validator.rb +30 -0
- data/lib/pdk/validators/ruby/rubocop.rb +59 -0
- data/lib/pdk/validators/ruby_validator.rb +29 -0
- data/lib/pdk/version.rb +1 -1
- data/lib/puppet/util/windows.rb +14 -0
- data/lib/puppet/util/windows/api_types.rb +278 -0
- data/lib/puppet/util/windows/file.rb +488 -0
- data/lib/puppet/util/windows/string.rb +16 -0
- data/locales/de/pdk.po +263 -78
- data/locales/pdk.pot +224 -65
- metadata +60 -8
- data/lib/pdk/cli/tests/unit.rb +0 -52
- data/lib/pdk/validators/puppet_lint.rb +0 -17
- data/lib/pdk/validators/puppet_parser.rb +0 -17
- data/lib/pdk/validators/ruby_lint.rb +0 -17
data/lib/pdk/cli/tests/unit.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'cri'
|
2
|
-
require 'pdk/cli/util/option_validator'
|
3
|
-
require 'pdk/report'
|
4
|
-
|
5
|
-
require 'pdk/tests/unit'
|
6
|
-
|
7
|
-
module PDK
|
8
|
-
module CLI
|
9
|
-
module Test
|
10
|
-
class Unit
|
11
|
-
include PDK::CLI::Util
|
12
|
-
|
13
|
-
def self.command
|
14
|
-
@unit ||= Cri::Command.define do
|
15
|
-
name 'unit'
|
16
|
-
usage _("unit [options]")
|
17
|
-
summary _("Run unit tests.")
|
18
|
-
|
19
|
-
flag nil, :list, _("list all available unit tests and their descriptions")
|
20
|
-
|
21
|
-
option nil, :tests, _("a comma-separated list of tests to run"), argument: :required do |values|
|
22
|
-
OptionValidator.list(values)
|
23
|
-
end
|
24
|
-
|
25
|
-
option nil, :runner_options, _("options to pass through to the actual test-runner"), argument: :required
|
26
|
-
|
27
|
-
run do |opts, args, cmd|
|
28
|
-
report = nil
|
29
|
-
|
30
|
-
if opts[:list]
|
31
|
-
puts _("List of all available unit tests: (TODO)")
|
32
|
-
end
|
33
|
-
|
34
|
-
if opts[:tests]
|
35
|
-
tests = opts.fetch(:tests)
|
36
|
-
end
|
37
|
-
|
38
|
-
# Note: Reporting may be delegated to the validation tool itself.
|
39
|
-
if opts[:'report-file']
|
40
|
-
format = opts.fetch(:'report-format', PDK::Report.default_format)
|
41
|
-
report = Report.new(opts.fetch(:'report-file'), format)
|
42
|
-
end
|
43
|
-
|
44
|
-
puts _("Running unit tests: %{tests}") % {tests: tests}
|
45
|
-
PDK::Test::Unit.invoke(tests, report)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'pdk'
|
2
|
-
require 'pdk/cli/exec'
|
3
|
-
require 'pdk/validators/base_validator'
|
4
|
-
|
5
|
-
module PDK
|
6
|
-
module Validate
|
7
|
-
class PuppetLint < BaseValidator
|
8
|
-
def self.name
|
9
|
-
'puppet-lint'
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.cmd
|
13
|
-
'puppet-lint'
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'pdk'
|
2
|
-
require 'pdk/cli/exec'
|
3
|
-
require 'pdk/validators/base_validator'
|
4
|
-
|
5
|
-
module PDK
|
6
|
-
module Validate
|
7
|
-
class PuppetParser < BaseValidator
|
8
|
-
def self.name
|
9
|
-
'puppet-parser'
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.cmd
|
13
|
-
'puppet-parser-validate'
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|