pdk 0.2.0 → 0.3.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 +19 -0
- data/README.md +49 -3
- data/lib/pdk/cli.rb +1 -0
- data/lib/pdk/cli/exec.rb +46 -9
- data/lib/pdk/cli/new/class.rb +2 -1
- data/lib/pdk/cli/test/unit.rb +35 -16
- data/lib/pdk/cli/util.rb +15 -0
- data/lib/pdk/cli/util/interview.rb +52 -0
- data/lib/pdk/cli/util/option_normalizer.rb +1 -1
- data/lib/pdk/cli/validate.rb +12 -2
- data/lib/pdk/generators/module.rb +109 -61
- data/lib/pdk/report.rb +20 -3
- data/lib/pdk/report/event.rb +29 -0
- data/lib/pdk/tests/unit.rb +114 -9
- data/lib/pdk/util/bundler.rb +24 -46
- data/lib/pdk/validators/base_validator.rb +7 -14
- data/lib/pdk/validators/metadata.rb +36 -14
- data/lib/pdk/validators/puppet/puppet_lint.rb +23 -3
- data/lib/pdk/validators/puppet/puppet_syntax.rb +82 -0
- data/lib/pdk/validators/puppet_validator.rb +2 -2
- data/lib/pdk/validators/ruby/rubocop.rb +13 -3
- data/lib/pdk/version.rb +1 -1
- data/locales/de/pdk.po +235 -66
- data/locales/pdk.pot +202 -54
- metadata +22 -7
- data/lib/pdk/cli/input.rb +0 -28
- data/lib/pdk/validators/puppet/puppet_parser.rb +0 -34
data/lib/pdk/cli/input.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
module PDK
|
2
|
-
module CLI
|
3
|
-
module Input
|
4
|
-
# Query the user for a value via STDIN.
|
5
|
-
#
|
6
|
-
# @param message [String] The message to be displayed to the user before
|
7
|
-
# accepting input.
|
8
|
-
# @param default [String] The default value to be used if the user
|
9
|
-
# provides a blank value.
|
10
|
-
#
|
11
|
-
# @return [String] The value provided by the user (or the supplied
|
12
|
-
# default value).
|
13
|
-
def self.get(message, default = nil)
|
14
|
-
print message
|
15
|
-
if default.nil?
|
16
|
-
print ' [(none)]'
|
17
|
-
else
|
18
|
-
print " [#{default}]"
|
19
|
-
end
|
20
|
-
|
21
|
-
print "\n--> "
|
22
|
-
input = (STDIN.gets || '').chomp.strip
|
23
|
-
input = default if input == ''
|
24
|
-
input
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,34 +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'
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.pattern
|
17
|
-
'**/**.pp'
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.spinner_text
|
21
|
-
_('Checking Puppet manifest syntax')
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.parse_options(_options, targets)
|
25
|
-
%w[parser validate].concat(targets)
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.parse_output(_report, _json_data)
|
29
|
-
# TODO: handle outputs
|
30
|
-
# report.add_event(result.merge(state: :passed, severity: :ok))
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|