revector 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/revector/predicate/exists.rb +28 -0
- data/lib/revector/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3346074e6247568f17b908f5472d120d2608c514c186bf2665053c867499439f
|
4
|
+
data.tar.gz: 6abde163bf710682bf19e88871b299cf8795f1aa31540e051f35da0d7ba302a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7e44af11b5f08a366a5c5db1444b483f95c1b8f29a547593fac2cb24c7edc7460957380fc445e20e824f8ec93b37d5d67dd603faf10b4983353b883158bed05
|
7
|
+
data.tar.gz: 36c9ba17ae6a8bb54f0673dc2d54fa40a61db5a9656cc13df38fdf64e956734c513240a6972467e7f9c1ffdf5425c808fb9545d0dbb2f623a8e919c89ca34350
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## Changelog
|
2
2
|
|
3
|
+
### [v0.1.1](https://github.com/thadeu/revector/compare/v0.1.0...v0.1.1) - 11 December 2024
|
4
|
+
|
5
|
+
#### General Changes
|
6
|
+
|
7
|
+
- added support to ex and not_ex @thadeu
|
8
|
+
- update CHANGELOG.md @thadeu
|
9
|
+
- update README.md @thadeu
|
10
|
+
|
3
11
|
### v0.1.0
|
4
12
|
|
5
13
|
#### Chores And Housekeeping
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Revector
|
4
|
+
module Exists
|
5
|
+
def self.check!(item, iteratee)
|
6
|
+
compare(Utility::TryFetchOrBlank[item, iteratee])
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.compare(value, other = false)
|
10
|
+
case value
|
11
|
+
in [*] | String
|
12
|
+
value.size.positive?.to_s == other.to_s
|
13
|
+
else
|
14
|
+
!!value.to_s == other.to_s
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
module NotExists
|
20
|
+
def self.check!(item, iteratee)
|
21
|
+
!Exists.check!(item, iteratee)
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.compare(value, other = nil)
|
25
|
+
!Exists.compare(value, other)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/revector/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: revector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thadeu Esteves
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Filter collections using predicates like Ransack gem.
|
14
14
|
email:
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- lib/revector/predicate/contains.rb
|
36
36
|
- lib/revector/predicate/endify.rb
|
37
37
|
- lib/revector/predicate/equal.rb
|
38
|
+
- lib/revector/predicate/exists.rb
|
38
39
|
- lib/revector/predicate/greater_than.rb
|
39
40
|
- lib/revector/predicate/in.rb
|
40
41
|
- lib/revector/predicate/less_than.rb
|