parsecs 0.11.1 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/parsec.rb +2 -2
  3. data/test/test_parsec.rb +1 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 350da8f290d5c71fe46d88c97ea79a6aabb24a0ecb87bff326a3483c3858ad63
4
- data.tar.gz: 0d0484793521f595e4b7fb4693892d0e83c4a26afefab215ec51c708c1f04745
3
+ metadata.gz: '0521908edb1a931bc50d3f62042405b9d7820fa50cda37c4313b1320f9520b7a'
4
+ data.tar.gz: 5338f27f94d431e9ae26cf1eb8ff06455f52c2fb5c45c7fa49c565bcf6b2160f
5
5
  SHA512:
6
- metadata.gz: c097c7bf8cf1ad6d1578043f9add109dc300d07cf26c21f9b5b28276f1345a629790d9c8eb91d7bd4973e8043b4c4484d5c8ede12aa071b46f755839ed2ce248
7
- data.tar.gz: 3bffd0f7e85ac0eb765db5e01d8bf7b2e6b36660a1fa262456eeff1aab1516913bf2f4695e75d9d9f9fe0442aa3902f0f8e4ddcc2e7bd83d7b82b7b592ee24fd
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.1'.freeze
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.1
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: 2021-09-21 00:00:00.000000000 Z
13
+ date: 2022-08-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: minitest