code-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: 2b29f8f45f88a9c9ccd84fc3bcf830ea548742e8587e03476a8edd3d3e315b1d
|
4
|
+
data.tar.gz: 23cc48f2a4e786a14a51fab7fb4930da343f96a29de7b1992ff0ce07718ef204
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99819e4bae8c1bc53b9cc8e162ba2b9ff34e2434039e9fc700f1bf28686ae26e2c9ba92fd9359d545d542c9c7456709b95bd7454ef596e5799a65f93ff03abb3
|
7
|
+
data.tar.gz: bd7bed0d5decbaa3af28c789fe9fc35085d39e24a1b9d047733afb35d362343fb3f9508e7682b5cb4fb9d8e098aa2a321f2db93e8918ac2cb6444dca5bddd1ec
|
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: code-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
|