ruby-pwsh 1.2.3 → 2.0.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: 0fef17470ea141631393a6cac8223b5a8434b2eb635322c800dcb631b4346e23
4
- data.tar.gz: '01540184072d233ea41bda8c83ad78206c109deaeabf993e58c0fc186c899148'
3
+ metadata.gz: 696f0411f70a59f1e487088dd2e90c6f16c66949f7872c05d29ac53a5e86cc65
4
+ data.tar.gz: 7c2e373fe612fedc43a84b85afd267239de4fff91e5e5a12dc89de3fa8896231
5
5
  SHA512:
6
- metadata.gz: 7c6560622e733169f212d9d3b00a630f5f874442b9eee08fdd4d67353da19dd7a59b946c2936a771f49bce1e9e245b08a66182e4d437c405de77d1c73ef675bd
7
- data.tar.gz: 8c249190c38f398499ed94296e76914cd0a7d0a7a12917c7063284cb0aed8a7251bcadceb753c1d20b213c361985cf78f66cc1d7471eae1e6fbe2f681426b01a
6
+ metadata.gz: 1fffcd2e377099b3a2d4b58787ce5d899f21c613f6a81c66ca0c555a7bcc3c02ec22514850aa60bcb56681cdf156ac86727a3c795e8f527a5c08c56a84d5dd1b
7
+ data.tar.gz: e32671cf64bd4cd3fecb838ce913c345a5169500a5c5698dc1acbec738e611fbe36e40e84d39ccd6a93aa703b80abaf343ced4da7bb5d655f2a68fe3e9868219
data/.rubocop.yml CHANGED
@@ -12,7 +12,7 @@ AllCops:
12
12
  - vendor/bundle/**/*
13
13
  NewCops: enable
14
14
  SuggestExtensions: false
15
- TargetRubyVersion: '2.7'
15
+ TargetRubyVersion: '3.1'
16
16
 
17
17
  # Disabled
18
18
  Style/ClassAndModuleChildren:
@@ -80,7 +80,7 @@ class Puppet::Provider::DscBaseProvider # rubocop:disable Metrics/ClassLength
80
80
  downcased_result = recursively_downcase(canonicalized)
81
81
  downcased_resource = recursively_downcase(r)
82
82
  # Ensure that metaparameters are preserved when we canonicalize the resource.
83
- metaparams = downcased_resource.select { |key, _value| Puppet::Type.metaparam?(key) }
83
+ metaparams = r.select { |key, _value| Puppet::Type.metaparam?(key) }
84
84
  canonicalized.merge!(metaparams) unless metaparams.nil?
85
85
  downcased_result.each do |key, value|
86
86
  # Canonicalize to the manifest value unless the downcased strings match and the attribute is not an enum:
@@ -384,8 +384,8 @@ class Puppet::Provider::DscBaseProvider # rubocop:disable Metrics/ClassLength
384
384
  # Canonicalize the results to match the type definition representation;
385
385
  # failure to do so will prevent the resource_api from comparing the result
386
386
  # to the should hash retrieved from the resource definition in the manifest.
387
- data.keys.each do |key| # rubocop:disable Style/HashEachMethods
388
- type_key = "dsc_#{key.downcase}".to_sym
387
+ data.keys.each do |key|
388
+ type_key = :"dsc_#{key.downcase}"
389
389
  data[type_key] = data.delete(key)
390
390
 
391
391
  # Special handling for CIM Instances
@@ -598,7 +598,7 @@ class Puppet::Provider::DscBaseProvider # rubocop:disable Metrics/ClassLength
598
598
  # @param enumerable [Enumerable] a string, array, hash, or other object to attempt to recursively downcase
599
599
  def downcase_hash_keys!(enumerable)
600
600
  if enumerable.is_a?(Hash)
601
- enumerable.keys.each do |key| # rubocop:disable Style/HashEachMethods
601
+ enumerable.keys.each do |key|
602
602
  name = key.dup.downcase
603
603
  enumerable[name] = enumerable.delete(key)
604
604
  downcase_hash_keys!(enumerable[name]) if enumerable[name].is_a?(Enumerable)
@@ -1063,7 +1063,7 @@ class Puppet::Provider::DscBaseProvider # rubocop:disable Metrics/ClassLength
1063
1063
  # With multiple methods which need to discover secrets it is necessary to keep a single regex
1064
1064
  # which can discover them. This will lazily match everything in a single-quoted string which
1065
1065
  # ends with the secret postfix id and mark the actual contents of the string as the secret.
1066
- SECRET_DATA_REGEX = /'(?<secret>[^']+)+?#{Regexp.quote(SECRET_POSTFIX)}'/.freeze
1066
+ SECRET_DATA_REGEX = /'(?<secret>[^']+)+?#{Regexp.quote(SECRET_POSTFIX)}'/
1067
1067
 
1068
1068
  # Strings containing sensitive data have a secrets postfix. These strings cannot be passed
1069
1069
  # directly either to debug streams or to PowerShell and must be handled; this method contains
data/lib/pwsh/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Pwsh
4
4
  # The version of the ruby-pwsh gem
5
- VERSION = '1.2.3'
5
+ VERSION = '2.0.0'
6
6
  end
data/lib/pwsh.rb CHANGED
@@ -68,9 +68,9 @@ module Pwsh
68
68
  #
69
69
  # @return [Bool] true if enabled
70
70
  def self.win32console_enabled?
71
- @win32console_enabled ||= defined?(Win32) &&
72
- defined?(Win32::Console) &&
73
- Win32::Console.instance_of?(Class)
71
+ @win32console_enabled ||=
72
+ defined?(Win32::Console) &&
73
+ Win32::Console.instance_of?(Class)
74
74
  end
75
75
 
76
76
  # TODO: This thing isn't called anywhere and the variable it sets is never referenced...
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-pwsh
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-18 00:00:00.000000000 Z
11
+ date: 2025-05-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: PowerShell code manager for ruby.
14
14
  email:
@@ -51,6 +51,7 @@ metadata:
51
51
  homepage_uri: https://github.com/puppetlabs/ruby-pwsh
52
52
  source_code_uri: https://github.com/puppetlabs/ruby-pwsh
53
53
  changelog_uri: https://github.com/puppetlabs/ruby-pwsh
54
+ rubygems_mfa_required: 'true'
54
55
  post_install_message:
55
56
  rdoc_options: []
56
57
  require_paths:
@@ -59,14 +60,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
60
  requirements:
60
61
  - - ">="
61
62
  - !ruby/object:Gem::Version
62
- version: 2.7.0
63
+ version: 3.1.0
63
64
  required_rubygems_version: !ruby/object:Gem::Requirement
64
65
  requirements:
65
66
  - - ">="
66
67
  - !ruby/object:Gem::Version
67
68
  version: '0'
68
69
  requirements: []
69
- rubygems_version: 3.1.6
70
+ rubygems_version: 3.3.27
70
71
  signing_key:
71
72
  specification_version: 4
72
73
  summary: PowerShell code manager for ruby.