lite-ruby 1.1.13 → 1.3.0

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: fe679570639cc347f06cb66cb3cefab5f43c76d66d2460050f91a9f2107a9baf
4
- data.tar.gz: 9c342175047a4783844895e1fce5759d0351d6ed15383a5c245700637408af3b
3
+ metadata.gz: 70999d7bfc996b80f4dfc5911b3eeca10f10219e8c7eeabdcafd18a6a1013621
4
+ data.tar.gz: 3697787f3d99687ab0b47fc39308c41637956ffe9b4d4258ce1a46916b90e463
5
5
  SHA512:
6
- metadata.gz: 51c1075b41fee9f7c36a6530e31caa46fe1edbdc3779708485c3f4d6d9f0ea2c16bd31e282414926fa1d1962d69fd75920144a4c9dbb66c2b7a65f43af316e3d
7
- data.tar.gz: 360692b781b2e8eaa7d511a1c225fe6721a241673fe670eaa682056d96379448a622c4cc3abe0a30c3350c9411d6aea3ae58084e821f79cdd5039b0479d51a7a
6
+ metadata.gz: 555e3a07381d386ae8a7c3acfb9aecf948d1cf7e733f9f932922ab8967bc4d0c9667728e8049553a0b9e393e25cae09a319c891ee544ffdd856f2fae3d31129c
7
+ data.tar.gz: fa78a2576aef3d4111f5cd0134b6311f3a17cea5c72c789df925d37550831e8c3ec7a42e478235823ced8c6389051148036542c47d5d9dfa3804cd9dc72def70
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ require:
3
3
  - rubocop-rake
4
4
  - rubocop-rspec
5
5
  AllCops:
6
- TargetRubyVersion: 2.7
6
+ TargetRubyVersion: 3.0
7
7
  NewCops: enable
8
8
  DisplayCopNames: true
9
9
  DisplayStyleGuide: true
data/CHANGELOG.md CHANGED
@@ -6,6 +6,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.3.0] - 2021-07-19
10
+ ### Added
11
+ - Added Ruby 3.0 support
12
+
13
+ ## [1.2.0] - 2021-07-09
14
+ ### Removed
15
+ - OpenStruct block initialization due to unreliability
16
+
17
+ ## [1.1.15] - 2021-07-05
18
+ ### Changed
19
+ - Added more OpenStruct backwards compatibility
20
+
21
+ ## [1.1.14] - 2021-07-05
22
+ ### Changed
23
+ - Fixed mistake in OpenStruct backwards compatibility
24
+
9
25
  ## [1.1.13] - 2021-07-05
10
26
  ### Added
11
27
  - Added more OpenStruct backwards compatibility
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-ruby (1.1.13)
4
+ lite-ruby (1.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -50,7 +50,7 @@ GEM
50
50
  mini_portile2 (~> 2.5.0)
51
51
  racc (~> 1.4)
52
52
  parallel (1.20.1)
53
- parser (3.0.1.1)
53
+ parser (3.0.2.0)
54
54
  ast (~> 2.4.1)
55
55
  racc (1.5.2)
56
56
  rack (2.2.3)
@@ -68,7 +68,7 @@ GEM
68
68
  rake (>= 0.13)
69
69
  thor (~> 1.0)
70
70
  rainbow (3.0.0)
71
- rake (13.0.3)
71
+ rake (13.0.6)
72
72
  regexp_parser (2.1.1)
73
73
  rexml (3.2.5)
74
74
  rspec (3.10.0)
@@ -84,7 +84,7 @@ GEM
84
84
  diff-lcs (>= 1.2.0, < 2.0)
85
85
  rspec-support (~> 3.10.0)
86
86
  rspec-support (3.10.2)
87
- rubocop (1.18.2)
87
+ rubocop (1.18.3)
88
88
  parallel (~> 1.10)
89
89
  parser (>= 3.0.0.0)
90
90
  rainbow (>= 2.2.2, < 4.0)
@@ -93,9 +93,9 @@ GEM
93
93
  rubocop-ast (>= 1.7.0, < 2.0)
94
94
  ruby-progressbar (~> 1.7)
95
95
  unicode-display_width (>= 1.4.0, < 3.0)
96
- rubocop-ast (1.7.0)
96
+ rubocop-ast (1.8.0)
97
97
  parser (>= 3.0.1.1)
98
- rubocop-performance (1.11.3)
98
+ rubocop-performance (1.11.4)
99
99
  rubocop (>= 1.7.0, < 2.0)
100
100
  rubocop-ast (>= 0.4.0)
101
101
  rubocop-rake (0.6.0)
@@ -129,4 +129,4 @@ DEPENDENCIES
129
129
  rubocop-rspec
130
130
 
131
131
  BUNDLED WITH
132
- 2.2.19
132
+ 2.2.24
data/docs/OPEN_STRUCT.md CHANGED
@@ -1,14 +1,5 @@
1
1
  # OpenStruct
2
2
 
3
- `Initialize`
4
- Allows the initialization of an OpenStruct with a setter block.
5
-
6
- ```ruby
7
- OpenStruct.new(name: 'bob', age: 60) do |o|
8
- o.gender = :M
9
- end
10
- ```
11
-
12
3
  `attributes`
13
4
  ------
14
5
  Returns the key values as a hash of the assigned struct.
@@ -5,21 +5,6 @@ if Lite::Ruby.configuration.monkey_patches.include?('open_struct')
5
5
 
6
6
  class OpenStruct
7
7
 
8
- def initialize(hash = nil, &block)
9
- @table = if block && block.arity == 2
10
- Hash.new(&block)
11
- else
12
- {}
13
- end
14
-
15
- hash&.each do |key, val|
16
- @table[key.to_sym] = val
17
- new_ostruct_member!(key)
18
- end
19
-
20
- yield self if block && block.arity == 1
21
- end
22
-
23
8
  def attributes
24
9
  @table
25
10
  end
@@ -41,38 +26,5 @@ if Lite::Ruby.configuration.monkey_patches.include?('open_struct')
41
26
  alias as_json to_json
42
27
  alias to_h to_hash
43
28
 
44
- private
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
-
65
- def new_ostruct_member!(name)
66
- return if is_method_protected!(name)
67
-
68
- if respond_to?(:define_singleton_method!)
69
- define_singleton_method(name) { @table[name] }
70
- define_singleton_method("#{name}=") { |x| @table[name] = x }
71
- else
72
- define_singleton_method!(name) { @table[name] }
73
- define_singleton_method!("#{name}=") { |x| @table[name] = x }
74
- end
75
- end
76
-
77
29
  end
78
30
  end
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Ruby
5
5
 
6
- VERSION = '1.1.13'
6
+ VERSION = '1.3.0'
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.13
4
+ version: 1.3.0
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-05 00:00:00.000000000 Z
11
+ date: 2021-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  - !ruby/object:Gem::Version
223
223
  version: '0'
224
224
  requirements: []
225
- rubygems_version: 3.2.19
225
+ rubygems_version: 3.2.24
226
226
  signing_key:
227
227
  specification_version: 4
228
228
  summary: Collection of useful Ruby methods for its primitive classes