delorean_lang 0.3.34 → 0.3.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/delorean/base.rb +2 -2
- data/lib/delorean/version.rb +1 -1
- data/spec/func_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 310ec78adb382f1021cf82fb2720bc0d3bfb58f8
|
4
|
+
data.tar.gz: 478ab2bc0cd1500973798af408c468b7719a6bc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bedfd485e89a3b0f8352d2a3aed09c13ce82546fe0077a2500a730bec07d836e9a453562e66252068c10e7e5598c4fb3a219b11f0a65004a8d2e4aa96fa4d88d
|
7
|
+
data.tar.gz: aa340b2414aed308d89cba9f26aefaf5391a60252a50910a4257945b45d7b4178fe51188f81e294f8a2750595ddd758643ccf8bd238d36801683c13b7a0773f9
|
data/lib/delorean/base.rb
CHANGED
@@ -4,7 +4,7 @@ require 'bigdecimal'
|
|
4
4
|
|
5
5
|
module Delorean
|
6
6
|
|
7
|
-
DT_TYPES
|
7
|
+
DT_TYPES = [Date, Time, ActiveSupport::TimeWithZone]
|
8
8
|
NUM_OR_STR = [Numeric, String]
|
9
9
|
NUM_OR_NIL = [nil, Integer]
|
10
10
|
|
@@ -16,7 +16,7 @@ module Delorean
|
|
16
16
|
attributes: [ActiveRecord::Base],
|
17
17
|
between?: [NUM_OR_STR, NUM_OR_STR, NUM_OR_STR],
|
18
18
|
between: "between?",
|
19
|
-
compact: [Array],
|
19
|
+
compact: [[Array, Hash]],
|
20
20
|
to_set: [Array],
|
21
21
|
flatten: [Array, NUM_OR_NIL],
|
22
22
|
length: [[String, Enumerable]],
|
data/lib/delorean/version.rb
CHANGED
data/spec/func_spec.rb
CHANGED
@@ -15,6 +15,16 @@ describe "Delorean" do
|
|
15
15
|
r.should == 3
|
16
16
|
end
|
17
17
|
|
18
|
+
it "should handle COMPACT" do
|
19
|
+
engine.parse defn("A:",
|
20
|
+
" a = [1, 2, nil, -3, 4].compact",
|
21
|
+
" b = {'a': 1, 'b': nil, 'c': nil}.compact()",
|
22
|
+
)
|
23
|
+
|
24
|
+
expect(engine.evaluate("A", "a")).to eq([1, 2, -3, 4])
|
25
|
+
expect(engine.evaluate("A", "b")).to eq({"a" => 1})
|
26
|
+
end
|
27
|
+
|
18
28
|
it "should handle MIN" do
|
19
29
|
engine.parse defn("A:",
|
20
30
|
" a = [1, 2, -3, 4].min()",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delorean_lang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arman Bostani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: treetop
|