typ 0.1.1 → 0.1.3
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/lib/typ.rb +13 -4
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66823926d21d6fe86ffca0ecc21c2a9f548b3445e276c5d26646879f94d82b1b
|
4
|
+
data.tar.gz: e4d5c69c7bb1b699aac1ad28c253fa5ec2bd9985bad72ffd6334180f0c94aca7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da8014213903f96ee1b087cce2d9691b9bb8e79118406affb381e6ccfdde23b43fed0744255241cac507b6e1bda3135740bbcf0e92bf312be4b729ad75e91e29
|
7
|
+
data.tar.gz: 214aa68a4801a0151e4843b84a92e0aa705a8c47a9d30c9f943d27bd8c3b0598339d87d2c8e7531ac7865b6c7a073c5b47c6b0e0e086bdc89642565544e489a1
|
data/lib/typ.rb
CHANGED
@@ -45,6 +45,14 @@ module Typ
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
+
module Name
|
49
|
+
attr_writer :name
|
50
|
+
|
51
|
+
def name
|
52
|
+
@name ||= self.class.to_s
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
48
56
|
module New
|
49
57
|
def new
|
50
58
|
c = Class.new
|
@@ -60,6 +68,7 @@ module Typ
|
|
60
68
|
end
|
61
69
|
|
62
70
|
extend New
|
71
|
+
include Name
|
63
72
|
include DSLReaders
|
64
73
|
|
65
74
|
attr_reader :it, :error
|
@@ -184,13 +193,13 @@ module Typ
|
|
184
193
|
def test_for literal
|
185
194
|
case literal
|
186
195
|
when Symbol
|
187
|
-
literal.end_with?(??) ? super :
|
196
|
+
literal.end_with?(??) ? super : [:eql?, literal].to_test
|
188
197
|
when Array
|
189
|
-
literal.predicate? ? literal.to_test :
|
198
|
+
literal.predicate? ? literal.to_test : [:eql?, literal].to_test
|
190
199
|
when Class
|
191
|
-
literal.include?(Typ) ? super :
|
200
|
+
literal.include?(Typ) ? super : [:eql?, literal].to_test
|
192
201
|
else
|
193
|
-
|
202
|
+
[:eql?, literal].to_test
|
194
203
|
end
|
195
204
|
end
|
196
205
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typ
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anatoly Chernov
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description:
|
14
14
|
email:
|
15
15
|
- chertoly@gmail.com
|
16
16
|
executables: []
|
@@ -18,10 +18,10 @@ extensions: []
|
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
20
|
- lib/typ.rb
|
21
|
-
homepage:
|
21
|
+
homepage:
|
22
22
|
licenses: []
|
23
23
|
metadata: {}
|
24
|
-
post_install_message:
|
24
|
+
post_install_message:
|
25
25
|
rdoc_options: []
|
26
26
|
require_paths:
|
27
27
|
- lib
|
@@ -36,8 +36,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '0'
|
38
38
|
requirements: []
|
39
|
-
rubygems_version: 3.4.
|
40
|
-
signing_key:
|
39
|
+
rubygems_version: 3.4.21
|
40
|
+
signing_key:
|
41
41
|
specification_version: 4
|
42
42
|
summary: To type Ruby objects.
|
43
43
|
test_files: []
|