ravioli 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2eec97a3b916cdab71a437dbf3eb0c7d63a45248af015e8f164e3adbd52189d0
4
- data.tar.gz: 8ff85466d17d6a6d095901e8980d67e2a1d272534cb3c04798e5a24651a8a762
3
+ metadata.gz: 2aefb9753a481282a8f9f715721f642db0767ce193356b4447088eccc15a4a6d
4
+ data.tar.gz: 46985d21d775497fff718b5f9c15f15529f89127a950e2ad772f605c284b2cc4
5
5
  SHA512:
6
- metadata.gz: af32119896fc75082294d65f0e3fd9c5ea70ca556e6d8905feb81aa67b3b7ff4e6acdc70de3af009bc7ef2df2ab220426a787546bb96a834d6f53277853905a2
7
- data.tar.gz: 4831e9aa975e33212a54907edb5471898f5fd097bf61aad719c8dc1d301b5cc3a55e8012ce9066355c57f48b9f85202deb31962817c71f1606aeb93e34e98104
6
+ metadata.gz: f9f300878dd25c69cc41612c0aa34e144533e98aae70ee800e17f42b49b06d4d5a581f0a76ac30659dec81e4a00bbdeb7f3b98358d818a597576b93c2926c6ef
7
+ data.tar.gz: f5be20c80174caa8606a2470ded64ce82de3dc71122a07cf58166edaaa4c77207eb26d13dc33de8aa211b79d4b935fff5057ccf24dfb84f0ae9df83d7a2e718d
@@ -68,7 +68,7 @@ module Ravioli
68
68
  if value.is_a?(Hash)
69
69
  original_value = dig(*Array(key))
70
70
  transform = ->(value) { value.is_a?(self.class) ? value.table.deep_transform_values(&transform) : value }
71
- original_value = original_value.table.deep_transform_values(&transform) if original_value.is_a?(Ravioli::Configuration)
71
+ original_value = original_value.table.deep_transform_values(&transform) if original_value.is_a?(self.class)
72
72
  value = original_value.deep_merge(value.deep_symbolize_keys) if original_value.is_a?(Hash)
73
73
  build(key, value)
74
74
  else
@@ -91,6 +91,14 @@ module Ravioli
91
91
  Array(key_path) + Array(keys)
92
92
  end
93
93
 
94
+ # Ruby 3's OStruct doesn't protect the `class` method ... which is dumb. Let's protect all
95
+ # public instance methods; this will just prevent reader attrs from being written. Things are
96
+ # still accessible via hash notation, e.g. `Rails.config[:class]`
97
+ def is_method_protected!(name)
98
+ return true if singleton_class.method_defined?(name)
99
+ super
100
+ end
101
+
94
102
  # rubocop:disable Style/MissingRespondToMissing
95
103
  def method_missing(method, *args, &block)
96
104
  return super unless args.empty?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ravioli
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ravioli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flip Sasser