deco_lite 1.5.4 → 1.5.7

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: c4ef46454894f50d482c367ec123ad7d917ffd881ed049d3f1e19b76af40c1d8
4
- data.tar.gz: 30d3b18a200c2bac48f522ce2d81503a92ecd833182a29f769b170b1d31e6429
3
+ metadata.gz: 26e14acd2ae1cf70fcf862ab2034d5c481aa0597971a379d6f3d6c57ffc5b6f7
4
+ data.tar.gz: baf8ed4fd2d67823fd81a10bc005f92117cd4e1fa915a6fac73323508ad76ed1
5
5
  SHA512:
6
- metadata.gz: 98261afe547fd112944482847039be47b975eafc4616b6f3c4bba5f1891cbb7e871481602d97fad0d1ffd94e7d8bf4c10f50a614b9b549210cf3cf514fe5bf4d
7
- data.tar.gz: '089a684ab72f74fd52ca879869016766c49c6dc6b2c35a598d4f63eb1fadbe82e81176d0f3cc972d3f96cbad2b7a3f4a20925cde86369b52ab4a1fd5b8b5f454'
6
+ metadata.gz: e434ef072c8b300012bfb28ea2deb665ae830a04ef2c8d4e294f070fc4ee5338ffa2eafe33434467fc088982cd9afa5460c7950fb70d71ec5539afd53cc71224
7
+ data.tar.gz: f2cfd6a6dcc326bb73f62cbb805e600196b8bc0637cab2b26f688aac3596f1a27aca63ba0717cd6ee022574aaf5aa102debc72e70bf676c8361a3345bb5936b9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ### 1.5.7 2023-10-30
2
+
3
+ * Changes
4
+ * Update ruby gems
5
+
6
+ ### 1.5.6 2023-10-30
7
+
8
+ * Changes
9
+ * Update ruby gems
10
+
11
+ ### 1.5.5
12
+
13
+ * Changes
14
+ * Update ruby gems
15
+ * Fix rubocop violations
16
+
1
17
  ### 1.5.4
2
18
 
3
19
  * Changes
data/Gemfile.lock CHANGED
@@ -1,24 +1,23 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- deco_lite (1.5.4)
5
- activemodel (~> 7.0, >= 7.0.3.1)
6
- activesupport (~> 7.0, >= 7.0.3.1)
4
+ deco_lite (1.5.7)
5
+ activemodel (~> 7.0.8)
6
+ activesupport (~> 7.0.8)
7
7
  immutable_struct_ex (~> 1.0, >= 1.0.1)
8
8
  mad_flatter (~> 3.0)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activemodel (7.0.7)
14
- activesupport (= 7.0.7)
15
- activesupport (7.0.7)
13
+ activemodel (7.0.8)
14
+ activesupport (= 7.0.8)
15
+ activesupport (7.0.8)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
17
  i18n (>= 1.6, < 2)
18
18
  minitest (>= 5.1)
19
19
  tzinfo (~> 2.0)
20
20
  ast (2.4.2)
21
- base64 (0.1.1)
22
21
  byebug (11.1.3)
23
22
  coderay (1.1.3)
24
23
  concurrent-ruby (1.2.2)
@@ -26,17 +25,17 @@ GEM
26
25
  docile (1.4.0)
27
26
  i18n (1.14.1)
28
27
  concurrent-ruby (~> 1.0)
29
- immutable_struct_ex (1.0.1)
28
+ immutable_struct_ex (1.0.2)
30
29
  json (2.6.3)
31
30
  kwalify (0.7.2)
32
31
  language_server-protocol (3.17.0.3)
33
- mad_flatter (3.0.0)
32
+ mad_flatter (3.0.1)
34
33
  activesupport (~> 7.0, >= 7.0.3.1)
35
34
  immutable_struct_ex (~> 1.0)
36
35
  method_source (1.0.0)
37
- minitest (5.19.0)
36
+ minitest (5.20.0)
38
37
  parallel (1.23.0)
39
- parser (3.2.2.3)
38
+ parser (3.2.2.4)
40
39
  ast (~> 2.4.1)
41
40
  racc
42
41
  pry (0.14.2)
@@ -47,12 +46,12 @@ GEM
47
46
  pry (>= 0.13, < 0.15)
48
47
  racc (1.7.1)
49
48
  rainbow (3.1.1)
50
- rake (13.0.6)
49
+ rake (13.1.0)
51
50
  reek (6.1.4)
52
51
  kwalify (~> 0.7.0)
53
52
  parser (~> 3.2.0)
54
53
  rainbow (>= 2.0, < 4.0)
55
- regexp_parser (2.8.1)
54
+ regexp_parser (2.8.2)
56
55
  rexml (3.2.6)
57
56
  rspec (3.12.0)
58
57
  rspec-core (~> 3.12.0)
@@ -67,29 +66,28 @@ GEM
67
66
  diff-lcs (>= 1.2.0, < 2.0)
68
67
  rspec-support (~> 3.12.0)
69
68
  rspec-support (3.12.1)
70
- rubocop (1.56.0)
71
- base64 (~> 0.1.1)
69
+ rubocop (1.57.2)
72
70
  json (~> 2.3)
73
71
  language_server-protocol (>= 3.17.0)
74
72
  parallel (~> 1.10)
75
- parser (>= 3.2.2.3)
73
+ parser (>= 3.2.2.4)
76
74
  rainbow (>= 2.2.2, < 4.0)
77
75
  regexp_parser (>= 1.8, < 3.0)
78
76
  rexml (>= 3.2.5, < 4.0)
79
77
  rubocop-ast (>= 1.28.1, < 2.0)
80
78
  ruby-progressbar (~> 1.7)
81
79
  unicode-display_width (>= 2.4.0, < 3.0)
82
- rubocop-ast (1.29.0)
80
+ rubocop-ast (1.30.0)
83
81
  parser (>= 3.2.1.0)
84
- rubocop-capybara (2.18.0)
82
+ rubocop-capybara (2.19.0)
85
83
  rubocop (~> 1.41)
86
- rubocop-factory_bot (2.23.1)
84
+ rubocop-factory_bot (2.24.0)
87
85
  rubocop (~> 1.33)
88
- rubocop-performance (1.19.0)
86
+ rubocop-performance (1.19.1)
89
87
  rubocop (>= 1.7.0, < 2.0)
90
88
  rubocop-ast (>= 0.4.0)
91
- rubocop-rspec (2.23.2)
92
- rubocop (~> 1.33)
89
+ rubocop-rspec (2.25.0)
90
+ rubocop (~> 1.40)
93
91
  rubocop-capybara (~> 2.17)
94
92
  rubocop-factory_bot (~> 2.22)
95
93
  ruby-progressbar (1.13.0)
@@ -101,10 +99,11 @@ GEM
101
99
  simplecov_json_formatter (0.1.4)
102
100
  tzinfo (2.0.6)
103
101
  concurrent-ruby (~> 1.0)
104
- unicode-display_width (2.4.2)
102
+ unicode-display_width (2.5.0)
105
103
 
106
104
  PLATFORMS
107
105
  x86_64-darwin-19
106
+ x86_64-darwin-21
108
107
 
109
108
  DEPENDENCIES
110
109
  bundler (~> 2.2, >= 2.2.17)
data/deco_lite.gemspec CHANGED
@@ -48,8 +48,8 @@ Gem::Specification.new do |spec|
48
48
 
49
49
  spec.required_ruby_version = Gem::Requirement.new("~> 3.0")
50
50
 
51
- spec.add_runtime_dependency 'activemodel', '~> 7.0', '>= 7.0.3.1'
52
- spec.add_runtime_dependency 'activesupport', '~> 7.0', '>= 7.0.3.1'
51
+ spec.add_runtime_dependency 'activemodel', '~> 7.0.8'
52
+ spec.add_runtime_dependency 'activesupport', '~> 7.0.8'
53
53
  spec.add_runtime_dependency 'immutable_struct_ex', '~> 1.0', '>= 1.0.1'
54
54
  spec.add_runtime_dependency 'mad_flatter', '~> 3.0'
55
55
  spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.17'
@@ -9,8 +9,8 @@ module DecoLite
9
9
 
10
10
  def set_field_values(hash:, field_info:, options:)
11
11
  field_info.each do |name, info|
12
- value = get_field_value(hash: hash, field_info: info)
13
- set_field_value(field_name: name, value: value, options: options)
12
+ value = get_field_value(hash:, field_info: info)
13
+ set_field_value(field_name: name, value:, options:)
14
14
  end
15
15
  end
16
16
 
@@ -11,9 +11,9 @@ module DecoLite
11
11
  include FieldsOptionable
12
12
 
13
13
  def validate_field_conflicts!(field_name:, options:)
14
- return unless field_conflict?(field_name: field_name, options: options)
14
+ return unless field_conflict?(field_name:, options:)
15
15
 
16
- field_name = field_name_or_field_name_with_namespace field_name: field_name, options: options
16
+ field_name = field_name_or_field_name_with_namespace(field_name:, options:)
17
17
 
18
18
  raise "Field :#{field_name} conflicts with existing method(s) " \
19
19
  ":#{field_name} and/or :#{field_name}=; " \
@@ -27,23 +27,23 @@ module DecoLite
27
27
  def field_conflict?(field_name:, options:)
28
28
  # If field_name was already added using Model#load, there is only a
29
29
  # conflict if options.strict? is true.
30
- return options.strict? if field_names_include?(field_name: field_name, options: options)
30
+ return options.strict? if field_names_include?(field_name:, options:)
31
31
 
32
32
  # If we get here, we know that :field_name does not exist as an
33
33
  # attribute on the model. If the attribute already exists on the
34
34
  # model, this is a conflict because we cannot override an attribute
35
35
  # that already exists on the model
36
- attr_accessor_exist?(field_name: field_name, options: options)
36
+ attr_accessor_exist?(field_name:, options:)
37
37
  end
38
38
 
39
39
  def field_names_include?(field_name:, options:)
40
- field_name = field_name_or_field_name_with_namespace field_name: field_name, options: options
40
+ field_name = field_name_or_field_name_with_namespace(field_name:, options:)
41
41
 
42
42
  field_names.include? field_name
43
43
  end
44
44
 
45
45
  def attr_accessor_exist?(field_name:, options:)
46
- field_name = field_name_or_field_name_with_namespace field_name: field_name, options: options
46
+ field_name = field_name_or_field_name_with_namespace(field_name:, options:)
47
47
 
48
48
  respond_to?(field_name) || respond_to?(:"#{field_name}=")
49
49
  end
@@ -13,19 +13,19 @@ module DecoLite
13
13
  return if field_names.blank?
14
14
 
15
15
  field_names.each do |field_name|
16
- create_field_accessor(field_name: field_name, options: options)
16
+ create_field_accessor(field_name:, options:)
17
17
  end
18
18
  end
19
19
 
20
20
  def create_field_accessor(field_name:, options:)
21
- validate_field_name!(field_name: field_name, options: options)
22
- validate_field_conflicts!(field_name: field_name, options: options)
21
+ validate_field_name!(field_name:, options:)
22
+ validate_field_conflicts!(field_name:, options:)
23
23
 
24
24
  # If we want to set a class-level attr_accessor
25
25
  # self.class.attr_accessor(field_name) if field_name.present?
26
26
 
27
- create_field_getter field_name: field_name, options: options
28
- create_field_setter field_name: field_name, options: options
27
+ create_field_getter(field_name:, options:)
28
+ create_field_setter field_name:, options:
29
29
  end
30
30
 
31
31
  private
@@ -7,7 +7,7 @@ module DecoLite
7
7
  def field_name_or_field_name_with_namespace(field_name:, options:)
8
8
  return field_name unless options.namespace?
9
9
 
10
- field_name_with_namespace(field_name: field_name, namespace: options.namespace)
10
+ field_name_with_namespace(field_name:, namespace: options.namespace)
11
11
  end
12
12
 
13
13
  def field_name_with_namespace(field_name:, namespace:)
@@ -17,13 +17,13 @@ module DecoLite
17
17
 
18
18
  return {} if hash.blank?
19
19
 
20
- load_service_options = merge_with_load_service_options deco_lite_options: deco_lite_options
21
- load_service.execute(hash: hash, options: load_service_options).tap do |service_hash|
20
+ load_service_options = merge_with_load_service_options(deco_lite_options:)
21
+ load_service.execute(hash:, options: load_service_options).tap do |service_hash|
22
22
  service_hash.each_pair do |field_name, value|
23
- create_field_accessor field_name: field_name, options: deco_lite_options
23
+ create_field_accessor field_name:, options: deco_lite_options
24
24
  yield field_name if block_given?
25
25
  field_names << field_name unless field_names.include? field_name
26
- set_field_value(field_name: field_name, value: value, options: deco_lite_options)
26
+ set_field_value(field_name:, value:, options: deco_lite_options)
27
27
  end
28
28
  end
29
29
  end
@@ -34,9 +34,9 @@ module DecoLite
34
34
 
35
35
  hash ||= {}
36
36
 
37
- load_hash!(hash: auto_attr_accessors, options: options, add_loaded_fields: false) if auto_attr_accessors?
37
+ load_hash!(hash: auto_attr_accessors, options:, add_loaded_fields: false) if auto_attr_accessors?
38
38
 
39
- load_hash!(hash: hash, options: options) if hash.present?
39
+ load_hash!(hash:, options:) if hash.present?
40
40
  end
41
41
 
42
42
  validate :validate_required_fields
@@ -52,7 +52,7 @@ module DecoLite
52
52
  end
53
53
 
54
54
  def load!(hash:, options: {})
55
- load_hash! hash: hash, options: options
55
+ load_hash! hash:, options:
56
56
  end
57
57
 
58
58
  private
@@ -70,7 +70,7 @@ module DecoLite
70
70
  # options while loading, but also provide option customization
71
71
  # of options when needed.
72
72
  options = Options.with_defaults(options, defaults: self.options)
73
- load_hash(hash: hash, deco_lite_options: options) do |loaded_field|
73
+ load_hash(hash:, deco_lite_options: options) do |loaded_field|
74
74
  loaded_fields << loaded_field if add_loaded_fields
75
75
  end
76
76
 
@@ -14,9 +14,9 @@ module DecoLite
14
14
  def validate_options!(options:)
15
15
  raise ArgumentError, 'options is not a Hash' unless options.is_a? Hash
16
16
 
17
- validate_options_present! options: options
17
+ validate_options_present!(options:)
18
18
 
19
- validate_option_keys! options: options
19
+ validate_option_keys!(options:)
20
20
  validate_option_fields! fields: options[OPTION_FIELDS]
21
21
  validate_option_namespace! namespace: options[OPTION_NAMESPACE]
22
22
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the version of this gem.
4
4
  module DecoLite
5
- VERSION = '1.5.4'
5
+ VERSION = '1.5.7'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deco_lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.7
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-08-17 00:00:00.000000000 Z
11
+ date: 2023-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -16,40 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '7.0'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 7.0.3.1
19
+ version: 7.0.8
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '7.0'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 7.0.3.1
26
+ version: 7.0.8
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: activesupport
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: '7.0'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 7.0.3.1
33
+ version: 7.0.8
43
34
  type: :runtime
44
35
  prerelease: false
45
36
  version_requirements: !ruby/object:Gem::Requirement
46
37
  requirements:
47
38
  - - "~>"
48
39
  - !ruby/object:Gem::Version
49
- version: '7.0'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 7.0.3.1
40
+ version: 7.0.8
53
41
  - !ruby/object:Gem::Dependency
54
42
  name: immutable_struct_ex
55
43
  requirement: !ruby/object:Gem::Requirement