immutable_struct_ex_redactable 1.3.3 → 1.3.5

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: f94f95a1a41ffeeac4aa337656c67806605ca4248182b17bc596ef6e29e34181
4
+ data.tar.gz: cdad5b9ca3f59488f9a011dd1b7ea3268cbf7c049fc9418107f2e09fe30eb5bd
5
5
  SHA512:
6
- metadata.gz: b4e62ce4e944d6b3a3def66565c2af9eb8e13fc76eb4ea9f287ff0c91ded1070597779b0c9dce0de22127fbb9cd1a52a338cd5e15312903a3712eeac7f8a5884
7
- data.tar.gz: 72c1560a60a83f33e2795db5f577dc811a8dcb9087565d56f082c04c33c4eb9eeff588711bb73506943bbf524643f66273a0edecff5bc6625c5bd33148fe072e
6
+ metadata.gz: 10f74495673aee8e3f16fcb8e5d599007160267db6c6d4e24dd952c9e6d8a2a95427be22c61f007889ec46b2e8c209f22772b152c438cb1478b1b44c6b77d577
7
+ data.tar.gz: 3335e9926530ac235d0b3a94b006bc87328368f52ac953a0c4577c1c46015d315e822310032c9ef7dffe63f0f0bceddf4dd5ffdb7fa880c89953ec812ca74a4a
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,26 @@
1
+ ## [1.3.5] - 2024-01-07
2
+
3
+ Changes
4
+
5
+ - Relax ruby version requirement to Gem::Requirement.new(">= 3.0.1", "< 4.0").
6
+ - Ruby gem updates.
7
+
8
+ ## [1.3.4] - 2023-12-27
9
+
10
+ Changes
11
+
12
+ - Add github actions to run tests and rubocop.
13
+ - DRY up code in immutable_struct_ex_redactable/redacted_accessible.rb.
14
+ - Ruby gem updates.
15
+ - Fix rubocop violations.
16
+ - Add some rubocop rules.
17
+
1
18
  ## [1.3.3] - 2023-12-02
2
19
 
3
20
  Changes
4
21
 
5
22
  - Ruby gem updates.
6
- - Fix rubocop violations
23
+ - Fix rubocop violations.
7
24
 
8
25
  ## [1.3.2] - 2023-12-02
9
26
 
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,23 +1,51 @@
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.5)
5
+ immutable_struct_ex (~> 1.0, >= 1.0.5)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.2)
11
+ bigdecimal (3.1.5)
11
12
  byebug (11.1.3)
12
13
  coderay (1.1.3)
14
+ concurrent-ruby (1.2.2)
13
15
  diff-lcs (1.5.0)
14
16
  docile (1.4.0)
15
- immutable_struct_ex (1.0.4)
16
- json (2.7.0)
17
- kwalify (0.7.2)
17
+ dry-configurable (1.1.0)
18
+ dry-core (~> 1.0, < 2)
19
+ zeitwerk (~> 2.6)
20
+ dry-core (1.0.1)
21
+ concurrent-ruby (~> 1.0)
22
+ zeitwerk (~> 2.6)
23
+ dry-inflector (1.0.0)
24
+ dry-initializer (3.1.1)
25
+ dry-logic (1.5.0)
26
+ concurrent-ruby (~> 1.0)
27
+ dry-core (~> 1.0, < 2)
28
+ zeitwerk (~> 2.6)
29
+ dry-schema (1.13.3)
30
+ concurrent-ruby (~> 1.0)
31
+ dry-configurable (~> 1.0, >= 1.0.1)
32
+ dry-core (~> 1.0, < 2)
33
+ dry-initializer (~> 3.0)
34
+ dry-logic (>= 1.4, < 2)
35
+ dry-types (>= 1.7, < 2)
36
+ zeitwerk (~> 2.6)
37
+ dry-types (1.7.2)
38
+ bigdecimal (~> 3.0)
39
+ concurrent-ruby (~> 1.0)
40
+ dry-core (~> 1.0)
41
+ dry-inflector (~> 1.0)
42
+ dry-logic (~> 1.4)
43
+ zeitwerk (~> 2.6)
44
+ immutable_struct_ex (1.0.5)
45
+ json (2.7.1)
18
46
  language_server-protocol (3.17.0.3)
19
47
  method_source (1.0.0)
20
- parallel (1.23.0)
48
+ parallel (1.24.0)
21
49
  parser (3.2.2.4)
22
50
  ast (~> 2.4.1)
23
51
  racc
@@ -30,11 +58,12 @@ GEM
30
58
  racc (1.7.3)
31
59
  rainbow (3.1.1)
32
60
  rake (13.1.0)
33
- reek (6.1.4)
34
- kwalify (~> 0.7.0)
61
+ reek (6.2.0)
62
+ dry-schema (~> 1.13.0)
35
63
  parser (~> 3.2.0)
36
64
  rainbow (>= 2.0, < 4.0)
37
- regexp_parser (2.8.2)
65
+ rexml (~> 3.1)
66
+ regexp_parser (2.8.3)
38
67
  rexml (3.2.6)
39
68
  rspec (3.12.0)
40
69
  rspec-core (~> 3.12.0)
@@ -49,7 +78,7 @@ GEM
49
78
  diff-lcs (>= 1.2.0, < 2.0)
50
79
  rspec-support (~> 3.12.0)
51
80
  rspec-support (3.12.1)
52
- rubocop (1.58.0)
81
+ rubocop (1.59.0)
53
82
  json (~> 2.3)
54
83
  language_server-protocol (>= 3.17.0)
55
84
  parallel (~> 1.10)
@@ -62,6 +91,17 @@ GEM
62
91
  unicode-display_width (>= 2.4.0, < 3.0)
63
92
  rubocop-ast (1.30.0)
64
93
  parser (>= 3.2.1.0)
94
+ rubocop-capybara (2.20.0)
95
+ rubocop (~> 1.41)
96
+ rubocop-factory_bot (2.25.0)
97
+ rubocop (~> 1.33)
98
+ rubocop-performance (1.20.1)
99
+ rubocop (>= 1.48.1, < 2.0)
100
+ rubocop-ast (>= 1.30.0, < 2.0)
101
+ rubocop-rspec (2.26.1)
102
+ rubocop (~> 1.40)
103
+ rubocop-capybara (~> 2.17)
104
+ rubocop-factory_bot (~> 2.22)
65
105
  ruby-progressbar (1.13.0)
66
106
  simplecov (0.22.0)
67
107
  docile (~> 1.1)
@@ -70,6 +110,7 @@ GEM
70
110
  simplecov-html (0.12.3)
71
111
  simplecov_json_formatter (0.1.4)
72
112
  unicode-display_width (2.5.0)
113
+ zeitwerk (2.6.12)
73
114
 
74
115
  PLATFORMS
75
116
  x86_64-darwin-19
@@ -77,13 +118,16 @@ PLATFORMS
77
118
  x86_64-linux
78
119
 
79
120
  DEPENDENCIES
121
+ bundler (~> 2.4, >= 2.4.21)
80
122
  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)
123
+ pry-byebug (~> 3.9)
124
+ rake (~> 13.0, >= 13.0.6)
125
+ reek (~> 6.1, >= 6.1.1)
126
+ rspec (>= 3.10)
127
+ rubocop (~> 1.35)
128
+ rubocop-performance (~> 1.14, >= 1.14.3)
129
+ rubocop-rspec (~> 2.12, >= 2.12.1)
130
+ simplecov (~> 0.22.0)
87
131
 
88
132
  BUNDLED WITH
89
- 2.3.22
133
+ 2.5.3
data/README.md CHANGED
@@ -1,14 +1,9 @@
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
-
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)
4
+ [![GitHub version](http://badge.fury.io/gh/gangelo%2Fimmutable_struct_ex_redactable.svg?version=2)](https://badge.fury.io/gh/gangelo%2Fimmutable_struct_ex_redactable)
5
+ [![Gem Version](https://badge.fury.io/rb/immutable_struct_ex_redactable.svg?version=2)](https://badge.fury.io/rb/immutable_struct_ex_redactable)
6
+ [![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)
12
7
  [![License](http://img.shields.io/badge/license-MIT-yellowgreen.svg)](#license)
13
8
 
14
9
  ## Introduction
@@ -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.5'
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.5
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: 2024-01-07 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:
@@ -79,6 +79,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
79
79
  - - ">="
80
80
  - !ruby/object:Gem::Version
81
81
  version: 3.0.1
82
+ - - "<"
83
+ - !ruby/object:Gem::Version
84
+ version: '4.0'
82
85
  required_rubygems_version: !ruby/object:Gem::Requirement
83
86
  requirements:
84
87
  - - ">="