pdk 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -0
  3. data/README.md +3 -9
  4. data/exe/pdk +1 -1
  5. data/lib/pdk.rb +5 -4
  6. data/lib/pdk/cli.rb +62 -59
  7. data/lib/pdk/cli/errors.rb +1 -1
  8. data/lib/pdk/cli/exec.rb +154 -29
  9. data/lib/pdk/cli/input.rb +2 -2
  10. data/lib/pdk/cli/new.rb +12 -27
  11. data/lib/pdk/cli/new/class.rb +28 -41
  12. data/lib/pdk/cli/new/module.rb +30 -41
  13. data/lib/pdk/cli/test.rb +9 -20
  14. data/lib/pdk/cli/test/unit.rb +38 -0
  15. data/lib/pdk/cli/util/option_normalizer.rb +45 -19
  16. data/lib/pdk/cli/util/option_validator.rb +24 -20
  17. data/lib/pdk/cli/validate.rb +65 -65
  18. data/lib/pdk/generate.rb +5 -0
  19. data/lib/pdk/generators/module.rb +37 -33
  20. data/lib/pdk/generators/puppet_class.rb +1 -1
  21. data/lib/pdk/generators/puppet_object.rb +19 -20
  22. data/lib/pdk/logger.rb +1 -1
  23. data/lib/pdk/module/metadata.rb +35 -18
  24. data/lib/pdk/module/templatedir.rb +40 -33
  25. data/lib/pdk/report.rb +76 -19
  26. data/lib/pdk/report/event.rb +276 -0
  27. data/lib/pdk/template_file.rb +8 -6
  28. data/lib/pdk/tests/unit.rb +8 -3
  29. data/lib/pdk/util.rb +65 -0
  30. data/lib/pdk/util/bundler.rb +167 -0
  31. data/lib/pdk/util/version.rb +34 -0
  32. data/lib/pdk/validate.rb +3 -4
  33. data/lib/pdk/validators/base_validator.rb +60 -4
  34. data/lib/pdk/validators/metadata.rb +29 -0
  35. data/lib/pdk/validators/puppet/puppet_lint.rb +47 -0
  36. data/lib/pdk/validators/puppet/puppet_parser.rb +34 -0
  37. data/lib/pdk/validators/puppet_validator.rb +30 -0
  38. data/lib/pdk/validators/ruby/rubocop.rb +59 -0
  39. data/lib/pdk/validators/ruby_validator.rb +29 -0
  40. data/lib/pdk/version.rb +1 -1
  41. data/lib/puppet/util/windows.rb +14 -0
  42. data/lib/puppet/util/windows/api_types.rb +278 -0
  43. data/lib/puppet/util/windows/file.rb +488 -0
  44. data/lib/puppet/util/windows/string.rb +16 -0
  45. data/locales/de/pdk.po +263 -78
  46. data/locales/pdk.pot +224 -65
  47. metadata +60 -8
  48. data/lib/pdk/cli/tests/unit.rb +0 -52
  49. data/lib/pdk/validators/puppet_lint.rb +0 -17
  50. data/lib/pdk/validators/puppet_parser.rb +0 -17
  51. data/lib/pdk/validators/ruby_lint.rb +0 -17
@@ -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
@@ -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 RubyLint < BaseValidator
8
- def self.name
9
- 'ruby-lint'
10
- end
11
-
12
- def self.cmd
13
- 'rubocop'
14
- end
15
- end
16
- end
17
- end