lite-ruby 1.1.10 → 1.1.11

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: 63d0d01fd2b88f0a9362009571181cd8d13f1c504662138d2c5b811cf1e8282c
4
- data.tar.gz: b1f8de0ba8ab9c9516a59e949108d476527d285d0397c392cd03968f771e032c
3
+ metadata.gz: 8a92f3d32861300bef85bf4b02207793096b41e581066440008b4e57ef656508
4
+ data.tar.gz: 862d2c9b4859df92bc14e5814a7e770e6ac52eda4f28233ee77d18892b4d00cb
5
5
  SHA512:
6
- metadata.gz: da98aab18c440e3b346ace43c94773688930837ce9df4ada5ecab7e8512e957e63cb126103b5d7e4dceaa3d124af0983797dc352a53767b1791fa83389ed9cf4
7
- data.tar.gz: 56a911edc10244b5316665eabb0b8b68d2c572362e28a7a3b60ca6760008875c9736f92904f70b1c0367cb503f7a6c9eb9459464273c15bfcc26364caf774221
6
+ metadata.gz: 7f3e0689339147e45fd7841ff7bec40bf0a51b680d41460ea5bd437f171647e18ffe2c7781b94a492f4b35b17ced3258d8eef1652ecbf99d5dcecf3716bb1c75
7
+ data.tar.gz: f42eec3a17ea8816f1f8c9ad27477419e93f07906f1058f1e3c5cec4805bfa95744f1d84770447536953dc6fe94f1b51cf85faa2a2b324a33799e1def1fab293
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.1.11] - 2021-07-04
10
+ ### Added
11
+ - Added Array => `contains_all?`
12
+ - Added Array => `contains_any?`
13
+ - Added Array => `contains_none?`
14
+
9
15
  ## [1.1.10] - 2021-06-21
10
16
  ### Changed
11
17
  - Struct `[]` to be accessible via `attributes`
data/Gemfile.lock CHANGED
@@ -1,25 +1,25 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-ruby (1.1.10)
4
+ lite-ruby (1.1.11)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- actionpack (6.1.3.2)
10
- actionview (= 6.1.3.2)
11
- activesupport (= 6.1.3.2)
9
+ actionpack (6.1.4)
10
+ actionview (= 6.1.4)
11
+ activesupport (= 6.1.4)
12
12
  rack (~> 2.0, >= 2.0.9)
13
13
  rack-test (>= 0.6.3)
14
14
  rails-dom-testing (~> 2.0)
15
15
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
16
- actionview (6.1.3.2)
17
- activesupport (= 6.1.3.2)
16
+ actionview (6.1.4)
17
+ activesupport (= 6.1.4)
18
18
  builder (~> 3.1)
19
19
  erubi (~> 1.4)
20
20
  rails-dom-testing (~> 2.0)
21
21
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
22
- activesupport (6.1.3.2)
22
+ activesupport (6.1.4)
23
23
  concurrent-ruby (~> 1.0, >= 1.0.2)
24
24
  i18n (>= 1.6, < 2)
25
25
  minitest (>= 5.1)
@@ -61,11 +61,11 @@ GEM
61
61
  nokogiri (>= 1.6)
62
62
  rails-html-sanitizer (1.3.0)
63
63
  loofah (~> 2.3)
64
- railties (6.1.3.2)
65
- actionpack (= 6.1.3.2)
66
- activesupport (= 6.1.3.2)
64
+ railties (6.1.4)
65
+ actionpack (= 6.1.4)
66
+ activesupport (= 6.1.4)
67
67
  method_source
68
- rake (>= 0.8.7)
68
+ rake (>= 0.13)
69
69
  thor (~> 1.0)
70
70
  rainbow (3.0.0)
71
71
  rake (13.0.3)
@@ -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.17.0)
87
+ rubocop (1.18.2)
88
88
  parallel (~> 1.10)
89
89
  parser (>= 3.0.0.0)
90
90
  rainbow (>= 2.2.2, < 4.0)
@@ -98,8 +98,8 @@ GEM
98
98
  rubocop-performance (1.11.3)
99
99
  rubocop (>= 1.7.0, < 2.0)
100
100
  rubocop-ast (>= 0.4.0)
101
- rubocop-rake (0.5.1)
102
- rubocop
101
+ rubocop-rake (0.6.0)
102
+ rubocop (~> 1.0)
103
103
  rubocop-rspec (2.4.0)
104
104
  rubocop (~> 1.0)
105
105
  rubocop-ast (>= 1.1.0)
data/docs/ARRAY.md CHANGED
@@ -104,6 +104,39 @@ Updates a deeply nested value.
104
104
  ['1', ['2']].bury(1) #=> raises ArgumentError: '2 or more arguments required'
105
105
  ```
106
106
 
107
+ `contains_all?`
108
+ ------
109
+ Returns true/false if an array contains all values from another.
110
+
111
+ ```ruby
112
+ [1, 2, 3].contains_all?([1, 2, 3]) #=> true
113
+ [1, 2, 3].contains_all?([1, 2, 3, 4]) #=> true
114
+ [1, 2, 3].contains_all?([1, 2]) #=> false
115
+ [1, 2, 3].contains_all?([4, 5]) #=> false
116
+ ```
117
+
118
+ `contains_any?`
119
+ ------
120
+ Returns true/false if an array contains any values from another.
121
+
122
+ ```ruby
123
+ [1, 2, 3].contains_any?([1, 2]) #=> true
124
+ [1, 2, 3].contains_any?([1, 2, 3]) #=> true
125
+ [1, 2, 3].contains_any?([1, 2, 3, 4]) #=> true
126
+ [1, 2, 3].contains_any?([4, 5]) #=> false
127
+ ```
128
+
129
+ `contains_none?`
130
+ ------
131
+ Returns true/false if an array contains none of the values from another.
132
+
133
+ ```ruby
134
+ [1, 2, 3].contains_none?([4, 5]) #=> true
135
+ [1, 2, 3].contains_none?([1, 2]) #=> false
136
+ [1, 2, 3].contains_none?([1, 2, 3]) #=> false
137
+ [1, 2, 3].contains_none?([1, 2, 3, 4]) #=> false
138
+ ```
139
+
107
140
  `delete_first(!)`
108
141
  ------
109
142
  Removes the first element from an array. Like `shift`, but returns the array instead of the removed element.
data/docs/STRING.md CHANGED
@@ -240,9 +240,9 @@ of the string until it reaches the limit value (counting backwards). If the give
240
240
  than or equal to the string length, Returns a copy of self.
241
241
 
242
242
  ```ruby
243
- 'example'.last #=> 'e'
244
- 'example'.last(0) #=> ''
245
- 'example'.first(3) #=> 'ple'
243
+ 'example'.last #=> 'e'
244
+ 'example'.last(0) #=> ''
245
+ 'example'.last(3) #=> 'ple'
246
246
  ```
247
247
 
248
248
  `lchomp(!)`
@@ -109,6 +109,18 @@ if Lite::Ruby.configuration.monkey_patches.include?('array')
109
109
  # rubocop:enable Metrics/PerceivedComplexity, Style/GuardClause, Style/IfInsideElse
110
110
  # rubocop:enable Metrics/AbcSize, Metrics/BlockNesting, Metrics/MethodLength
111
111
 
112
+ def contains_all?(other)
113
+ (other & self) == self
114
+ end
115
+
116
+ def contains_any?(other)
117
+ !contains_none?(other)
118
+ end
119
+
120
+ def contains_none?(other)
121
+ (other & self).empty?
122
+ end
123
+
112
124
  def delete_first
113
125
  self[1..-1]
114
126
  end
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Ruby
5
5
 
6
- VERSION = '1.1.10'
6
+ VERSION = '1.1.11'
7
7
 
8
8
  end
9
9
  end
data/lite-ruby.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  )
26
26
  else
27
27
  raise 'RubyGems 2.0 or newer is required to protect against ' \
28
- 'public gem pushes.'
28
+ 'public gem pushes.'
29
29
  end
30
30
 
31
31
  # Specify which files should be added to the gem when it is released.
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.10
4
+ version: 1.1.11
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-06-22 00:00:00.000000000 Z
11
+ date: 2021-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler