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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f665bb92a67fd0769a477d7ef174267535c75b6b
4
- data.tar.gz: afa0d72489613c49cf37785cdcbf90c95fa62074
3
+ metadata.gz: 310ec78adb382f1021cf82fb2720bc0d3bfb58f8
4
+ data.tar.gz: 478ab2bc0cd1500973798af408c468b7719a6bc4
5
5
  SHA512:
6
- metadata.gz: cdb713258835e5dbbbd94deaadec930fbc5585f6cba6cb87b6dbf06cb1d4ed737e68b37205aa6b70928ef8fa23764834c7f91c680c6a4fb2fc2c2e8fac55f863
7
- data.tar.gz: 84f522bdc77047a4e74f22e25b028842cb9a30068bd9e7f9a43113451d22b89c03893ef4055c2163e2c7e803f1f4fe6d885e30030ef41417f7811ea9d5d4527a
6
+ metadata.gz: bedfd485e89a3b0f8352d2a3aed09c13ce82546fe0077a2500a730bec07d836e9a453562e66252068c10e7e5598c4fb3a219b11f0a65004a8d2e4aa96fa4d88d
7
+ data.tar.gz: aa340b2414aed308d89cba9f26aefaf5391a60252a50910a4257945b45d7b4178fe51188f81e294f8a2750595ddd758643ccf8bd238d36801683c13b7a0773f9
@@ -4,7 +4,7 @@ require 'bigdecimal'
4
4
 
5
5
  module Delorean
6
6
 
7
- DT_TYPES = [Date, Time, ActiveSupport::TimeWithZone]
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]],
@@ -1,3 +1,3 @@
1
1
  module Delorean
2
- VERSION = "0.3.34"
2
+ VERSION = "0.3.35"
3
3
  end
@@ -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.34
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-01-12 00:00:00.000000000 Z
11
+ date: 2018-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: treetop