typeruby 0.1.1 → 0.1.2
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/bin/typeruby +0 -0
- data/bin/typeruby-mac +0 -0
- data/bin/typeruby.exe +0 -0
- data/bin/typeruby.gemspec +1 -1
- data/compile.js +10 -0
- data/compile.ts +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 269079e8b10c5ba5a07c5233855e69fe8ca04afd9dbb1ccf2c6c066c655541ac
|
|
4
|
+
data.tar.gz: 5c20b3989759ebe16e2bcc620294bc40366c9568b2960db9a7e51883dcedc300
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 74ef2179bb156014d79aa5a6c7246bb31737bd88e7d9399508bedbfd5a62f2621ac9d5f89a8019e73c741895cf449c5a36791bdf50af405a3df9df92e64057ac
|
|
7
|
+
data.tar.gz: f8d6f9c2ff3774321a86b0acdfc905b8f5f87afedd9dbb2690e4bef0f176b7bed4035caf3ec6e47772a77e2f0b120f0a8169ba33e10454130135063ece6386b6
|
data/bin/typeruby
CHANGED
|
Binary file
|
data/bin/typeruby-mac
CHANGED
|
Binary file
|
data/bin/typeruby.exe
CHANGED
|
Binary file
|
data/bin/typeruby.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'typeruby'
|
|
3
|
-
s.version = '0.1.
|
|
3
|
+
s.version = '0.1.2'
|
|
4
4
|
s.summary = 'Typeruby CLI (TypeScript-powered) for Ruby'
|
|
5
5
|
s.description = 'Reads .trb files, checks type annotations, and generates pure Ruby.'
|
|
6
6
|
s.authors = ["yangycl"]
|
data/compile.js
CHANGED
|
@@ -28,6 +28,16 @@ function typeChecking(value, type) {
|
|
|
28
28
|
isError: !(/\{.*\}/.test(value)),
|
|
29
29
|
type: type
|
|
30
30
|
};
|
|
31
|
+
case "[]":
|
|
32
|
+
return {
|
|
33
|
+
isError: !(/\[.*\]/.test(value)),
|
|
34
|
+
type: type
|
|
35
|
+
};
|
|
36
|
+
case "{}":
|
|
37
|
+
return {
|
|
38
|
+
isError: !(/\{.*\}/.test(value)),
|
|
39
|
+
type: type
|
|
40
|
+
};
|
|
31
41
|
default:
|
|
32
42
|
return {
|
|
33
43
|
isError: true,
|
data/compile.ts
CHANGED
|
@@ -29,6 +29,16 @@ function typeChecking(value:string, type:string):typeCheck{
|
|
|
29
29
|
isError:!(/\{.*\}/.test(value)),
|
|
30
30
|
type:type
|
|
31
31
|
}
|
|
32
|
+
case "[]":
|
|
33
|
+
return{
|
|
34
|
+
isError:!(/\[.*\]/.test(value)),
|
|
35
|
+
type:type
|
|
36
|
+
}
|
|
37
|
+
case "{}":
|
|
38
|
+
return{
|
|
39
|
+
isError:!(/\{.*\}/.test(value)),
|
|
40
|
+
type:type
|
|
41
|
+
}
|
|
32
42
|
default:
|
|
33
43
|
return{
|
|
34
44
|
isError:true,
|