key-vortex 1.0.0 → 1.1.0
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/key_vortex/constraint/regexp.rb +39 -0
- data/lib/key_vortex/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5877a12694814ce8bd027d49fb474be43f2a068c4e6ad940d5fb45f5912c571
|
4
|
+
data.tar.gz: 4abe9c664263006cc2c894a21fc99b293f477b4e937b52abefdafb1383806ba2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9716fd6dcf8c0219087178a129bea9b65e67f0a03cf7051c38c1c44f7a2a1a5b0606ac822c2a9740c653d7d37ad9c3a5633267d7de07d18c074c65ae9fb15bc7
|
7
|
+
data.tar.gz: 74bca86317fcf4ad13a9b91c1c7e3619dcafb6b32a757a13c3a5c70793086a59551ff37a388826e18ce4c16ce7f2ed8fefece0fe55fa96be579842f727608d53
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "key_vortex/constraint/base"
|
4
|
+
|
5
|
+
class KeyVortex
|
6
|
+
module Constraint
|
7
|
+
# Enforces that strings match the specified pattern. Because
|
8
|
+
# regular expressions are too complicated to establish clean
|
9
|
+
# bounds, it will not be considered when narrowing based on
|
10
|
+
# adapter constraints.
|
11
|
+
class Regexp < KeyVortex::Constraint::Base
|
12
|
+
# @return [Regexp] The regexp the value must match
|
13
|
+
attr_reader :pattern
|
14
|
+
|
15
|
+
# @param pattern [Regexp] The regexp the value must match
|
16
|
+
def initialize(pattern)
|
17
|
+
super()
|
18
|
+
@pattern = pattern
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [Symbol] :regexp
|
22
|
+
def attribute
|
23
|
+
:regexp
|
24
|
+
end
|
25
|
+
|
26
|
+
# @param [any]
|
27
|
+
# @return [true] Regular expressions are too flexible, they cannot be compared
|
28
|
+
def within?(_)
|
29
|
+
true
|
30
|
+
end
|
31
|
+
|
32
|
+
# @param value [String]
|
33
|
+
# @return [Boolean] True if pattern =~ value
|
34
|
+
def accepts?(value)
|
35
|
+
pattern =~ value
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/key_vortex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: key-vortex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lambda Null
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07
|
11
|
+
date: 2023-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Defines abstractions that can be built on top of for key/value storage
|
14
14
|
on different technologies (file, s3, sql, redis, etc.)
|
@@ -40,6 +40,7 @@ files:
|
|
40
40
|
- lib/key_vortex/constraint/length.rb
|
41
41
|
- lib/key_vortex/constraint/maximum.rb
|
42
42
|
- lib/key_vortex/constraint/minimum.rb
|
43
|
+
- lib/key_vortex/constraint/regexp.rb
|
43
44
|
- lib/key_vortex/field.rb
|
44
45
|
- lib/key_vortex/limitation.rb
|
45
46
|
- lib/key_vortex/record.rb
|
@@ -67,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
68
|
- !ruby/object:Gem::Version
|
68
69
|
version: '0'
|
69
70
|
requirements: []
|
70
|
-
rubygems_version: 3.
|
71
|
+
rubygems_version: 3.4.1
|
71
72
|
signing_key:
|
72
73
|
specification_version: 4
|
73
74
|
summary: Abstraction for interacting with various record stores
|