language-ruby 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- 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: 2efe0c5926ad16a67ec4373bfe2276827c5295778b5a78c27697087dd8f32a58
|
4
|
+
data.tar.gz: 2d81c4e457a8a5459fa07680bcfaa3bf7b1684b017420e4824107cdeddf8a55a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbc41426ffeccd6a83ea79a69a30b1a32d55c989e27cc523667a6453fbd4674f1cb89b152d1fb925141f828d02a0ef61578bebfe705ee42621a9ae25809041b5
|
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: language-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
|
@@ -180,6 +180,7 @@ files:
|
|
180
180
|
- spec/code/boolean_spec.rb
|
181
181
|
- spec/code/call_spec.rb
|
182
182
|
- spec/code/chained_call_spec.rb
|
183
|
+
- spec/code/code_spec.rb
|
183
184
|
- spec/code/dictionnary_spec.rb
|
184
185
|
- spec/code/equal_spec.rb
|
185
186
|
- spec/code/equality_spec.rb
|
@@ -248,6 +249,7 @@ test_files:
|
|
248
249
|
- spec/code/boolean_spec.rb
|
249
250
|
- spec/code/call_spec.rb
|
250
251
|
- spec/code/chained_call_spec.rb
|
252
|
+
- spec/code/code_spec.rb
|
251
253
|
- spec/code/dictionnary_spec.rb
|
252
254
|
- spec/code/equal_spec.rb
|
253
255
|
- spec/code/equality_spec.rb
|