puppet-retrospec 1.6.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitlab-ci.yml +7 -24
- data/CHANGELOG.md +117 -73
- data/Gemfile +3 -3
- data/Gemfile.lock +56 -51
- data/lib/retrospec/plugins/v1/plugin/generators/base_generator.rb +3 -3
- data/lib/retrospec/plugins/v1/plugin/generators/fact_generator.rb +3 -3
- data/lib/retrospec/plugins/v1/plugin/generators/function_generator.rb +4 -4
- data/lib/retrospec/plugins/v1/plugin/generators/module_data_generator.rb +4 -4
- data/lib/retrospec/plugins/v1/plugin/generators/module_generator.rb +3 -3
- data/lib/retrospec/plugins/v1/plugin/generators/provider_generator.rb +3 -3
- data/lib/retrospec/plugins/v1/plugin/generators/report_generator.rb +3 -3
- data/lib/retrospec/plugins/v1/plugin/generators/resource_base_generator.rb +3 -3
- data/lib/retrospec/plugins/v1/plugin/generators/schema_generator.rb +2 -2
- data/lib/retrospec/plugins/v1/plugin/generators/task_generator.rb +3 -3
- data/lib/retrospec/plugins/v1/plugin/generators/type_generator.rb +3 -3
- data/lib/retrospec/plugins/v1/plugin/puppet.rb +2 -2
- data/lib/retrospec/plugins/v1/plugin/version.rb +1 -1
- data/puppet-retrospec.gemspec +2 -2
- data/spec/unit/generators/acceptance_generator_spec.rb +3 -1
- data/spec/unit/generators/resource_base_generator_spec.rb +2 -1
- metadata +12 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 27cdd72f261a6435b150e84efb8d4c275f331b29874744d7d2951a6aa3a09f29
|
4
|
+
data.tar.gz: 1a129e2fb6b34b42af3fae5caae73e093b8992760f2213a3d78e1c23c7c09fd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3181062fdb594c444dbe2928b4fbcb5c020566e8c42a415774e01f593bf4fcb6f6f3d5644726955f12452952d2230a3fcb93b295ef57bd594aeaeb8cbb7af9d
|
7
|
+
data.tar.gz: 5d08f7a3dd567eba29f6de1d46313cb7711ce48bd53321ea3390e306d5fbbd93de1ceec13eccf56dad3e1cc4b66ef846f311d4ccbc91b474f7eef7953b74bd47
|
data/.gitlab-ci.yml
CHANGED
@@ -5,48 +5,31 @@ before_script:
|
|
5
5
|
- bundle install --without development build
|
6
6
|
- bundle exec ruby lib/retrospec/plugins/v1/plugin/templates/clone-hook
|
7
7
|
|
8
|
-
image: ruby:2.
|
8
|
+
image: ruby:2.5
|
9
9
|
|
10
|
-
|
11
|
-
stage: test
|
12
|
-
tags:
|
13
|
-
- ruby
|
14
|
-
script:
|
15
|
-
- "bundle exec rake spec"
|
16
|
-
image: ruby:1.9.3
|
17
|
-
allow_failure: true
|
18
|
-
|
19
|
-
ruby2.0:
|
20
|
-
stage: test
|
21
|
-
tags:
|
22
|
-
- ruby
|
23
|
-
script:
|
24
|
-
- "bundle exec rake spec"
|
25
|
-
image: ruby:2.0
|
26
|
-
|
27
|
-
ruby2.1:
|
10
|
+
ruby2.3:
|
28
11
|
stage: test
|
29
12
|
tags:
|
30
13
|
- ruby
|
31
14
|
script:
|
32
15
|
- "bundle exec rake spec"
|
33
|
-
image: ruby:2.
|
16
|
+
image: ruby:2.3
|
34
17
|
|
35
|
-
ruby2.
|
18
|
+
ruby2.4:
|
36
19
|
stage: test
|
37
20
|
tags:
|
38
21
|
- ruby
|
39
22
|
script:
|
40
23
|
- "bundle exec rake spec"
|
41
|
-
image: ruby:2.
|
24
|
+
image: ruby:2.4
|
42
25
|
|
43
|
-
ruby2.
|
26
|
+
ruby2.5:
|
44
27
|
stage: test
|
45
28
|
tags:
|
46
29
|
- ruby
|
47
30
|
script:
|
48
31
|
- "bundle exec rake spec"
|
49
|
-
image: ruby:2.
|
32
|
+
image: ruby:2.5
|
50
33
|
|
51
34
|
stages:
|
52
35
|
- validate
|
data/CHANGELOG.md
CHANGED
@@ -2,111 +2,155 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 1.7.0
|
6
|
+
|
7
|
+
- Replaces trollop with optimist
|
8
|
+
|
5
9
|
## 1.6.1
|
6
10
|
|
7
11
|
### Bug Fixes
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
12
|
+
|
13
|
+
- Require the base generator for module data
|
14
|
+
- Fixes #85 - native functions do not contain module name
|
15
|
+
- Fixes #92 - that requires throws errors
|
16
|
+
- Fixes #93 - native functions spec tests contain full namespaced name
|
17
|
+
- Fixes #87 - evaluation fails when parameters have logic
|
18
|
+
|
13
19
|
## 1.6.0
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
|
21
|
+
- Fixes #77 - class requirements is not coded correctly
|
22
|
+
- Fixes #75 - pdk cannot include retrospec due to character limit
|
23
|
+
- Fixes #80 - update vendored puppet gem to v4.10.x from 4.5.x
|
24
|
+
- Fixes #72 - create spec files that conform to rubocop [@b4ldr]
|
25
|
+
- Removes ci tags that pinned to ruby2.2 when testing
|
26
|
+
- Fixes #81 - pass correct git ref [@witjoh]
|
27
|
+
- Fixes #74 - parameters with a default value of arrays cause error
|
28
|
+
- Adds more documentation to methods
|
29
|
+
- Fixes timestamp bug when creating the gem in rubygems.org
|
30
|
+
|
23
31
|
## 1.5.0
|
24
|
-
|
32
|
+
|
33
|
+
- Adds ability to generate bolt tasks for puppet modules
|
34
|
+
|
25
35
|
## 1.4.1
|
26
|
-
|
36
|
+
|
37
|
+
- Adds real module data to common.yaml
|
38
|
+
|
27
39
|
## 1.4.0
|
28
|
-
|
29
|
-
|
40
|
+
|
41
|
+
- Fixes gh-67 - adds abiltity to auto generate data in a module
|
42
|
+
- Forces retrospec version 0.6.2 or greater
|
43
|
+
|
30
44
|
## 1.3.2
|
31
|
-
|
45
|
+
|
46
|
+
- Fixes gh-70 - Finding puppetfiles in nested folders
|
47
|
+
|
32
48
|
## 1.3.1
|
33
|
-
|
49
|
+
|
50
|
+
- adds ability to sync files
|
51
|
+
|
34
52
|
## 1.3.0
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
53
|
+
|
54
|
+
- fixes gh-68 - add ability to overwrite generated files
|
55
|
+
- updates README
|
56
|
+
- removes old rakefile code
|
57
|
+
- bumps retrospec gem to 0.5
|
58
|
+
|
39
59
|
## 1.2.1
|
40
|
-
|
60
|
+
|
61
|
+
- fix conditional logic preventing hooks from running
|
62
|
+
|
41
63
|
## 1.2.0
|
42
|
-
|
64
|
+
|
65
|
+
- fixes gh-53 - adds windows support
|
66
|
+
|
43
67
|
## 1.1.0
|
44
|
-
|
68
|
+
|
69
|
+
- fixes gh-62 - add support for creating native puppet fuctions
|
70
|
+
|
45
71
|
## 1.0.0
|
46
|
-
This is a major release which vendors the latest puppet version. The core parser
|
47
|
-
was rewritten to use the new puppet parser and opens up a bunch of new possibilities
|
48
|
-
for generating more test coverage.
|
49
|
-
This release is a breaking release which requires your puppet code to adhere
|
50
|
-
to the new parser rules. If you are not able update your puppet code you should use the pre 1.x releases of retrospec puppet.
|
51
72
|
|
52
|
-
|
53
|
-
|
54
|
-
|
73
|
+
This is a major release which vendors the latest puppet version. The core parser
|
74
|
+
was rewritten to use the new puppet parser and opens up a bunch of new possibilities
|
75
|
+
for generating more test coverage.
|
76
|
+
This release is a breaking release which requires your puppet code to adhere
|
77
|
+
to the new parser rules. If you are not able update your puppet code you should use the pre 1.x releases of retrospec puppet.
|
78
|
+
|
79
|
+
- Fixes gh-56 - variable_value: rendering values with escapes creates invalid tests
|
80
|
+
- Fixes gh-15 - nested conditionals are not discovered
|
81
|
+
- Fixes gh-54 - Vendored puppet 3.7 doesn't work on newer rubies
|
55
82
|
|
56
83
|
## 0.12.2
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
84
|
+
|
85
|
+
- fixes issue with ruby193 and openstruct
|
86
|
+
- fix unit tests from failing on missing hook file
|
87
|
+
- group gems more intelligently for ci testing
|
88
|
+
- add better exception handling
|
89
|
+
- adds a default properties for the provider context
|
90
|
+
|
62
91
|
## 0.12.0
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
92
|
+
|
93
|
+
- fix an annoying issue when creating new modules and current directory
|
94
|
+
- gh-38 - added ability to create new types and type unit tests
|
95
|
+
- gh-39 - add functionality to create new providers
|
96
|
+
- gh-40 - add ability to generate functions
|
97
|
+
- gh-43 - add ability to create kwalify schema files
|
98
|
+
- gh-42 - continue with creating files when retrospec parser fails on invalid code
|
99
|
+
|
69
100
|
## 0.11.0
|
70
|
-
|
71
|
-
|
72
|
-
|
101
|
+
|
102
|
+
- gh-31 - add ability to generate new fact and spec tests
|
103
|
+
- add awesome_print gem
|
104
|
+
- gh-37 - move new module functionality to its own generator class
|
105
|
+
|
73
106
|
## 0.10.0
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
107
|
+
|
108
|
+
- refactor cli options to use retrospec 0.4.0 specifications
|
109
|
+
- gh-32 - add ability to create new module
|
110
|
+
- fix pinning of module to use 0.x.0 instead of 0.x
|
111
|
+
- pin to version 0.4.x
|
112
|
+
|
78
113
|
## 0.9.0
|
79
|
-
|
80
|
-
|
114
|
+
|
115
|
+
- convert to retrospec plugin
|
116
|
+
This is a big change in how you run puppet-retrospec please see the readme for changes.
|
81
117
|
|
82
118
|
## 0.8.1
|
83
|
-
|
119
|
+
|
120
|
+
- gh-30 - add support for host resource types
|
121
|
+
|
84
122
|
## 0.8.0
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
123
|
+
|
124
|
+
- enable broader support for future parser
|
125
|
+
- remove hiera and facter dependencies
|
126
|
+
- added support for running pre and post hooks gh-27
|
127
|
+
- added support for running a hook to clone external templates
|
128
|
+
- externalized the templates into their own repo gh-26
|
129
|
+
- handle symlinks in the templates directory correctly gh-28
|
91
130
|
|
92
131
|
## 0.7.3
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
132
|
+
|
133
|
+
- added hiera data helper to fill in all the auto bindable class params in shared_contexts
|
134
|
+
- updated hiera data gem to newer fork that works with puppet 3.5+
|
135
|
+
- minor fixes in templates
|
136
|
+
- added vagrantfile for easier manual integration testing
|
97
137
|
|
98
138
|
## 0.7.2
|
99
|
-
|
139
|
+
|
140
|
+
- vendor the puppet gem
|
100
141
|
|
101
142
|
## 0.7.0
|
102
|
-
|
103
|
-
|
143
|
+
|
144
|
+
- gh-18 puppet 4 code syntax does not work
|
145
|
+
- gh-10 safe file creation should use colors
|
104
146
|
|
105
147
|
## 0.6.1
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
148
|
+
|
149
|
+
- gh-12 - allow new templates to be easily added without changing code
|
150
|
+
- gh-8 - tests are not created when manifest is invalid
|
151
|
+
- updated README based on apache example
|
152
|
+
- updated templates to fix minor errors
|
110
153
|
|
111
154
|
## 0.6.0
|
155
|
+
|
112
156
|
Initial release that was deemed worthy.
|
data/Gemfile
CHANGED
@@ -2,8 +2,8 @@ source 'http://rubygems.org'
|
|
2
2
|
|
3
3
|
gem 'awesome_print'
|
4
4
|
gem 'facets'
|
5
|
-
gem 'retrospec', '
|
6
|
-
gem '
|
5
|
+
gem 'retrospec', git: 'https://github.com/nwops/retrospec.git'
|
6
|
+
gem 'optimist', '~> 3.0.0'
|
7
7
|
|
8
8
|
group :development do
|
9
9
|
gem 'pry'
|
@@ -12,7 +12,7 @@ group :development do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
group :test do
|
15
|
-
gem 'bundler', '~>
|
15
|
+
gem 'bundler', '~> 2.0'
|
16
16
|
gem 'fakefs', :require => 'fakefs/safe'
|
17
17
|
gem 'json_pure', '= 2.0.1' # force this gem as 2.0.2 requires ruby > 2.0.0
|
18
18
|
gem 'puppet', '4.10.8', :path => 'vendor/pup410'
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,18 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/nwops/retrospec.git
|
3
|
+
revision: b390da6a7e1d2b7cd5a1b38848dd69b375ee6b63
|
4
|
+
specs:
|
5
|
+
retrospec (0.7.0)
|
6
|
+
optimist (~> 3.0.0)
|
7
|
+
|
1
8
|
PATH
|
2
9
|
remote: .
|
3
10
|
specs:
|
4
|
-
puppet-retrospec (1.
|
11
|
+
puppet-retrospec (1.7.0)
|
5
12
|
awesome_print
|
6
13
|
facets
|
7
|
-
|
8
|
-
|
14
|
+
optimist (~> 3.0.0)
|
15
|
+
retrospec (~> 0.7.0)
|
9
16
|
|
10
17
|
PATH
|
11
18
|
remote: vendor/pup410
|
@@ -15,82 +22,80 @@ PATH
|
|
15
22
|
GEM
|
16
23
|
remote: http://rubygems.org/
|
17
24
|
specs:
|
18
|
-
ast (2.
|
19
|
-
awesome_print (1.
|
20
|
-
childprocess (0.
|
25
|
+
ast (2.4.0)
|
26
|
+
awesome_print (1.8.0)
|
27
|
+
childprocess (0.9.0)
|
21
28
|
ffi (~> 1.0, >= 1.0.11)
|
22
|
-
coderay (1.1.
|
23
|
-
diff-lcs (1.
|
29
|
+
coderay (1.1.2)
|
30
|
+
diff-lcs (1.3)
|
24
31
|
facets (3.1.0)
|
25
|
-
facter (2.
|
26
|
-
fakefs (0.
|
27
|
-
ffi (1.
|
28
|
-
iniparse (1.4.
|
29
|
-
|
32
|
+
facter (2.5.1)
|
33
|
+
fakefs (0.20.1)
|
34
|
+
ffi (1.11.1)
|
35
|
+
iniparse (1.4.4)
|
36
|
+
jaro_winkler (1.5.3)
|
37
|
+
json (1.8.6)
|
30
38
|
json_pure (2.0.1)
|
31
|
-
method_source (0.
|
32
|
-
|
33
|
-
|
39
|
+
method_source (0.9.2)
|
40
|
+
optimist (3.0.0)
|
41
|
+
overcommit (0.48.1)
|
42
|
+
childprocess (~> 0.6, >= 0.6.3)
|
34
43
|
iniparse (~> 1.4)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
pry (0.
|
44
|
+
parallel (1.17.0)
|
45
|
+
parser (2.6.3.0)
|
46
|
+
ast (~> 2.4.0)
|
47
|
+
pry (0.12.2)
|
39
48
|
coderay (~> 1.1.0)
|
40
|
-
method_source (~> 0.
|
41
|
-
|
42
|
-
|
43
|
-
rake (11.3.0)
|
49
|
+
method_source (~> 0.9.0)
|
50
|
+
rainbow (3.0.0)
|
51
|
+
rake (12.3.2)
|
44
52
|
rdoc (3.12.2)
|
45
53
|
json (~> 1.4)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
rspec-
|
50
|
-
|
51
|
-
rspec-
|
52
|
-
rspec-
|
53
|
-
rspec-support (~> 3.5.0)
|
54
|
-
rspec-expectations (3.5.0)
|
54
|
+
rspec (3.8.0)
|
55
|
+
rspec-core (~> 3.8.0)
|
56
|
+
rspec-expectations (~> 3.8.0)
|
57
|
+
rspec-mocks (~> 3.8.0)
|
58
|
+
rspec-core (3.8.1)
|
59
|
+
rspec-support (~> 3.8.0)
|
60
|
+
rspec-expectations (3.8.4)
|
55
61
|
diff-lcs (>= 1.2.0, < 2.0)
|
56
|
-
rspec-support (~> 3.
|
57
|
-
rspec-mocks (3.
|
62
|
+
rspec-support (~> 3.8.0)
|
63
|
+
rspec-mocks (3.8.1)
|
58
64
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
-
rspec-support (~> 3.
|
60
|
-
rspec-support (3.
|
61
|
-
rubocop (0.
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
+
rspec-support (~> 3.8.0)
|
66
|
+
rspec-support (3.8.2)
|
67
|
+
rubocop (0.71.0)
|
68
|
+
jaro_winkler (~> 1.5.1)
|
69
|
+
parallel (~> 1.10)
|
70
|
+
parser (>= 2.6)
|
71
|
+
rainbow (>= 2.2.2, < 4.0)
|
65
72
|
ruby-progressbar (~> 1.7)
|
66
|
-
unicode-display_width (
|
67
|
-
ruby-progressbar (1.
|
68
|
-
|
69
|
-
|
70
|
-
unicode-display_width (1.1.1)
|
71
|
-
yard (0.9.5)
|
73
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
74
|
+
ruby-progressbar (1.10.1)
|
75
|
+
unicode-display_width (1.6.0)
|
76
|
+
yard (0.9.19)
|
72
77
|
|
73
78
|
PLATFORMS
|
74
79
|
ruby
|
75
80
|
|
76
81
|
DEPENDENCIES
|
77
82
|
awesome_print
|
78
|
-
bundler (~>
|
83
|
+
bundler (~> 2.0)
|
79
84
|
facets
|
80
85
|
facter
|
81
86
|
fakefs
|
82
87
|
json_pure (= 2.0.1)
|
88
|
+
optimist (~> 3.0.0)
|
83
89
|
overcommit
|
84
90
|
pry
|
85
91
|
puppet (= 4.10.8)!
|
86
92
|
puppet-retrospec!
|
87
93
|
rake
|
88
94
|
rdoc (~> 3.12)
|
89
|
-
retrospec
|
95
|
+
retrospec!
|
90
96
|
rspec (~> 3.2)
|
91
97
|
rubocop
|
92
|
-
trollop
|
93
98
|
yard (~> 0.7)
|
94
99
|
|
95
100
|
BUNDLED WITH
|
96
|
-
|
101
|
+
2.0.1
|
@@ -20,18 +20,18 @@ module Retrospec
|
|
20
20
|
|
21
21
|
# used to display subcommand options to the cli
|
22
22
|
# the global options are passed in for your usage
|
23
|
-
# http://
|
23
|
+
# http://optimist.rubyforge.org
|
24
24
|
# all options here are available in the config passed into config object
|
25
25
|
# returns the parameters
|
26
26
|
def self.run_cli(global_opts, args=ARGV)
|
27
|
-
sub_command_opts =
|
27
|
+
sub_command_opts = Optimist.options(args) do
|
28
28
|
banner <<-EOS
|
29
29
|
""
|
30
30
|
EOS
|
31
31
|
opt :name, "The name of the item you wish to create", :type => :string, :required => true, :short => '-n'
|
32
32
|
end
|
33
33
|
unless sub_command_opts[:name]
|
34
|
-
|
34
|
+
Optimist.educate
|
35
35
|
exit 1
|
36
36
|
end
|
37
37
|
plugin_data = global_opts.merge(sub_command_opts)
|
@@ -19,10 +19,10 @@ module Retrospec
|
|
19
19
|
|
20
20
|
# used to display subcommand options to the cli
|
21
21
|
# the global options are passed in for your usage
|
22
|
-
# http://
|
22
|
+
# http://optimist.rubyforge.org
|
23
23
|
# all options here are available in the config passed into config object
|
24
24
|
def self.run_cli(global_opts, args=ARGV)
|
25
|
-
sub_command_opts =
|
25
|
+
sub_command_opts = Optimist.options(args) do
|
26
26
|
banner <<-EOS
|
27
27
|
Generates a new fact with the given name
|
28
28
|
|
@@ -30,7 +30,7 @@ Generates a new fact with the given name
|
|
30
30
|
opt :name, 'The name of the fact you wish to create', :type => :string, :require => :true, :short => '-n'
|
31
31
|
end
|
32
32
|
unless sub_command_opts[:name]
|
33
|
-
|
33
|
+
Optimist.educate
|
34
34
|
exit 1
|
35
35
|
end
|
36
36
|
plugin_data = global_opts.merge(sub_command_opts)
|
@@ -45,14 +45,14 @@ module Retrospec
|
|
45
45
|
|
46
46
|
# used to display subcommand options to the cli
|
47
47
|
# the global options are passed in for your usage
|
48
|
-
# http://
|
48
|
+
# http://optimist.rubyforge.org
|
49
49
|
# all options here are available in the config passed into config object
|
50
50
|
# returns the parameters
|
51
51
|
def self.run_cli(global_opts, args=ARGV)
|
52
52
|
func_types = %w(v3 v4 native)
|
53
53
|
func_type = global_opts['plugins::puppet::default_function_version'] || 'v4'
|
54
54
|
test_type = global_opts['plugins::puppet::default_function_test_type'] || 'rspec'
|
55
|
-
sub_command_opts =
|
55
|
+
sub_command_opts = Optimist.options(args) do
|
56
56
|
banner <<-EOS
|
57
57
|
Generates a new function with the given name.
|
58
58
|
|
@@ -67,11 +67,11 @@ Generates a new function with the given name.
|
|
67
67
|
|
68
68
|
unless func_types.include? sub_command_opts[:type].downcase
|
69
69
|
puts "Invalid type, must be one of #{func_types.join(',')}"
|
70
|
-
|
70
|
+
Optimist.educate
|
71
71
|
exit 1
|
72
72
|
end
|
73
73
|
unless sub_command_opts[:name]
|
74
|
-
|
74
|
+
Optimist.educate
|
75
75
|
exit 1
|
76
76
|
end
|
77
77
|
plugin_data = global_opts.merge(sub_command_opts)
|
@@ -74,12 +74,12 @@ module Retrospec
|
|
74
74
|
|
75
75
|
# used to display subcommand options to the cli
|
76
76
|
# the global options are passed in for your usage
|
77
|
-
# http://
|
77
|
+
# http://optimist.rubyforge.org
|
78
78
|
# all options here are available in the config passed into config object
|
79
79
|
# returns the parameters
|
80
80
|
def self.run_cli(global_opts, args = ARGV)
|
81
81
|
backend_types = %w(hiera data_hash lookup_key data_dig)
|
82
|
-
sub_command_opts =
|
82
|
+
sub_command_opts = Optimist.options(args) do
|
83
83
|
banner <<-EOS
|
84
84
|
Generate the scaffolding required to use data in a module from hiera or a custom hiera backend.
|
85
85
|
* Data in module is only available in puppet 4.7+
|
@@ -101,10 +101,10 @@ Options:
|
|
101
101
|
:type => :string, :required => false, default: 'native', :short => '-t'
|
102
102
|
end
|
103
103
|
unless backend_types.include?(sub_command_opts[:backend_type])
|
104
|
-
|
104
|
+
Optimist.die :backend_type, "must be one of #{backend_types.join(', ')}"
|
105
105
|
end
|
106
106
|
unless %w(native v4).include?(sub_command_opts[:function_type])
|
107
|
-
|
107
|
+
Optimist.die :function_type, "must be one of #{%w(native v4).join(', ')}"
|
108
108
|
end
|
109
109
|
|
110
110
|
plugin_data = global_opts.merge(sub_command_opts)
|
@@ -20,14 +20,14 @@ module Retrospec
|
|
20
20
|
|
21
21
|
# used to display subcommand options to the cli
|
22
22
|
# the global options are passed in for your usage
|
23
|
-
# http://
|
23
|
+
# http://optimist.rubyforge.org
|
24
24
|
# all options here are available in the config passed into config object
|
25
25
|
# returns a new instance of this class
|
26
26
|
def self.run_cli(global_opts, args=ARGV)
|
27
27
|
namespace = global_opts['plugins::puppet::namespace'] || 'namespace'
|
28
28
|
author = global_opts['plugins::puppet::author'] || 'author_name'
|
29
29
|
license = global_opts['plugins::puppet::default_license'] || 'Apache-2.0'
|
30
|
-
sub_command_opts =
|
30
|
+
sub_command_opts = Optimist.options(args) do
|
31
31
|
banner <<-EOS
|
32
32
|
Generates a new module with the given name and namespace
|
33
33
|
EOS
|
@@ -40,7 +40,7 @@ Generates a new module with the given name and namespace
|
|
40
40
|
opt :license, "The license type for the module", :default => license, :type => :string, :short => '-l'
|
41
41
|
end
|
42
42
|
unless sub_command_opts[:name]
|
43
|
-
|
43
|
+
Optimist.educate
|
44
44
|
exit 1
|
45
45
|
end
|
46
46
|
plugin_data = global_opts.merge(sub_command_opts)
|
@@ -34,11 +34,11 @@ module Retrospec::Puppet::Generators
|
|
34
34
|
|
35
35
|
# used to display subcommand options to the cli
|
36
36
|
# the global options are passed in for your usage
|
37
|
-
# http://
|
37
|
+
# http://optimist.rubyforge.org
|
38
38
|
# all options here are available in the config passed into config object
|
39
39
|
# returns the parameters
|
40
40
|
def self.run_cli(global_opts, args=ARGV)
|
41
|
-
sub_command_opts =
|
41
|
+
sub_command_opts = Optimist.options(args) do
|
42
42
|
banner <<-EOS
|
43
43
|
Generates a new provider with the given name.
|
44
44
|
|
@@ -47,7 +47,7 @@ Generates a new provider with the given name.
|
|
47
47
|
opt :type, 'The type name of the provider', :type => :string, :required => true, :short => '-t'
|
48
48
|
end
|
49
49
|
unless sub_command_opts[:name]
|
50
|
-
|
50
|
+
Optimist.educate
|
51
51
|
exit 1
|
52
52
|
end
|
53
53
|
plugin_data = global_opts.merge(sub_command_opts)
|
@@ -33,18 +33,18 @@ module Retrospec
|
|
33
33
|
|
34
34
|
# used to display subcommand options to the cli
|
35
35
|
# the global options are passed in for your usage
|
36
|
-
# http://
|
36
|
+
# http://optimist.rubyforge.org
|
37
37
|
# all options here are available in the config passed into config object
|
38
38
|
# returns the parameters
|
39
39
|
def self.run_cli(global_opts, args=ARGV)
|
40
|
-
sub_command_opts =
|
40
|
+
sub_command_opts = Optimist.options(args) do
|
41
41
|
banner <<-EOS
|
42
42
|
Creates a new puppet report
|
43
43
|
EOS
|
44
44
|
opt :name, "The name of the report you wish to create", :type => :string, :required => true, :short => '-n'
|
45
45
|
end
|
46
46
|
unless sub_command_opts[:name]
|
47
|
-
|
47
|
+
Optimist.educate
|
48
48
|
exit 1
|
49
49
|
end
|
50
50
|
plugin_data = global_opts.merge(sub_command_opts)
|
@@ -37,17 +37,17 @@ module Retrospec
|
|
37
37
|
|
38
38
|
# used to display subcommand options to the cli
|
39
39
|
# the global options are passed in for your usage
|
40
|
-
# http://
|
40
|
+
# http://optimist.rubyforge.org
|
41
41
|
# all options here are available in the config passed into config object
|
42
42
|
# returns the parameters
|
43
43
|
def self.run_cli(global_opts, args=ARGV)
|
44
|
-
sub_command_opts =
|
44
|
+
sub_command_opts = Optimist.options(args) do
|
45
45
|
banner <<-EOS
|
46
46
|
""
|
47
47
|
EOS
|
48
48
|
end
|
49
49
|
unless sub_command_opts[:manifest_file]
|
50
|
-
|
50
|
+
Optimist.educate
|
51
51
|
exit 1
|
52
52
|
end
|
53
53
|
plugin_data = global_opts.merge(sub_command_opts)
|
@@ -35,11 +35,11 @@ module Retrospec
|
|
35
35
|
|
36
36
|
# used to display subcommand options to the cli
|
37
37
|
# the global options are passed in for your usage
|
38
|
-
# http://
|
38
|
+
# http://optimist.rubyforge.org
|
39
39
|
# all options here are available in the config passed into config object
|
40
40
|
# returns the parameters
|
41
41
|
def self.run_cli(global_opts, args=ARGV)
|
42
|
-
sub_command_opts =
|
42
|
+
sub_command_opts = Optimist.options(args) do
|
43
43
|
banner <<-EOS
|
44
44
|
Generates a kwalify schema based off class parameters.
|
45
45
|
|
@@ -83,13 +83,13 @@ module Retrospec
|
|
83
83
|
|
84
84
|
# used to display subcommand options to the cli
|
85
85
|
# the global options are passed in for your usage
|
86
|
-
# http://
|
86
|
+
# http://optimist.rubyforge.org
|
87
87
|
# all options here are available in the config passed into config object
|
88
88
|
# returns the parameters
|
89
89
|
def self.run_cli(global_opts, args = ARGV)
|
90
90
|
task_types = %w(bash generic ruby python node powershell)
|
91
91
|
task_type = global_opts['plugins::puppet::default_task_type'] || 'bash'
|
92
|
-
sub_command_opts =
|
92
|
+
sub_command_opts = Optimist.options(args) do
|
93
93
|
banner <<-EOS
|
94
94
|
Creates a new puppet bolt task for your module
|
95
95
|
|
@@ -102,7 +102,7 @@ Example: retrospec puppet new_task -n reboot -p "name, ttl, message"
|
|
102
102
|
:default => task_type
|
103
103
|
end
|
104
104
|
unless sub_command_opts[:name]
|
105
|
-
|
105
|
+
Optimist.educate
|
106
106
|
exit 1
|
107
107
|
end
|
108
108
|
plugin_data = global_opts.merge(sub_command_opts)
|
@@ -43,11 +43,11 @@ module Retrospec
|
|
43
43
|
end
|
44
44
|
# used to display subcommand options to the cli
|
45
45
|
# the global options are passed in for your usage
|
46
|
-
# http://
|
46
|
+
# http://optimist.rubyforge.org
|
47
47
|
# all options here are available in the config passed into config object
|
48
48
|
# returns the parameters
|
49
49
|
def self.run_cli(global_opts, args=ARGV)
|
50
|
-
sub_command_opts =
|
50
|
+
sub_command_opts = Optimist.options(args) do
|
51
51
|
banner <<-EOS
|
52
52
|
Generates a new type with the given name, parameters, and properties.
|
53
53
|
|
@@ -61,7 +61,7 @@ Generates a new type with the given name, parameters, and properties.
|
|
61
61
|
:default => ['default'], :required => false
|
62
62
|
end
|
63
63
|
unless sub_command_opts[:name]
|
64
|
-
|
64
|
+
Optimist.educate
|
65
65
|
exit 1
|
66
66
|
end
|
67
67
|
plugin_data = global_opts.merge(sub_command_opts)
|
@@ -90,7 +90,7 @@ module Retrospec
|
|
90
90
|
|
91
91
|
# used to display subcommand options to the global_config cli
|
92
92
|
# the global options are passed in for your usage
|
93
|
-
# http://
|
93
|
+
# http://optimist.rubyforge.org
|
94
94
|
# all options here are available in the config passed into the initialize code
|
95
95
|
# this is the only entry point into the plugin
|
96
96
|
# @param global_opts [Hash] - the global options for retrospec supplied on the cli
|
@@ -111,7 +111,7 @@ module Retrospec
|
|
111
111
|
else
|
112
112
|
sub_command_help = ''
|
113
113
|
end
|
114
|
-
plugin_opts =
|
114
|
+
plugin_opts = Optimist.options(args) do
|
115
115
|
version "Retrospec puppet plugin: #{Retrospec::Puppet::VERSION} (c) Corey Osman at NWOPS, LLC"
|
116
116
|
banner <<-EOS
|
117
117
|
Generates puppet rspec test code and puppet module components.
|
data/puppet-retrospec.gemspec
CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.licenses = ["MIT"]
|
24
24
|
s.rubygems_version = "2.4.5.1"
|
25
25
|
s.summary = "Generates puppet rspec test code based on the classes and defines inside the manifests directory. Aims to reduce some of the boilerplate coding with default test patterns."
|
26
|
-
s.add_runtime_dependency(%q<
|
27
|
-
s.add_runtime_dependency(%q<retrospec>, ["
|
26
|
+
s.add_runtime_dependency(%q<optimist>, ["~> 3.0.0"])
|
27
|
+
s.add_runtime_dependency(%q<retrospec>, ["~> 0.7.0"])
|
28
28
|
s.add_runtime_dependency(%q<awesome_print>, [">= 0"])
|
29
29
|
s.add_runtime_dependency(%q<facets>, [">= 0"])
|
30
30
|
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
@@ -130,7 +130,9 @@ describe Retrospec::Puppet::Generators::AcceptanceGenerator do
|
|
130
130
|
File.join(spec_files_path, 'array_param_spec.rb'),
|
131
131
|
File.join(spec_files_path, 'sub', 'settings_spec.rb'),
|
132
132
|
File.join(spec_files_path, 'sub', 'settings_define_spec.rb'),
|
133
|
-
File.join(spec_files_path, 'params_spec.rb')
|
133
|
+
File.join(spec_files_path, 'params_spec.rb'),
|
134
|
+
File.join(spec_files_path, 'parameter_logic_spec.rb')
|
135
|
+
|
134
136
|
]
|
135
137
|
end
|
136
138
|
it 'should generate a bunch of files' do
|
@@ -33,7 +33,8 @@ describe Retrospec::Puppet::Generators::ResourceBaseGenerator do
|
|
33
33
|
File.join(spec_files_path, 'classes', 'array_param_spec.rb'),
|
34
34
|
File.join(spec_files_path, 'classes', 'sub', 'settings_spec.rb'),
|
35
35
|
File.join(spec_files_path, 'defines', 'sub', 'settings_define_spec.rb'),
|
36
|
-
File.join(spec_files_path, '
|
36
|
+
File.join(spec_files_path, 'classes', 'parameter_logic_spec.rb'),
|
37
|
+
File.join(spec_files_path, 'defines', 'one_define_spec.rb')]
|
37
38
|
end
|
38
39
|
|
39
40
|
it 'should generate a bunch of files' do
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-retrospec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Osman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: optimist
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: retrospec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.7.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.7.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: awesome_print
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -364,7 +364,6 @@ files:
|
|
364
364
|
- spec/fixtures/modules/stdlib/tests/has_ip_address.pp
|
365
365
|
- spec/fixtures/modules/stdlib/tests/has_ip_network.pp
|
366
366
|
- spec/fixtures/modules/stdlib/tests/init.pp
|
367
|
-
- spec/fixtures/modules/tomcat/.bundle/config
|
368
367
|
- spec/fixtures/modules/tomcat/.gitignore
|
369
368
|
- spec/fixtures/modules/tomcat/.puppet-lint.rc
|
370
369
|
- spec/fixtures/modules/tomcat/.travis.yml
|
@@ -1613,8 +1612,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1613
1612
|
- !ruby/object:Gem::Version
|
1614
1613
|
version: '0'
|
1615
1614
|
requirements: []
|
1616
|
-
|
1617
|
-
rubygems_version: 2.6.11
|
1615
|
+
rubygems_version: 3.0.4
|
1618
1616
|
signing_key:
|
1619
1617
|
specification_version: 4
|
1620
1618
|
summary: Generates puppet rspec test code based on the classes and defines inside
|