types 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/lib/types/any.rb +87 -0
- data/lib/types/array.rb +70 -0
- data/lib/types/block.rb +53 -0
- data/lib/types/boolean.rb +39 -0
- data/lib/types/class.rb +68 -0
- data/lib/types/decimal.rb +40 -0
- data/lib/types/float.rb +33 -0
- data/lib/types/generic.rb +43 -0
- data/lib/types/hash.rb +67 -0
- data/lib/types/integer.rb +33 -0
- data/lib/types/lambda.rb +65 -0
- data/lib/types/method.rb +77 -0
- data/lib/types/nil.rb +37 -0
- data/lib/types/numeric.rb +37 -0
- data/lib/types/string.rb +33 -0
- data/lib/types/symbol.rb +33 -0
- data/lib/types/tuple.rb +69 -0
- data/lib/types/version.rb +25 -0
- data/lib/types.rb +48 -126
- data.tar.gz.sig +2 -0
- metadata +77 -105
- metadata.gz.sig +0 -0
- data/.document +0 -5
- data/Gemfile +0 -11
- data/Gemfile.lock +0 -18
- data/LICENSE.txt +0 -20
- data/README.md +0 -52
- data/Rakefile +0 -37
- data/VERSION +0 -1
- data/types.gemspec +0 -54
data/lib/types/nil.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
23
|
+
require_relative 'generic'
|
24
|
+
|
25
|
+
module Types
|
26
|
+
module Nil
|
27
|
+
extend Generic
|
28
|
+
|
29
|
+
def self.parse(input)
|
30
|
+
if input =~ /nil|null/i
|
31
|
+
return nil
|
32
|
+
else
|
33
|
+
raise ArgumentError, "Cannot coerce #{input.inspect} into Nil!"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
23
|
+
require_relative 'generic'
|
24
|
+
|
25
|
+
module Types
|
26
|
+
module Numeric
|
27
|
+
extend Generic
|
28
|
+
|
29
|
+
def self.parse(input)
|
30
|
+
case input
|
31
|
+
when Numeric then input
|
32
|
+
when /\./ then Float(input)
|
33
|
+
else Integer(input)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/types/string.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
23
|
+
require_relative 'generic'
|
24
|
+
|
25
|
+
module Types
|
26
|
+
module String
|
27
|
+
extend Generic
|
28
|
+
|
29
|
+
def self.parse(input)
|
30
|
+
input.to_s
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/types/symbol.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
23
|
+
require_relative 'generic'
|
24
|
+
|
25
|
+
module Types
|
26
|
+
module Symbol
|
27
|
+
extend Generic
|
28
|
+
|
29
|
+
def self.parse(input)
|
30
|
+
input.to_sym
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/types/tuple.rb
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
23
|
+
require_relative 'generic'
|
24
|
+
require 'json'
|
25
|
+
|
26
|
+
module Types
|
27
|
+
class Tuple
|
28
|
+
include Generic
|
29
|
+
|
30
|
+
def initialize(item_types)
|
31
|
+
@item_types = item_types
|
32
|
+
end
|
33
|
+
|
34
|
+
attr :item_types
|
35
|
+
|
36
|
+
def composite?
|
37
|
+
true
|
38
|
+
end
|
39
|
+
|
40
|
+
def parse(input)
|
41
|
+
case input
|
42
|
+
when ::String
|
43
|
+
return parse_values(parse_string(input))
|
44
|
+
when ::Array
|
45
|
+
return parse_values(input)
|
46
|
+
else
|
47
|
+
raise ArgumentError, "Cannot coerce #{input.inspect} into tuple!"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def to_s
|
52
|
+
"Tuple(#{@item_types.join(', ')})"
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def parse_string(input)
|
58
|
+
::JSON.parse("[#{input}]")
|
59
|
+
end
|
60
|
+
|
61
|
+
def parse_values(input)
|
62
|
+
input.map.with_index{|value, index| @item_types[index].parse(value)}
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.Tuple(*item_types)
|
67
|
+
Tuple.new(item_types)
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
23
|
+
module Types
|
24
|
+
VERSION = "0.2.0"
|
25
|
+
end
|
data/lib/types.rb
CHANGED
@@ -1,130 +1,52 @@
|
|
1
|
-
#
|
2
|
-
# (c) 2011 Martin Kozák (martinkozak@martinkozak.net)
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
##
|
7
|
-
# Root library module.
|
8
|
-
#
|
9
|
-
|
10
|
-
module Types
|
11
|
-
|
12
|
-
##
|
13
|
-
# Type defining class.
|
14
|
-
# @abstract
|
15
|
-
#
|
16
|
-
|
17
|
-
class Type
|
18
|
-
|
19
|
-
##
|
20
|
-
# Returns classes which are part of this type.
|
21
|
-
#
|
22
|
-
# @return [Array] array of class objects
|
23
|
-
# @abstract
|
24
|
-
#
|
25
|
-
|
26
|
-
def type_classes
|
27
|
-
raise Exception::new("Class is abstract.")
|
28
|
-
end
|
29
|
-
|
30
|
-
##
|
31
|
-
# Returns types which are part of this type.
|
32
|
-
# @return [Array] array of types objects
|
33
|
-
#
|
34
|
-
|
35
|
-
def type_types
|
36
|
-
[ ]
|
37
|
-
end
|
38
|
-
|
39
|
-
##
|
40
|
-
# Matches object is of this type.
|
41
|
-
#
|
42
|
-
# @param [Object] object object for type matching
|
43
|
-
# @return [Boolean] 'true' if match, 'false' in otherwise
|
44
|
-
#
|
45
|
-
|
46
|
-
def match_type?(object)
|
47
|
-
result = object.kind_of_any? self.type_classes
|
48
|
-
if not result
|
49
|
-
result = object.type_of_any? self.type_types
|
50
|
-
end
|
51
|
-
|
52
|
-
return result
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
##
|
58
|
-
# Defines generic boolean type.
|
59
|
-
# @abstract
|
60
|
-
#
|
61
|
-
|
62
|
-
class Boolean < Type
|
63
|
-
|
64
|
-
##
|
65
|
-
# Returns classes which are part of this type.
|
66
|
-
# In case of boolean <tt>TrueClass</tt> and <tt>FalseClass</tt>.
|
67
|
-
#
|
68
|
-
# @return [Array] array of types objects
|
69
|
-
#
|
70
|
-
|
71
|
-
def type_classes
|
72
|
-
[TrueClass, FalseClass]
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
##
|
79
|
-
# Extension of built-in Object class.
|
80
|
-
#
|
81
|
-
|
82
|
-
class Object
|
83
|
-
|
84
|
-
##
|
85
|
-
# Indicates object is type of some class.
|
86
|
-
# If class isn't Type, matches against #kind_of?.
|
87
|
-
#
|
88
|
-
# @param [Types::Type, Class] cls some type or class specification
|
89
|
-
# @return [Boolean] 'true' if it is, 'false' in otherwise
|
90
|
-
#
|
91
|
-
|
92
|
-
def type_of?(cls)
|
93
|
-
cls_new = cls::new
|
94
|
-
if cls_new.kind_of? Types::Type
|
95
|
-
cls_new.match_type? self
|
96
|
-
else
|
97
|
-
self.kind_of? cls
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
##
|
102
|
-
# Indicates object is type of some class in the list.
|
103
|
-
# If class isn't Type, matches against #kind_of?.
|
104
|
-
#
|
105
|
-
# @param [Array] classes array of Type or Class objects
|
106
|
-
# @return [Boolean] 'true' if it is, 'false' in otherwise
|
107
|
-
#
|
108
|
-
|
109
|
-
def type_of_any?(classes)
|
110
|
-
if not classes.kind_of? Array
|
111
|
-
raise Exception::new("Array expected.")
|
112
|
-
end
|
113
|
-
|
114
|
-
classes.each do |cls|
|
115
|
-
if self.type_of? cls
|
116
|
-
return true
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
return false
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
##
|
125
|
-
# Redefines generic boolean type in main namespace.
|
126
|
-
# @abstract
|
3
|
+
# Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
127
4
|
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
23
|
+
require_relative 'types/version'
|
24
|
+
|
25
|
+
require_relative 'types/any'
|
26
|
+
require_relative 'types/array'
|
27
|
+
require_relative 'types/block'
|
28
|
+
require_relative 'types/boolean'
|
29
|
+
require_relative 'types/class'
|
30
|
+
require_relative 'types/decimal'
|
31
|
+
require_relative 'types/float'
|
32
|
+
require_relative 'types/hash'
|
33
|
+
require_relative 'types/integer'
|
34
|
+
require_relative 'types/lambda'
|
35
|
+
require_relative 'types/method'
|
36
|
+
require_relative 'types/nil'
|
37
|
+
require_relative 'types/numeric'
|
38
|
+
require_relative 'types/string'
|
39
|
+
require_relative 'types/symbol'
|
40
|
+
require_relative 'types/tuple'
|
128
41
|
|
129
|
-
|
42
|
+
module Types
|
43
|
+
VALID_SIGNATURE = /\A[a-zA-Z\(\):, |]+\z/
|
44
|
+
|
45
|
+
def self.parse(signature)
|
46
|
+
if signature =~ VALID_SIGNATURE
|
47
|
+
eval(signature, binding)
|
48
|
+
else
|
49
|
+
raise ArgumentError, "Invalid type signature: #{signature.inspect}!"
|
50
|
+
end
|
51
|
+
end
|
130
52
|
end
|
data.tar.gz.sig
ADDED
metadata
CHANGED
@@ -1,118 +1,90 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: types
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
version: 0.1.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
12
|
-
-
|
13
|
-
autorequire:
|
6
|
+
authors:
|
7
|
+
- Samuel Williams
|
8
|
+
autorequire:
|
14
9
|
bindir: bin
|
15
|
-
cert_chain:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
prerelease: false
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: jeweler
|
52
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
|
-
requirements:
|
55
|
-
- - ~>
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
segments:
|
58
|
-
- 1
|
59
|
-
- 5
|
60
|
-
- 2
|
61
|
-
version: 1.5.2
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: *id003
|
65
|
-
description:
|
66
|
-
email: martinkozak@martinkozak.net
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIEhDCCAuygAwIBAgIBATANBgkqhkiG9w0BAQsFADA3MTUwMwYDVQQDDCxzYW11
|
14
|
+
ZWwud2lsbGlhbXMvREM9b3Jpb250cmFuc2Zlci9EQz1jby9EQz1uejAeFw0yMTA4
|
15
|
+
MTYwNjMzNDRaFw0yMjA4MTYwNjMzNDRaMDcxNTAzBgNVBAMMLHNhbXVlbC53aWxs
|
16
|
+
aWFtcy9EQz1vcmlvbnRyYW5zZmVyL0RDPWNvL0RDPW56MIIBojANBgkqhkiG9w0B
|
17
|
+
AQEFAAOCAY8AMIIBigKCAYEAyXLSS/cw+fXJ5e7hi+U/TeChPWeYdwJojDsFY1xr
|
18
|
+
xvtqbTTL8gbLHz5LW3QD2nfwCv3qTlw0qI3Ie7a9VMJMbSvgVEGEfQirqIgJXWMj
|
19
|
+
eNMDgKsMJtC7u/43abRKx7TCURW3iWyR19NRngsJJmaR51yGGGm2Kfsr+JtKKLtL
|
20
|
+
L188Wm3f13KAx7QJU8qyuBnj1/gWem076hzdA7xi1DbrZrch9GCRz62xymJlrJHn
|
21
|
+
9iZEZ7AxrS7vokhMlzSr/XMUihx/8aFKtk+tMLClqxZSmBWIErWdicCGTULXCBNb
|
22
|
+
E/mljo4zEVKhlTWpJklMIhr55ZRrSarKFuW7en0+tpJrfsYiAmXMJNi4XAYJH7uL
|
23
|
+
rgJuJwSaa/dMz+VmUoo7VKtSfCoOI+6v5/z0sK3oT6sG6ZwyI47DBq2XqNC6tnAj
|
24
|
+
w+XmCywiTQrFzMMAvcA7rPI4F0nU1rZId51rOvvfxaONp+wgTi4P8owZLw0/j0m4
|
25
|
+
8C20DYi6EYx4AHDXiLpElWh3AgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8E
|
26
|
+
BAMCBLAwHQYDVR0OBBYEFB6ZaeWKxQjGTI+pmz7cKRmMIywwMC4GA1UdEQQnMCWB
|
27
|
+
I3NhbXVlbC53aWxsaWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWB
|
28
|
+
I3NhbXVlbC53aWxsaWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEB
|
29
|
+
CwUAA4IBgQBVoM+pu3dpdUhZM1w051iw5GfiqclAr1Psypf16Tiod/ho//4oAu6T
|
30
|
+
9fj3DPX/acWV9P/FScvqo4Qgv6g4VWO5ZU7z2JmPoTXZtYMunRAmQPFL/gSUc6aK
|
31
|
+
vszMHIyhtyzRc6DnfW2AiVOjMBjaYv8xXZc9bduniRVPrLR4J7ozmGLh4o4uJp7w
|
32
|
+
x9KCFaR8Lvn/r0oJWJOqb/DMAYI83YeN2Dlt3jpwrsmsONrtC5S3gOUle5afSGos
|
33
|
+
bYt5ocnEpKSomR9ZtnCGljds/aeO1Xgpn2r9HHcjwnH346iNrnHmMlC7BtHUFPDg
|
34
|
+
Ts92S47PTOXzwPBDsrFiq3VLbRjHSwf8rpqybQBH9MfzxGGxTaETQYOd6b4e4Ag6
|
35
|
+
y92abGna0bmIEb4+Tx9rQ10Uijh1POzvr/VTH4bbIPy9FbKrRsIQ24qDbNJRtOpE
|
36
|
+
RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
|
37
|
+
HiLJ8VOFx6w=
|
38
|
+
-----END CERTIFICATE-----
|
39
|
+
date: 2022-07-01 00:00:00.000000000 Z
|
40
|
+
dependencies: []
|
41
|
+
description:
|
42
|
+
email:
|
67
43
|
executables: []
|
68
|
-
|
69
44
|
extensions: []
|
70
|
-
|
71
|
-
|
72
|
-
- LICENSE.txt
|
73
|
-
- README.md
|
74
|
-
files:
|
75
|
-
- .document
|
76
|
-
- Gemfile
|
77
|
-
- Gemfile.lock
|
78
|
-
- LICENSE.txt
|
79
|
-
- README.md
|
80
|
-
- Rakefile
|
81
|
-
- VERSION
|
45
|
+
extra_rdoc_files: []
|
46
|
+
files:
|
82
47
|
- lib/types.rb
|
83
|
-
- types.
|
84
|
-
|
85
|
-
|
86
|
-
|
48
|
+
- lib/types/any.rb
|
49
|
+
- lib/types/array.rb
|
50
|
+
- lib/types/block.rb
|
51
|
+
- lib/types/boolean.rb
|
52
|
+
- lib/types/class.rb
|
53
|
+
- lib/types/decimal.rb
|
54
|
+
- lib/types/float.rb
|
55
|
+
- lib/types/generic.rb
|
56
|
+
- lib/types/hash.rb
|
57
|
+
- lib/types/integer.rb
|
58
|
+
- lib/types/lambda.rb
|
59
|
+
- lib/types/method.rb
|
60
|
+
- lib/types/nil.rb
|
61
|
+
- lib/types/numeric.rb
|
62
|
+
- lib/types/string.rb
|
63
|
+
- lib/types/symbol.rb
|
64
|
+
- lib/types/tuple.rb
|
65
|
+
- lib/types/version.rb
|
66
|
+
homepage: https://github.com/ioquatix/types
|
67
|
+
licenses:
|
87
68
|
- MIT
|
88
|
-
|
69
|
+
metadata:
|
70
|
+
funding_uri: https://github.com/sponsors/ioquatix/
|
71
|
+
post_install_message:
|
89
72
|
rdoc_options: []
|
90
|
-
|
91
|
-
require_paths:
|
73
|
+
require_paths:
|
92
74
|
- lib
|
93
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
-
|
95
|
-
requirements:
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
96
77
|
- - ">="
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
version: "0"
|
102
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
-
none: false
|
104
|
-
requirements:
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
105
82
|
- - ">="
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
|
108
|
-
- 0
|
109
|
-
version: "0"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
110
85
|
requirements: []
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
specification_version: 3
|
116
|
-
summary: Introduces group of classes as eqivalent to some data types in other languages such as boolean and allows introspection according to type of class too. In fact, partially replaces multiple inheritance because introduces unlimited formal genericity for every class.
|
86
|
+
rubygems_version: 3.3.7
|
87
|
+
signing_key:
|
88
|
+
specification_version: 4
|
89
|
+
summary: A simple human-readable and Ruby-parsable type library.
|
117
90
|
test_files: []
|
118
|
-
|
metadata.gz.sig
ADDED
Binary file
|
data/.document
DELETED
data/Gemfile
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
source "http://rubygems.org"
|
2
|
-
# Add dependencies required to use your gem here.
|
3
|
-
# Example:
|
4
|
-
gem "multitype-introspection", ">= 0.1.0"
|
5
|
-
|
6
|
-
# Add dependencies to develop your gem here.
|
7
|
-
# Include everything needed to run rake, tests, features, etc.
|
8
|
-
group :development do
|
9
|
-
gem "bundler", "~> 1.0.0"
|
10
|
-
gem "jeweler", "~> 1.5.2"
|
11
|
-
end
|
data/Gemfile.lock
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
git (1.2.5)
|
5
|
-
jeweler (1.5.2)
|
6
|
-
bundler (~> 1.0.0)
|
7
|
-
git (>= 1.2.5)
|
8
|
-
rake
|
9
|
-
multitype-introspection (0.1.0)
|
10
|
-
rake (0.8.7)
|
11
|
-
|
12
|
-
PLATFORMS
|
13
|
-
ruby
|
14
|
-
|
15
|
-
DEPENDENCIES
|
16
|
-
bundler (~> 1.0.0)
|
17
|
-
jeweler (~> 1.5.2)
|
18
|
-
multitype-introspection (>= 0.1.0)
|
data/LICENSE.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2011 Martin Kozák
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|