template-ruby 0.5.3 → 0.5.4
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/code/ruby.rb +13 -1
- data/lib/template/version.rb +1 -1
- data/spec/code/code_spec.rb +7 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d373d6c2c0b4677b6459199509a307e8b0e2cc838f1d1df314fea34a9ba20f4
|
4
|
+
data.tar.gz: 2d81c4e457a8a5459fa07680bcfaa3bf7b1684b017420e4824107cdeddf8a55a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33e53e7abb02d42165f942fb057b4841386f5c1dff1cb907a0471f98369bf13f267f2ad078eb6c6b9aeb0a93e0234accc90d9123c8bfc306f4b8b5c56162871a
|
7
|
+
data.tar.gz: 50c889240055297df35cf515c1298e79d297dadef212c00121fe3c663d488d3679ec388a25869ec661982110220c188b8f3a3e172bdc1ebba1780a8852b8f396
|
data/lib/code/ruby.rb
CHANGED
@@ -15,6 +15,8 @@ class Code
|
|
15
15
|
def to_code
|
16
16
|
if code?
|
17
17
|
raw
|
18
|
+
elsif nil?
|
19
|
+
::Code::Object::Nothing.new
|
18
20
|
elsif true?
|
19
21
|
::Code::Object::Boolean.new(raw)
|
20
22
|
elsif false?
|
@@ -50,7 +52,9 @@ class Code
|
|
50
52
|
|
51
53
|
def from_code
|
52
54
|
if code?
|
53
|
-
if
|
55
|
+
if code_nothing?
|
56
|
+
raw.raw
|
57
|
+
elsif code_boolean?
|
54
58
|
raw.raw
|
55
59
|
elsif code_decimal?
|
56
60
|
raw.raw
|
@@ -87,6 +91,10 @@ class Code
|
|
87
91
|
raw.is_a?(::Code::Object)
|
88
92
|
end
|
89
93
|
|
94
|
+
def nil?
|
95
|
+
raw.is_a?(::NilClass)
|
96
|
+
end
|
97
|
+
|
90
98
|
def true?
|
91
99
|
raw.is_a?(::TrueClass)
|
92
100
|
end
|
@@ -127,6 +135,10 @@ class Code
|
|
127
135
|
raw.is_a?(::Proc)
|
128
136
|
end
|
129
137
|
|
138
|
+
def code_nothing?
|
139
|
+
raw.is_a?(::Code::Object::Nothing)
|
140
|
+
end
|
141
|
+
|
130
142
|
def code_boolean?
|
131
143
|
raw.is_a?(::Code::Object::Boolean)
|
132
144
|
end
|
data/lib/template/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: template-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Marié
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -182,6 +182,7 @@ files:
|
|
182
182
|
- spec/code/boolean_spec.rb
|
183
183
|
- spec/code/call_spec.rb
|
184
184
|
- spec/code/chained_call_spec.rb
|
185
|
+
- spec/code/code_spec.rb
|
185
186
|
- spec/code/dictionnary_spec.rb
|
186
187
|
- spec/code/equal_spec.rb
|
187
188
|
- spec/code/equality_spec.rb
|
@@ -250,6 +251,7 @@ test_files:
|
|
250
251
|
- spec/code/boolean_spec.rb
|
251
252
|
- spec/code/call_spec.rb
|
252
253
|
- spec/code/chained_call_spec.rb
|
254
|
+
- spec/code/code_spec.rb
|
253
255
|
- spec/code/dictionnary_spec.rb
|
254
256
|
- spec/code/equal_spec.rb
|
255
257
|
- spec/code/equality_spec.rb
|