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 +4 -4
- data/lib/delorean/base.rb +8 -3
- data/lib/delorean/version.rb +1 -1
- data/spec/parse_spec.rb +7 -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: 71daf4a8d118aef147b0abd9d0f4a0d8919c91c9
|
4
|
+
data.tar.gz: 5bad4fbe203315cd8e35dcad1dfbe93a75058dc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c50337e401efb4ec07826fa544ff780a39dca641a6c7cb37fe41659eb48393e6b2d3c30e91267c6e341708589f72b46fff6792d8cf0804a40faabd77740329a
|
7
|
+
data.tar.gz: 1a7f0a41c8ed14c7f511b17b9da8e18279a86beb74f66ef433f3ea2d51499a276bf3c74050709d09f351c934ce8f2310c2b32625d7a62958c9e179b370865e1e
|
data/lib/delorean/base.rb
CHANGED
@@ -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)
|
264
|
+
res = obj.send(msg, *args)
|
265
|
+
ActiveRecord::Relation === res ? res : res.freeze
|
261
266
|
end
|
262
267
|
|
263
268
|
######################################################################
|
data/lib/delorean/version.rb
CHANGED
data/spec/parse_spec.rb
CHANGED
@@ -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.
|
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:
|
11
|
+
date: 2017-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: treetop
|