type_struct 0.7.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +0 -2
- data/lib/type_struct/union.rb +3 -1
- data/lib/type_struct/version.rb +1 -1
- data/lib/type_struct.rb +3 -3
- metadata +7 -55
- data/.gitignore +0 -9
- data/.travis.yml +0 -8
- data/Gemfile +0 -4
- data/Rakefile +0 -7
- data/type_struct.gemspec +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bc4c66aaad503a0453e4b093c986f8dd122c0cf3f481fcaecbfbac0d90f0b4bf
|
4
|
+
data.tar.gz: 22e176748867e33d5ee26087d5d0641ff8ca6326606cd8b3ad6a2a32da0a0a20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd1c1c47f6ab498addba28013851f30bfa23cefafa9391cfab3a3447f8568ea6cd3a927bb437545adcbccfed6b756632c3bb1030e5188ba4e7caa0b971c79cd8
|
7
|
+
data.tar.gz: 7bb8bd056e51f0a9acd6b59503e255f15de328a2a552cf49b1d6d5e25440a89a5fb2e0e279ed9e93f46659d2a76f7fd7d388f65ea371b899baaf4738511cb4a3
|
data/README.md
CHANGED
data/lib/type_struct/union.rb
CHANGED
data/lib/type_struct/version.rb
CHANGED
data/lib/type_struct.rb
CHANGED
@@ -26,10 +26,10 @@ class TypeStruct
|
|
26
26
|
errors << e
|
27
27
|
end
|
28
28
|
end
|
29
|
-
instance_variable_set("@#{k}", sym_h[k])
|
30
29
|
sym_h[k].freeze if self.class.frozen?
|
31
30
|
end
|
32
31
|
raise MultiTypeError, errors unless errors.empty?
|
32
|
+
@__store = sym_h
|
33
33
|
end
|
34
34
|
|
35
35
|
def ==(other)
|
@@ -180,14 +180,14 @@ class TypeStruct
|
|
180
180
|
|
181
181
|
args.each_key do |k|
|
182
182
|
define_method(k) do
|
183
|
-
|
183
|
+
@__store[k]
|
184
184
|
end
|
185
185
|
|
186
186
|
define_method("#{k}=") do |v|
|
187
187
|
unless self.class.valid?(k, v)
|
188
188
|
raise TypeError, "#{self.class}##{k} expect #{self.class.type(k)} got #{v.inspect}"
|
189
189
|
end
|
190
|
-
|
190
|
+
@__store[k] = v
|
191
191
|
end
|
192
192
|
end
|
193
193
|
end
|
metadata
CHANGED
@@ -1,57 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: type_struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ksss
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rgot
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
11
|
+
date: 2023-10-31 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
55
13
|
description: Pseudo type system on struct.
|
56
14
|
email:
|
57
15
|
- co000ri@gmail.com
|
@@ -59,12 +17,8 @@ executables: []
|
|
59
17
|
extensions: []
|
60
18
|
extra_rdoc_files: []
|
61
19
|
files:
|
62
|
-
- ".gitignore"
|
63
|
-
- ".travis.yml"
|
64
|
-
- Gemfile
|
65
20
|
- LICENSE.txt
|
66
21
|
- README.md
|
67
|
-
- Rakefile
|
68
22
|
- lib/type_struct.rb
|
69
23
|
- lib/type_struct/array_of.rb
|
70
24
|
- lib/type_struct/exceptions.rb
|
@@ -76,12 +30,11 @@ files:
|
|
76
30
|
- lib/type_struct/interface.rb
|
77
31
|
- lib/type_struct/union.rb
|
78
32
|
- lib/type_struct/version.rb
|
79
|
-
- type_struct.gemspec
|
80
33
|
homepage: https://github.com/ksss/type_struct
|
81
34
|
licenses:
|
82
35
|
- MIT
|
83
36
|
metadata: {}
|
84
|
-
post_install_message:
|
37
|
+
post_install_message:
|
85
38
|
rdoc_options: []
|
86
39
|
require_paths:
|
87
40
|
- lib
|
@@ -96,9 +49,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
49
|
- !ruby/object:Gem::Version
|
97
50
|
version: '0'
|
98
51
|
requirements: []
|
99
|
-
|
100
|
-
|
101
|
-
signing_key:
|
52
|
+
rubygems_version: 3.4.10
|
53
|
+
signing_key:
|
102
54
|
specification_version: 4
|
103
55
|
summary: Pseudo type system on struct.
|
104
56
|
test_files: []
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
data/type_struct.gemspec
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'type_struct/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "type_struct"
|
8
|
-
spec.version = TypeStruct::VERSION
|
9
|
-
spec.authors = ["ksss"]
|
10
|
-
spec.email = ["co000ri@gmail.com"]
|
11
|
-
|
12
|
-
spec.summary = %q{Pseudo type system on struct.}
|
13
|
-
spec.description = %q{Pseudo type system on struct.}
|
14
|
-
spec.homepage = "https://github.com/ksss/type_struct"
|
15
|
-
spec.license = "MIT"
|
16
|
-
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{_test.rb}) }
|
18
|
-
spec.require_paths = ["lib"]
|
19
|
-
|
20
|
-
spec.add_development_dependency "bundler"
|
21
|
-
spec.add_development_dependency "rake"
|
22
|
-
spec.add_development_dependency "rgot"
|
23
|
-
end
|