puppet-strings 2.7.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: decf380cb5cb58228eead7c8cc9c59d9ce144b608d939c258d56ebb268086c09
4
- data.tar.gz: 62254e20387c9172de91b8bd6e2623ac000a6f11c568805da7805ca1526d6def
3
+ metadata.gz: a2d5345c5e091cd9e41b404f7529168e8e10b737d26b3b1b9a5a5bfbf118e062
4
+ data.tar.gz: 0bddf9dac1b890e8b487e261fd5eec2b3df45eecbc400af22602c1aac29aa99e
5
5
  SHA512:
6
- metadata.gz: 05c877672e2f7c4d803db4e3d4c24371655336647fd9862319c5b0ba89d36710758cd03677792a91c843fd6150b70d1bb3c3a01d4343be46ceec76549c32426f
7
- data.tar.gz: 3d3a7dae2b4e4eaac710b403a291d3a5623c22250f328619cabf68f205c2ff68110cd9e9d345d1db7b0301b9a4c07349674f8f59fac9bc244baf538e2f5531a3
6
+ metadata.gz: 6399094f9117b6966c7b91f4ec6438f6877faf0b25ab7f2b322957f1cf81719ddae70357d32d252a7276f9795f9bce6305b8c999f1f853ec83dbd35131030d99
7
+ data.tar.gz: faef11c0d37eb368b8e36a6bc7743669a7ad184893c969317434711ae13e6513e033393eb9b64e33f6d6e16f9bd0ff46dc4a784ba0ec574d398896c5b2dea095
data/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
3
3
  All significant changes to this repo will be summarized in this file.
4
4
 
5
5
 
6
+ ## [v2.8.0](https://github.com/puppetlabs/puppet-strings/tree/v2.8.0) (2021-07-19)
7
+
8
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.7.0...v2.8.0)
9
+
10
+ Added
11
+
12
+ - \(DOCUMENT-1232\) Add support for ensurable in types\_extras\_handler [\#281](https://github.com/puppetlabs/puppet-strings/pull/281) ([joshcooper](https://github.com/joshcooper))
13
+
14
+ **Merged pull requests:**
15
+
16
+ - \(FIXUP\) Check for nil before injecting provider param into Types [\#285](https://github.com/puppetlabs/puppet-strings/pull/285) ([scotje](https://github.com/scotje))
17
+ - README.md: update link to docs [\#276](https://github.com/puppetlabs/puppet-strings/pull/276) ([kenyon](https://github.com/kenyon))
18
+
6
19
  ## [v2.7.0](https://github.com/puppetlabs/puppet-strings/tree/v2.7.0) (2021-05-17)
7
20
 
8
21
  [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.6.0...v2.7.0)
data/README.md CHANGED
@@ -62,7 +62,7 @@ See the [Puppet Strings documentation](https://puppet.com/docs/puppet/latest/pup
62
62
 
63
63
  Here are a few other good resources for getting started with documentation:
64
64
 
65
- * [Module README Template](https://docs.puppet.com/puppet/latest/reference/modules_documentation.html)
65
+ * [Module README Template](https://puppet.com/docs/puppet/latest/puppet_strings.html)
66
66
  * [YARD Getting Started Guide](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md)
67
67
  * [YARD Tags Overview](http://www.rubydoc.info/gems/yard/file/docs/Tags.md)
68
68
 
@@ -98,14 +98,14 @@ An example of running the acceptance tests locally with Docker:
98
98
  3. Provision a docker container, in this case CentOS 7
99
99
 
100
100
  ``` text
101
- $ bundle exec rake litmus:provision[docker, centos:7]
101
+ $ bundle exec rake 'litmus:provision[docker, centos:7]'
102
102
  ```
103
103
 
104
104
  4. Install test items; Puppet Agent, our test module, and the puppet-strings gem built from this source code
105
105
 
106
106
  ``` text
107
- $ bundle exec rake litmus:install_agent[puppet6]
108
- $ bundle exec rake litmus:install_module_fixtures
107
+ $ bundle exec rake 'litmus:install_agent[puppet6]'
108
+ $ bundle exec rake 'litmus:install_modules_from_directory[./spec/fixtures/acceptance/modules]'
109
109
  $ bundle exec rake litmus:install_gems
110
110
  ```
111
111
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PuppetStrings
4
- VERSION = '2.7.0'
4
+ VERSION = '2.8.0'
5
5
  end
@@ -152,7 +152,7 @@ class PuppetStrings::Yard::CodeObjects::Type < PuppetStrings::Yard::CodeObjects:
152
152
  return @parameters if providers.empty?
153
153
 
154
154
  # return existing params if we have already added provider
155
- return @parameters if @parameters.any? { |p| p.name == 'provider' }
155
+ return @parameters if @parameters&.any? { |p| p.name == 'provider' }
156
156
 
157
157
  provider_param = Parameter.new(
158
158
  'provider',
@@ -160,6 +160,7 @@ class PuppetStrings::Yard::CodeObjects::Type < PuppetStrings::Yard::CodeObjects:
160
160
  "to specify this --- Puppet will usually discover the appropriate provider for your platform."
161
161
  )
162
162
 
163
+ @parameters ||= []
163
164
  @parameters << provider_param
164
165
  end
165
166
 
@@ -5,7 +5,7 @@ require 'puppet-strings/yard/handlers/ruby/type_base'
5
5
  require 'puppet-strings/yard/code_objects'
6
6
  require 'puppet-strings/yard/util'
7
7
 
8
- # Implements the handler for Puppet resource type newparam/newproperty calls written in Ruby.
8
+ # Implements the handler for Puppet resource type newparam/newproperty/ensurable calls written in Ruby.
9
9
  class PuppetStrings::Yard::Handlers::Ruby::TypeExtrasHandler < PuppetStrings::Yard::Handlers::Ruby::TypeBase
10
10
  # The default docstring when ensurable is used without given a docstring.
11
11
  DEFAULT_ENSURABLE_DOCSTRING = 'The basic property that the resource should be in.'
@@ -13,6 +13,7 @@ class PuppetStrings::Yard::Handlers::Ruby::TypeExtrasHandler < PuppetStrings::Ya
13
13
  namespace_only
14
14
  handles method_call(:newparam)
15
15
  handles method_call(:newproperty)
16
+ handles method_call(:ensurable)
16
17
 
17
18
  process do
18
19
 
@@ -38,9 +39,15 @@ class PuppetStrings::Yard::Handlers::Ruby::TypeExtrasHandler < PuppetStrings::Ya
38
39
  method1_name = statement[0].children.drop(1).find{ |c| c.type == :ident }.source
39
40
  return unless ['Type', 'Puppet::Type'].include?(module_name) && method1_name == 'type'
40
41
 
42
+ # ensurable is syntatic sugar for newproperty
41
43
  typename = get_name(statement[0], 'Puppet::Type.type')
42
- method2_name = caller_method
43
- propertyname = get_name(statement, "Puppet::Type.type().#{method2_name}")
44
+ if caller_method == 'ensurable'
45
+ method2_name = 'newproperty'
46
+ propertyname = 'ensure'
47
+ else
48
+ method2_name = caller_method
49
+ propertyname = get_name(statement, "Puppet::Type.type().#{method2_name}")
50
+ end
44
51
 
45
52
  typeobject = get_type_yard_object(typename)
46
53
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-strings
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-17 00:00:00.000000000 Z
11
+ date: 2021-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard