kalculator 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kalculator/evaluator.rb +3 -2
- data/lib/kalculator/parser.rb +1 -1
- data/lib/kalculator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b8d9f63d9aa766d2a26f0b17d63f2ed90dccb7ea1cc98013f2e5703445a2fc9
|
4
|
+
data.tar.gz: 54bdd33465e18514a700e1f2a49d24b399ff19556a375c68fda95d868f05145a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2162cfd1c00584151fc1148dc8d0dc3d2e779bf634a623ea9d816270b7d5ceff241421307905b5eb5b72bf7bc979251c1be7232867d2499ea195fc549f466971
|
7
|
+
data.tar.gz: cf4a5db28cb6280c2b7761c6a6ace135103341f987a63b7b6d4bc1ef3476213346e4992590c686f88938b2c4da40bebcb71720247c7c0220e615099741342fec
|
data/lib/kalculator/evaluator.rb
CHANGED
@@ -86,8 +86,9 @@ class Kalculator
|
|
86
86
|
Date.parse(value)
|
87
87
|
end
|
88
88
|
|
89
|
-
def exists(_,
|
90
|
-
|
89
|
+
def exists(_, variable)
|
90
|
+
(_variable, name) = variable
|
91
|
+
@data_source.key?(name)
|
91
92
|
end
|
92
93
|
|
93
94
|
def if(_, condition, true_clause, false_clause)
|
data/lib/kalculator/parser.rb
CHANGED
@@ -23,7 +23,7 @@ class Kalculator
|
|
23
23
|
[:date, e0]
|
24
24
|
end
|
25
25
|
clause('EXISTS LPAREN IDENT RPAREN') do |_, _, n, _|
|
26
|
-
[:exists, n]
|
26
|
+
[:exists, [:variable, n]]
|
27
27
|
end
|
28
28
|
clause('MAX LPAREN expression COMMA expression RPAREN') { |_, _, left, _, right, _| [:max, left, right] }
|
29
29
|
clause('MIN LPAREN expression COMMA expression RPAREN') { |_, _, left, _, right, _| [:min, left, right] }
|
data/lib/kalculator/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kalculator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Ries
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rltk
|