code-ruby 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/code/object/argument.rb +0 -12
- data/lib/code/object/boolean.rb +4 -0
- data/lib/code/object/class.rb +4 -0
- data/lib/code/object/date.rb +4 -0
- data/lib/code/object/decimal.rb +4 -0
- data/lib/code/object/dictionary.rb +4 -0
- data/lib/code/object/duration.rb +4 -0
- data/lib/code/object/function.rb +4 -0
- data/lib/code/object/global.rb +0 -4
- data/lib/code/object/integer.rb +4 -0
- data/lib/code/object/list.rb +4 -0
- data/lib/code/object/nothing.rb +4 -0
- data/lib/code/object/range.rb +4 -0
- data/lib/code/object/string.rb +4 -0
- data/lib/code/object/time.rb +4 -0
- data/lib/code/object.rb +8 -0
- data/lib/code/version.rb +1 -1
- data/lib/code-ruby.rb +6 -4
- data/spec/code_spec.rb +4 -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: 1f92c4c4db84ee34d5e5d58325ab4de49d9346a738239aba44682db9e2530e7e
|
4
|
+
data.tar.gz: 6d056953ec6852d7824343f45198e0b35f13db881420fdce645753e091249ac7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98ddcc59fe93cf2625cbc521a08b2119bcb8fc1bd8cd6fd3da6fb40039a73aa8835e35234c3e77842fbbcc6fa57fe51377e96f457bfd6e391a5bd96d37229296
|
7
|
+
data.tar.gz: 7b2723a4c912be64c3c7588fb905b40c6cd8fc510a61ca56a7af21037bd8d27d29a667659ea07a97d096d9a44d01dc6a5064f7a45ee58e39770d016a479353af
|
data/lib/code/object/argument.rb
CHANGED
@@ -10,14 +10,6 @@ class Code
|
|
10
10
|
@name = name
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.name
|
14
|
-
"Argument"
|
15
|
-
end
|
16
|
-
|
17
|
-
def inspect
|
18
|
-
to_s
|
19
|
-
end
|
20
|
-
|
21
13
|
def keyword?
|
22
14
|
!regular?
|
23
15
|
end
|
@@ -29,10 +21,6 @@ class Code
|
|
29
21
|
def regular?
|
30
22
|
!name
|
31
23
|
end
|
32
|
-
|
33
|
-
def to_s
|
34
|
-
"<Argument #{value.inspect}>"
|
35
|
-
end
|
36
24
|
end
|
37
25
|
end
|
38
26
|
end
|
data/lib/code/object/boolean.rb
CHANGED
data/lib/code/object/class.rb
CHANGED
data/lib/code/object/date.rb
CHANGED
data/lib/code/object/decimal.rb
CHANGED
data/lib/code/object/duration.rb
CHANGED
data/lib/code/object/function.rb
CHANGED
data/lib/code/object/global.rb
CHANGED
data/lib/code/object/integer.rb
CHANGED
data/lib/code/object/list.rb
CHANGED
data/lib/code/object/nothing.rb
CHANGED
data/lib/code/object/range.rb
CHANGED
data/lib/code/object/string.rb
CHANGED
data/lib/code/object/time.rb
CHANGED
data/lib/code/object.rb
CHANGED
data/lib/code/version.rb
CHANGED
data/lib/code-ruby.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "active_support"
|
4
|
+
require "active_support/core_ext/date/conversions"
|
5
|
+
require "active_support/core_ext/numeric/time"
|
6
|
+
require "active_support/core_ext/object/json"
|
3
7
|
require "bigdecimal"
|
8
|
+
require "json"
|
9
|
+
require "language-ruby"
|
4
10
|
require "stringio"
|
5
11
|
require "timeout"
|
6
12
|
require "zeitwerk"
|
7
|
-
require "language-ruby"
|
8
|
-
require "active_support"
|
9
|
-
require "active_support/core_ext/numeric/time"
|
10
|
-
require "active_support/core_ext/date/conversions"
|
11
13
|
|
12
14
|
loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
|
13
15
|
loader.ignore("#{__dir__}/code-ruby.rb")
|
data/spec/code_spec.rb
CHANGED
@@ -146,6 +146,10 @@ RSpec.describe Code do
|
|
146
146
|
it "#{input} == #{expected}" do
|
147
147
|
expect(Code.evaluate(input)).to eq(Code.evaluate(expected))
|
148
148
|
end
|
149
|
+
|
150
|
+
it "#{input} converts to json like #{expected}" do
|
151
|
+
expect(Code.evaluate(input).to_json).to eq(Code.evaluate(expected).to_json)
|
152
|
+
end
|
149
153
|
end
|
150
154
|
|
151
155
|
%w[
|