delorean_lang 0.3.22 → 0.3.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b207fc973fc90335626ca0a40230e8e4de8f01b
4
- data.tar.gz: 15d6ac7d5e9c9505ca9eb3410ab7911433380dbb
3
+ metadata.gz: 71daf4a8d118aef147b0abd9d0f4a0d8919c91c9
4
+ data.tar.gz: 5bad4fbe203315cd8e35dcad1dfbe93a75058dc2
5
5
  SHA512:
6
- metadata.gz: 9a10a56f2c88a05e3c6a5aac6885781f5d9fa77b065488ad967d3127a13bc806d770e357f2cbaf46efe9ca610324302898cf0ed75f34271e92bf235aa21df261
7
- data.tar.gz: 70a91b3fc828e7667b0e0800c7010697987c79ae4ec16f588946ca8c815a9a22ac491b0250091109813669db395614a3c1ab85c57ffd98041dd21420750a1e16
6
+ metadata.gz: 5c50337e401efb4ec07826fa544ff780a39dca641a6c7cb37fe41659eb48393e6b2d3c30e91267c6e341708589f72b46fff6792d8cf0804a40faabd77740329a
7
+ data.tar.gz: 1a7f0a41c8ed14c7f511b17b9da8e18279a86beb74f66ef433f3ea2d51499a276bf3c74050709d09f351c934ce8f2310c2b32625d7a62958c9e179b370865e1e
@@ -1,8 +1,12 @@
1
1
  require 'active_support/time'
2
+ require 'active_record'
2
3
  require 'bigdecimal'
3
4
 
4
5
  module Delorean
5
6
 
7
+ # FIXME: add string.gsub; Also, should be able to index regex
8
+ # matches. Need string.length.
9
+
6
10
  # FIXME: the whitelist is quite hacky. It's currently difficult to
7
11
  # override it. A user will likely want to directly modify this
8
12
  # hash. The whole whitelist mechanism should be eventually
@@ -31,8 +35,8 @@ module Delorean
31
35
  zip: [Array, [Array, Array, Array]],
32
36
  index: [Array, [Object]],
33
37
  product: [Array, Array],
34
- first: [Enumerable, [nil, Fixnum]],
35
- last: [Enumerable, [nil, Fixnum]],
38
+ first: [[ActiveRecord::Relation, Enumerable], [nil, Fixnum]],
39
+ last: [[ActiveRecord::Relation, Enumerable], [nil, Fixnum]],
36
40
  intersection: [Set, Enumerable],
37
41
  union: [Set, Enumerable],
38
42
 
@@ -257,7 +261,8 @@ module Delorean
257
261
  raise "bad arg #{i}, method #{method}: #{ai}/#{ai.class} #{s}" if !ok
258
262
  }
259
263
 
260
- obj.send(msg, *args).freeze
264
+ res = obj.send(msg, *args)
265
+ ActiveRecord::Relation === res ? res : res.freeze
261
266
  end
262
267
 
263
268
  ######################################################################
@@ -1,3 +1,3 @@
1
1
  module Delorean
2
- VERSION = "0.3.22"
2
+ VERSION = "0.3.23"
3
3
  end
@@ -727,6 +727,13 @@ describe "Delorean" do
727
727
  )
728
728
  end
729
729
 
730
+ it "should parse multiline empty list" do
731
+ engine.parse defn("A:",
732
+ " a = [",
733
+ " ]",
734
+ )
735
+ end
736
+
730
737
  it "should give proper errors on parse multiline attr defs" do
731
738
  begin
732
739
  engine.parse defn("A:",
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.22
4
+ version: 0.3.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Bostani
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-20 00:00:00.000000000 Z
11
+ date: 2017-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: treetop