immutable_struct_ex_redactable 1.3.3 → 1.3.4

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: 239f6572810600a88955cba831e0689de109f800dd329bf87bc716f073ca2de6
4
- data.tar.gz: e67a56c48cf5289919b754cf7ca562d4929dcfe52c50780d743e393d070942ac
3
+ metadata.gz: 513a14fe6adbe75b761cec89f28ba1528c3001224a22da963bbe2c942d12f400
4
+ data.tar.gz: 534bed4b462d529d81e551ecfd3edab852766e42ca7f00ca44275192dea83e33
5
5
  SHA512:
6
- metadata.gz: b4e62ce4e944d6b3a3def66565c2af9eb8e13fc76eb4ea9f287ff0c91ded1070597779b0c9dce0de22127fbb9cd1a52a338cd5e15312903a3712eeac7f8a5884
7
- data.tar.gz: 72c1560a60a83f33e2795db5f577dc811a8dcb9087565d56f082c04c33c4eb9eeff588711bb73506943bbf524643f66273a0edecff5bc6625c5bd33148fe072e
6
+ metadata.gz: 338ca6a91a1aad28d5efc5ae5590e8670f94250846617b31b1263b1ac663903cc8e8107eab14d75e1d4228c17a41b76488ca82b5ae630ed333202afe94b428b6
7
+ data.tar.gz: b06a44fce14f2fab25ecca9cad42678680ae1a85e1335b786e74a725a02661bbeb84d85aa80e22e82fb20c3cf8fd27eb18891af4ca00222cb49aecd9ab67376b
data/.rubocop.yml CHANGED
@@ -184,3 +184,12 @@ Style/StringMethods:
184
184
  # Checks for use of parentheses around ternary conditions.
185
185
  Style/TernaryParentheses:
186
186
  EnforcedStyle: require_parentheses_when_complex
187
+
188
+ NestedGroups:
189
+ Max: 4
190
+
191
+ MultipleMemoizedHelpers:
192
+ Max: 6
193
+
194
+ ExampleLength:
195
+ Max: 6
data/CHANGELOG.md CHANGED
@@ -1,9 +1,19 @@
1
+ ## [1.3.4] - 2023-12-27
2
+
3
+ Changes
4
+
5
+ - Add github actions to run tests and rubocop.
6
+ - DRY up code in immutable_struct_ex_redactable/redacted_accessible.rb.
7
+ - Ruby gem updates.
8
+ - Fix rubocop violations.
9
+ - Add some rubocop rules.
10
+
1
11
  ## [1.3.3] - 2023-12-02
2
12
 
3
13
  Changes
4
14
 
5
15
  - Ruby gem updates.
6
- - Fix rubocop violations
16
+ - Fix rubocop violations.
7
17
 
8
18
  ## [1.3.2] - 2023-12-02
9
19
 
data/Gemfile CHANGED
@@ -5,9 +5,12 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in immutable_struct_ex_redactable.gemspec
6
6
  gemspec
7
7
 
8
- gem 'pry-byebug', '>= 3.9', '< 4.0'
9
- gem 'rake', '~> 13.0'
10
- gem 'reek', '~> 6.1'
11
- gem 'rspec', '>= 3.12', '< 4.0'
12
- gem 'rubocop', '>= 1.56.0', '< 2.0'
13
- gem 'simplecov', '>= 0.22.0', '< 1.0'
8
+ gem 'bundler', '~> 2.4', '>= 2.4.21'
9
+ gem 'pry-byebug', '~> 3.9'
10
+ gem 'rake', '~> 13.0', '>= 13.0.6'
11
+ gem 'reek', '~> 6.1', '>= 6.1.1'
12
+ gem 'rspec', '>= 3.10'
13
+ gem 'rubocop', '~> 1.35'
14
+ gem 'rubocop-performance', '~> 1.14', '>= 1.14.3'
15
+ gem 'rubocop-rspec', '~> 2.12', '>= 2.12.1'
16
+ gem 'simplecov', '~> 0.22.0'
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- immutable_struct_ex_redactable (1.3.3)
5
- immutable_struct_ex (~> 1.0, >= 1.0.1)
4
+ immutable_struct_ex_redactable (1.3.4)
5
+ immutable_struct_ex (~> 1.0, >= 1.0.5)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -12,12 +12,12 @@ GEM
12
12
  coderay (1.1.3)
13
13
  diff-lcs (1.5.0)
14
14
  docile (1.4.0)
15
- immutable_struct_ex (1.0.4)
16
- json (2.7.0)
15
+ immutable_struct_ex (1.0.5)
16
+ json (2.7.1)
17
17
  kwalify (0.7.2)
18
18
  language_server-protocol (3.17.0.3)
19
19
  method_source (1.0.0)
20
- parallel (1.23.0)
20
+ parallel (1.24.0)
21
21
  parser (3.2.2.4)
22
22
  ast (~> 2.4.1)
23
23
  racc
@@ -34,7 +34,7 @@ GEM
34
34
  kwalify (~> 0.7.0)
35
35
  parser (~> 3.2.0)
36
36
  rainbow (>= 2.0, < 4.0)
37
- regexp_parser (2.8.2)
37
+ regexp_parser (2.8.3)
38
38
  rexml (3.2.6)
39
39
  rspec (3.12.0)
40
40
  rspec-core (~> 3.12.0)
@@ -49,7 +49,7 @@ GEM
49
49
  diff-lcs (>= 1.2.0, < 2.0)
50
50
  rspec-support (~> 3.12.0)
51
51
  rspec-support (3.12.1)
52
- rubocop (1.58.0)
52
+ rubocop (1.59.0)
53
53
  json (~> 2.3)
54
54
  language_server-protocol (>= 3.17.0)
55
55
  parallel (~> 1.10)
@@ -62,6 +62,17 @@ GEM
62
62
  unicode-display_width (>= 2.4.0, < 3.0)
63
63
  rubocop-ast (1.30.0)
64
64
  parser (>= 3.2.1.0)
65
+ rubocop-capybara (2.19.0)
66
+ rubocop (~> 1.41)
67
+ rubocop-factory_bot (2.24.0)
68
+ rubocop (~> 1.33)
69
+ rubocop-performance (1.20.1)
70
+ rubocop (>= 1.48.1, < 2.0)
71
+ rubocop-ast (>= 1.30.0, < 2.0)
72
+ rubocop-rspec (2.25.0)
73
+ rubocop (~> 1.40)
74
+ rubocop-capybara (~> 2.17)
75
+ rubocop-factory_bot (~> 2.22)
65
76
  ruby-progressbar (1.13.0)
66
77
  simplecov (0.22.0)
67
78
  docile (~> 1.1)
@@ -77,13 +88,16 @@ PLATFORMS
77
88
  x86_64-linux
78
89
 
79
90
  DEPENDENCIES
91
+ bundler (~> 2.4, >= 2.4.21)
80
92
  immutable_struct_ex_redactable!
81
- pry-byebug (>= 3.9, < 4.0)
82
- rake (~> 13.0)
83
- reek (~> 6.1)
84
- rspec (>= 3.12, < 4.0)
85
- rubocop (>= 1.56.0, < 2.0)
86
- simplecov (>= 0.22.0, < 1.0)
93
+ pry-byebug (~> 3.9)
94
+ rake (~> 13.0, >= 13.0.6)
95
+ reek (~> 6.1, >= 6.1.1)
96
+ rspec (>= 3.10)
97
+ rubocop (~> 1.35)
98
+ rubocop-performance (~> 1.14, >= 1.14.3)
99
+ rubocop-rspec (~> 2.12, >= 2.12.1)
100
+ simplecov (~> 0.22.0)
87
101
 
88
102
  BUNDLED WITH
89
- 2.3.22
103
+ 2.5.3
data/README.md CHANGED
@@ -1,15 +1,6 @@
1
1
  # `immutable_struct_ex_redactable`
2
2
 
3
- [![GitHub version](http://badge.fury.io/gh/gangelo%2Fimmutable_struct_ex_redactable.svg)](https://badge.fury.io/gh/gangelo%2Fimmutable_struct_ex_redactable)
4
-
5
- [![Gem Version](https://badge.fury.io/rb/immutable_struct_ex_redactable.svg)](https://badge.fury.io/rb/immutable_struct_ex_redactable)
6
-
7
- [![](http://ruby-gem-downloads-badge.herokuapp.com/immutable_struct_ex_redactable?type=total)](http://www.rubydoc.info/gems/immutable_struct_ex_redactable/)
8
- [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/immutable_struct_ex_redactable/)
9
-
10
- [![Report Issues](https://img.shields.io/badge/report-issues-red.svg)](https://github.com/gangelo/immutable_struct_ex_redactable/issues)
11
-
12
- [![License](http://img.shields.io/badge/license-MIT-yellowgreen.svg)](#license)
3
+ [![Ruby](https://github.com/gangelo/immutable_struct_ex_redactable/actions/workflows/ruby.yml/badge.svg)](https://github.com/gangelo/immutable_struct_ex_redactable/actions/workflows/ruby.yml) [![GitHub version](http://badge.fury.io/gh/gangelo%2Fimmutable_struct_ex_redactable.svg?version=1)](https://badge.fury.io/gh/gangelo%2Fimmutable_struct_ex_redactable) [![Gem Version](https://badge.fury.io/rb/immutable_struct_ex_redactable.svg?version=1)](https://badge.fury.io/rb/immutable_struct_ex_redactable) [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/immutable_struct_ex_redactable/) [![Report Issues](https://img.shields.io/badge/report-issues-red.svg)](https://github.com/gangelo/immutable_struct_ex_redactable/issues) [![License](http://img.shields.io/badge/license-MIT-yellowgreen.svg)](#license)
13
4
 
14
5
  ## Introduction
15
6
 
@@ -10,34 +10,31 @@ module ImmutableStructExRedactable
10
10
 
11
11
  module ClassModules
12
12
  def redacted_accessible_module_for(hash:, config:)
13
+ unredacted_method_proc = method(:unredacted_attr_method)
13
14
  Module.new do
14
15
  if config.whitelist.any?
15
16
  hash.each_key do |attr|
16
17
  next if config.whitelist.include? attr
17
18
 
18
- unredacted_attr_method = "unredacted_#{attr}"
19
- code = <<~CODE
20
- def #{unredacted_attr_method}
21
- "#{hash[attr]}"
22
- end
23
- private :#{unredacted_attr_method}
24
- CODE
25
- class_eval code
19
+ class_eval unredacted_method_proc.call(attr: attr, hash: hash)
26
20
  end
27
21
  else
28
22
  config.blacklist.each do |attr|
29
- unredacted_attr_method = "unredacted_#{attr}"
30
- code = <<~CODE
31
- def #{unredacted_attr_method}
32
- "#{hash[attr]}"
33
- end
34
- private :#{unredacted_attr_method}
35
- CODE
36
- class_eval code
23
+ class_eval unredacted_method_proc.call(attr: attr, hash: hash)
37
24
  end
38
25
  end
39
26
  end
40
27
  end
28
+
29
+ def unredacted_attr_method(attr:, hash:)
30
+ unredacted_attr_method = "unredacted_#{attr}"
31
+ <<~CODE
32
+ def #{unredacted_attr_method}
33
+ "#{hash[attr]}"
34
+ end
35
+ private :#{unredacted_attr_method}
36
+ CODE
37
+ end
41
38
  end
42
39
  end
43
40
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ImmutableStructExRedactable
4
- VERSION = '1.3.3'
4
+ VERSION = '1.3.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immutable_struct_ex_redactable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gene M. Angelo, Jr.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-02 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: immutable_struct_ex
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '1.0'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 1.0.1
22
+ version: 1.0.5
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '1.0'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 1.0.1
32
+ version: 1.0.5
33
33
  description: Creates and initializes an immutable struct in one step and provides
34
34
  redaction functionality.
35
35
  email: