parsecs 0.11.1 → 0.11.2
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/parsec.rb +2 -2
- data/test/test_parsec.rb +1 -0
- 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: '0521908edb1a931bc50d3f62042405b9d7820fa50cda37c4313b1320f9520b7a'
|
4
|
+
data.tar.gz: 5338f27f94d431e9ae26cf1eb8ff06455f52c2fb5c45c7fa49c565bcf6b2160f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 249b1aa99be74e1916d3d0395155b8539fd90df8e66f7317a265b13070f74c97bd1c2baacce331eb3137b051493d2181767b82e8abeaf7cd1080bdd6e3742f75
|
7
|
+
data.tar.gz: 8446a182b3f3876276d23d313b09e7a7e8b36eeb39dcc3a08ff1b05e6839d3fed84fb31f07880cadbb511fc37f87c087127b3f144e609591a2e93119411f00c2
|
data/lib/parsec.rb
CHANGED
@@ -6,7 +6,7 @@ module Parsec
|
|
6
6
|
class Parsec
|
7
7
|
using StringToBooleanRefinements
|
8
8
|
|
9
|
-
VERSION = '0.11.
|
9
|
+
VERSION = '0.11.2'.freeze
|
10
10
|
|
11
11
|
# evaluates the equation and returns only the result
|
12
12
|
def self.eval_equation(equation)
|
@@ -65,7 +65,7 @@ module Parsec
|
|
65
65
|
when 'int' then return ans['value'].to_i
|
66
66
|
when 'float' then return ans['value'].to_f
|
67
67
|
when 'boolean' then return ans['value'].to_bool
|
68
|
-
when 'string' then return error_check(ans['value'])
|
68
|
+
when 'string' then return error_check(ans['value'].force_encoding(Encoding::UTF_8))
|
69
69
|
when 'complex' then return 'complex number' # Maybe future implementation
|
70
70
|
when 'matrix' then return 'matrix value' # Maybe future implementation
|
71
71
|
end
|
data/test/test_parsec.rb
CHANGED
@@ -70,6 +70,7 @@ class TestParsec < Minitest::Test
|
|
70
70
|
assert_equal(false, parser.eval_equation('contains("1234567", "789")'))
|
71
71
|
assert_equal(true, parser.eval_equation('contains("2019-01-01T:08:30", "2019-01-01")'))
|
72
72
|
assert_equal(false, parser.eval_equation('contains("2019-01-01T:08:30", "2021-01-01")'))
|
73
|
+
assert_equal('Maçã', parser.eval_equation('"Maçã"'))
|
73
74
|
assert_raises(SyntaxError) { parser.eval_equation('contains(1234567, "789")') }
|
74
75
|
assert_raises(SyntaxError) { parser.eval_equation('contains("hello", 2.2)') }
|
75
76
|
assert_raises(SyntaxError) { parser.eval_equation_with_type('link()') }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parsecs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nilton Vasques
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-08-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: minitest
|