delorean_lang 0.3.10 → 0.3.11

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: a58f7a6d95c5d45ec252ffbe151156a1ecb70cc6
4
- data.tar.gz: 7b01a547ec10a574b4901028fc744cb3f0bf1597
3
+ metadata.gz: 866d71925ad5bc4a6f01e40a13eee2ff763d8c77
4
+ data.tar.gz: f268000224451c6e574576482676fc6ac8128e75
5
5
  SHA512:
6
- metadata.gz: 2b8506f922f2f1c3c6159f8958d5b86b31b080f7c3b1363510c13d9411888275d662a05490d7ac7e7ead3483ca8fee062b1fcc10d1e1e8723fb9f46d44d67516
7
- data.tar.gz: b746243116955a132e8ff001dd50c0f67bcfd2ec969db75d148c0f533075c495ec804b43497af859a799c2c0399d93607f543fb69fe82a70b3f9e57fc53ef0d5
6
+ metadata.gz: dcf34cbf2c38d099e0df1c7854073b1c610a20294b94da173c7f14ba586b067fac1587fd01d4c8e38e566b70b53f7ea56ff56e0c4d1dab2b6f5f52284126bd2e
7
+ data.tar.gz: 1c1d4b171a14bc1e08a57a8831d50daabdd76c5e395528c421f97e26947ef5bbdbb2051e2316d0996094f10575c297eae412a0c9136362f83dcee20f21cb637a
@@ -22,6 +22,7 @@ module Delorean
22
22
  uniq: [Array],
23
23
  sum: [Array],
24
24
  transpose: [Array],
25
+ join: [Array, String],
25
26
  zip: [Array, [Array, Array, Array]],
26
27
  index: [Array, [Object]],
27
28
  product: [Array, Array],
@@ -39,7 +40,7 @@ module Delorean
39
40
  hour: [[Date, Time, ActiveSupport::TimeWithZone]],
40
41
  min: [[Date, Time, ActiveSupport::TimeWithZone, Array]],
41
42
  sec: [[Date, Time, ActiveSupport::TimeWithZone]],
42
- to_date: [[Date, Time, ActiveSupport::TimeWithZone]],
43
+ to_date: [[Date, Time, ActiveSupport::TimeWithZone, String]],
43
44
 
44
45
  month: [[Date, Time, ActiveSupport::TimeWithZone]],
45
46
  day: [[Date, Time, ActiveSupport::TimeWithZone]],
@@ -147,7 +148,7 @@ module Delorean
147
148
  obj.instance_of?(NodeCall) || obj.instance_of?(Class)
148
149
  raise InvalidIndex unless args.length == 1
149
150
  _get_attr(obj, args[0], _e)
150
- elsif obj.instance_of?(Array)
151
+ elsif obj.instance_of?(Array) || obj.instance_of?(String)
151
152
  raise InvalidIndex unless args.length <= 2
152
153
  raise InvalidIndex unless
153
154
  args[0].is_a?(Fixnum) && (!args[1] || args[1].is_a?(Fixnum))
@@ -1,3 +1,3 @@
1
1
  module Delorean
2
- VERSION = "0.3.10"
2
+ VERSION = "0.3.11"
3
3
  end
@@ -76,12 +76,13 @@ describe "Delorean" do
76
76
  " m = p.min()",
77
77
  " s = p.sec()",
78
78
  " d = p.to_date()",
79
+ " e = p.to_date.to_s.to_date",
79
80
  )
80
81
 
81
82
  p = Time.now
82
83
  params = {"p" => p}
83
- r = engine.evaluate_attrs("A", %w{h m s d}, params)
84
- r.should == [p.hour, p.min, p.sec, p.to_date]
84
+ r = engine.evaluate_attrs("A", %w{h m s d e}, params)
85
+ r.should == [p.hour, p.min, p.sec, p.to_date, p.to_date]
85
86
 
86
87
  # Non time argument should raise an error
87
88
  expect { engine.evaluate_attrs("A", ["m"], {"p" => 123}) }.to raise_error
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.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Bostani
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-28 00:00:00.000000000 Z
11
+ date: 2014-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: treetop