typ-formatter 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/typ/formatter.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e4e33337a51f5d9c3e197e29cfcf3e5e51bbcbb341c923e5c0efc6a711e240c
|
4
|
+
data.tar.gz: 22be26a0cfdc410f9b828f26ce691376e6bdba52e3b5fa148013332435fd0fd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07062bb2dcd94f09916a69fa05eaa30bcc3e97114d8d956c10a8291b02d95ca9e2631be0fe1b1b0aff633933158c3316e489806bd9c45a18cae87408b1a29e18
|
7
|
+
data.tar.gz: 42caa83d32d8a78692995ec255a2fd42ab55984e759e1d66f3aad29e0e548b69b920239c3e10e3b3f723a7f50afdcb041993881ae99a0a189ab18100aa9a3be9
|
data/lib/typ/formatter.rb
CHANGED
@@ -29,6 +29,8 @@ module Typ
|
|
29
29
|
self.class.new gate
|
30
30
|
when Is::Array
|
31
31
|
format_is_array gate
|
32
|
+
when IsA
|
33
|
+
format_is_a gate
|
32
34
|
end
|
33
35
|
end
|
34
36
|
|
@@ -36,5 +38,15 @@ module Typ
|
|
36
38
|
string = "is #{gate.to_a}"
|
37
39
|
gate.ok? ? Rainbow(string).green : Rainbow(string).red
|
38
40
|
end
|
41
|
+
|
42
|
+
def format_is_a gate
|
43
|
+
is_a = "is_a #{gate.class.type}"
|
44
|
+
|
45
|
+
if gate.ok?
|
46
|
+
Rainbow(is_a).green
|
47
|
+
else
|
48
|
+
Rainbow(is_a).red + "\n" + "got #{gate.it.class}".indent(2)
|
49
|
+
end
|
50
|
+
end
|
39
51
|
end
|
40
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typ-formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anatoly Chernow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|