lite-ruby 1.1.11 → 1.1.12

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: 8a92f3d32861300bef85bf4b02207793096b41e581066440008b4e57ef656508
4
- data.tar.gz: 862d2c9b4859df92bc14e5814a7e770e6ac52eda4f28233ee77d18892b4d00cb
3
+ metadata.gz: a396444ff8c06f3c21d41e17b3360d5af587e6914f1d9835527316c6eaeb9a3a
4
+ data.tar.gz: 6034fb2b62c4e0ab25b74cccd1285c5266d3880741c345f3780dcd193ff16eff
5
5
  SHA512:
6
- metadata.gz: 7f3e0689339147e45fd7841ff7bec40bf0a51b680d41460ea5bd437f171647e18ffe2c7781b94a492f4b35b17ced3258d8eef1652ecbf99d5dcecf3716bb1c75
7
- data.tar.gz: f42eec3a17ea8816f1f8c9ad27477419e93f07906f1058f1e3c5cec4805bfa95744f1d84770447536953dc6fe94f1b51cf85faa2a2b324a33799e1def1fab293
6
+ metadata.gz: 70d61e9235e2a68f62848ac14e37a6bc442746e57af32d26a2361849c88501cbf20ed723f6db5665a95734c77e9418fe66e2f9b900c36ffedfdbad141b0f6f48
7
+ data.tar.gz: 42661db34d7fa54d3d29a4ddc71f266ab7670d334544c8e14a5504ffece60a1f0bf04fcefbbad0e69d29bcf14a40e738326f95c06a4c98c72faf45e00680e52a
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.1.12] - 2021-07-05
10
+ ### Added
11
+ - Added OpenStruct backwards compatibility
12
+
9
13
  ## [1.1.11] - 2021-07-04
10
14
  ### Added
11
15
  - Added Array => `contains_all?`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-ruby (1.1.11)
4
+ lite-ruby (1.1.12)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -43,6 +43,25 @@ if Lite::Ruby.configuration.monkey_patches.include?('open_struct')
43
43
 
44
44
  private
45
45
 
46
+ # rubocop:disable Metrics/MethodLength, Naming/PredicateName
47
+ def is_method_protected!(name)
48
+ return false unless respond_to?(name, true)
49
+ return true if name.match?(/!$/)
50
+
51
+ owner = method!(name).owner
52
+
53
+ if owner.instance_of?(::Class)
54
+ owner < ::OpenStruct
55
+ else
56
+ self.class.ancestors.any? do |mod|
57
+ return false if mod == ::OpenStruct
58
+
59
+ mod == owner
60
+ end
61
+ end
62
+ end
63
+ # rubocop:enable Metrics/MethodLength, Naming/PredicateName
64
+
46
65
  def new_ostruct_member!(name)
47
66
  return if is_method_protected!(name)
48
67
 
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Ruby
5
5
 
6
- VERSION = '1.1.11'
6
+ VERSION = '1.1.12'
7
7
 
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11
4
+ version: 1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-04 00:00:00.000000000 Z
11
+ date: 2021-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler