puppet-resource_api 1.8.18 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c0c670133fdc323f0924bf231fd59eb1d07f27ef17919b853275d0fb7cf0104
4
- data.tar.gz: f99601ad94f6d186d981efbc7b5b4ca77bc3b599ad8b8093aa669bf7454112b0
3
+ metadata.gz: 1e25dec4ab50e8a0f4bb3bb3979c13df63857a092b5c9a7a1ef9f71f85c7f518
4
+ data.tar.gz: 01b32be4792de2f82eb78b91066a6f2bb740b49a620a92f50653fe9031e10026
5
5
  SHA512:
6
- metadata.gz: 6ca81ef748e1ec292255f775922c68664360d59590c677da0cdc19fb001ea703ff89d924018e26a24234c2aebe2e3cdee2cd54250e6646daae1785f14c53df5f
7
- data.tar.gz: 143368873f583691dd5afe77e96a64008b8565eb5e1d5820b5a3c549c00954b647afa5ca67e8245c2cca7facd76288f35df91e4def3690d1e06bef5058af5c21
6
+ metadata.gz: e9845b10a4d1997ebfda6094c3a61012a4b55659b4870e966ca516b03c52e47a20b061bd47581ca0e67bb4976f797d6b271634ff761743c5b842f718fa26f630
7
+ data.tar.gz: 8387c57e4a46044c6fe301275b41856d1ce87ab0219b62bdfb5c6622593f5bfdc582ebf35cda2dfb0c2f4bb36f1b9b0075604a2baae5d53a33e14aac89c16d7d
data/CHANGELOG.md CHANGED
@@ -3,18 +3,31 @@
3
3
  All significant changes to this repo will be summarized in this file.
4
4
 
5
5
 
6
- ## [1.8.18](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.18) (2023-07-17)
6
+ ## [1.9.0](https://github.com/puppetlabs/puppet-resource_api/tree/1.9.0) (2023-08-08)
7
+
8
+ [Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.18...1.9.0)
9
+
10
+ **Implemented enhancements:**
11
+
12
+ - \(CAT-761\) Add custom\_generate as a feature [\#316](https://github.com/puppetlabs/puppet-resource_api/pull/316) ([david22swan](https://github.com/david22swan))
13
+
14
+ ## [1.8.18](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.18) (2023-07-21)
7
15
 
8
16
  [Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.16...1.8.18)
9
17
 
10
18
  **Merged pull requests:**
11
19
 
12
- - \(PA-5641\) Add release job via PR [\#321](https://github.com/puppetlabs/puppet-resource_api/pull/321) [\#322](https://github.com/puppetlabs/puppet-resource_api/pull/322) [\#323](https://github.com/puppetlabs/puppet-resource_api/pull/323) ([tvpartytonight](https://github.com/tvpartytonight))
13
- - Remove old Ruby logic from Gemfile [\#320](https://github.com/puppetlabs/puppet-resource_api/pull/320) ([mhashizume](https://github.com/mhashizume))
20
+ - \(PA-5641\) Release only to rubygems, do not bump and release [\#326](https://github.com/puppetlabs/puppet-resource_api/pull/326) ([tvpartytonight](https://github.com/tvpartytonight))
21
+ - \(PA-5641\) Prep for 1.8.18 release [\#324](https://github.com/puppetlabs/puppet-resource_api/pull/324) ([tvpartytonight](https://github.com/tvpartytonight))
22
+ - \(PA-5641\) Use new organizational token for rubygem pushing [\#323](https://github.com/puppetlabs/puppet-resource_api/pull/323) ([tvpartytonight](https://github.com/tvpartytonight))
23
+ - \(PA-5641\) prefer auto-generated GITHUB\_TOKEN [\#322](https://github.com/puppetlabs/puppet-resource_api/pull/322) ([tvpartytonight](https://github.com/tvpartytonight))
24
+ - \(PA-5641\) Add release job via PR [\#321](https://github.com/puppetlabs/puppet-resource_api/pull/321) ([tvpartytonight](https://github.com/tvpartytonight))
25
+ - \(maint\) Remove old Ruby logic from Gemfile [\#320](https://github.com/puppetlabs/puppet-resource_api/pull/320) ([mhashizume](https://github.com/mhashizume))
14
26
  - \(PA-4639\) Migrate away from AppVeyor [\#319](https://github.com/puppetlabs/puppet-resource_api/pull/319) ([mhashizume](https://github.com/mhashizume))
15
- - Don't require git [\#318](https://github.com/puppetlabs/puppet-resource_api/pull/318) ([joshcooper](https://github.com/joshcooper))
27
+ - \(maint\) Don't require git [\#318](https://github.com/puppetlabs/puppet-resource_api/pull/318) ([joshcooper](https://github.com/joshcooper))
16
28
  - \(PA-5641\) Update rspec tests with modern Ruby [\#317](https://github.com/puppetlabs/puppet-resource_api/pull/317) ([mhashizume](https://github.com/mhashizume))
17
- - Update to Mend [\#311](https://github.com/puppetlabs/puppet-resource_api/pull/311) ([cthorn42](https://github.com/cthorn42))
29
+ - \(maint\) Update to Mend [\#311](https://github.com/puppetlabs/puppet-resource_api/pull/311) ([cthorn42](https://github.com/cthorn42))
30
+ - \(packaging\) Bump to version '1.8.17' \[no-promote\] [\#301](https://github.com/puppetlabs/puppet-resource_api/pull/301) ([tvpartytonight](https://github.com/tvpartytonight))
18
31
 
19
32
  ## [1.8.16](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.16) (2022-10-03)
20
33
 
@@ -36,7 +36,7 @@ module Puppet::ResourceApi
36
36
  Puppet::ResourceApi::DataTypeHandling.validate_ensure(definition)
37
37
 
38
38
  definition[:features] ||= []
39
- supported_features = %w[supports_noop canonicalize custom_insync remote_resource simple_get_filter].freeze
39
+ supported_features = %w[supports_noop canonicalize custom_insync remote_resource simple_get_filter custom_generate].freeze
40
40
  unknown_features = definition[:features] - supported_features
41
41
  Puppet.warning("Unknown feature detected: #{unknown_features.inspect}") unless unknown_features.empty?
42
42
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Puppet
4
4
  module ResourceApi
5
- VERSION = '1.8.18'
5
+ VERSION = '1.9.0'
6
6
  end
7
7
  end
@@ -136,6 +136,23 @@ module Puppet::ResourceApi
136
136
  @rsapi_canonicalized_target_state
137
137
  end
138
138
 
139
+ # Method is used to custom generate resources which are then applied by Puppet
140
+ def generate
141
+ # If feature `custom_generate` has been set then call the generate function within the provider and return the given results
142
+ return unless type_definition&.feature?('custom_generate')
143
+ should_hash = rsapi_canonicalized_target_state
144
+ is_hash = rsapi_current_state
145
+ title = rsapi_title
146
+
147
+ # Ensure that a custom `generate` method has been created within the provider
148
+ raise(Puppet::DevError, 'No generate method found within the types provider') unless my_provider.respond_to?(:generate)
149
+ # Call the providers custom `generate` method
150
+ rules_resources = my_provider.generate(context, title, is_hash, should_hash)
151
+
152
+ # Return array of resources
153
+ rules_resources
154
+ end
155
+
139
156
  def rsapi_current_state
140
157
  refresh_current_state unless @rsapi_current_state
141
158
  @rsapi_current_state
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-resource_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.18
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Schmitt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-21 00:00:00.000000000 Z
11
+ date: 2023-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hocon