parsecs 0.9.1 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 787c99411c7e672564b1dafb59bc4827ec8e185d4e44c16fc6446d794f59e726
4
- data.tar.gz: 5c060e8bc1799a012182014258f02cda546b32f0038c765a56c0c41e75049f25
3
+ metadata.gz: 872f4306482aab0ddea0dcc751284936637fe5693c3910f75a59ad8504f21114
4
+ data.tar.gz: e218fdce7f8449d8366429d45075f99e29acf2fef37a42b78bb383366c980b39
5
5
  SHA512:
6
- metadata.gz: e99a93bd999b2e9bb60e664ca89833e007238d8a93cdafb23f6f142b641f9893e228019f3ca8b6298f6e07b865d3370417473026ffb3f36272b44a178d4d39dc
7
- data.tar.gz: 31c3a16a7dc6e32ebcd54be4c726070ec443100e00e663293c525721c5953f4a3ef23b579a37287db71e3f5f5cabc0e1d22ca55d7c2994444a0b1b3f56a72479
6
+ metadata.gz: c6852a76f55edeace33df216bcaf65e6491c7f6ef40dee3ff2d2c144d08ec659bc7b2e682ef0ca3589d75302a7ceff5b153b0d7950842391faeaa86b95d1c9d5
7
+ data.tar.gz: 37358e63b4cfb396dccca6da93172ebc6f097f74b0f85bf12b7083d0e0cf449e25afc93cf323f8e8b7360d4d303a3989835ef19af8095f93ba74f857032b9d7d
@@ -38,7 +38,7 @@ libs.each do |lib|
38
38
  end
39
39
 
40
40
  GIT_REPOSITORY = 'https://github.com/niltonvasques/equations-parser.git'.freeze
41
- COMMIT = '8951b6498c465808b897457fe61fb0b52fdc1c65'.freeze
41
+ COMMIT = '8942cecb71bec402c0487ab77fec97759ff82fdb'.freeze
42
42
 
43
43
  Dir.chdir(BASEDIR) do
44
44
  system('git init')
data/lib/parsec.rb CHANGED
@@ -6,7 +6,7 @@ module Parsec
6
6
  class Parsec
7
7
  using StringToBooleanRefinements
8
8
 
9
- VERSION = '0.9.1'.freeze
9
+ VERSION = '0.9.2'.freeze
10
10
 
11
11
  # evaluates the equation and returns only the result
12
12
  def self.eval_equation(equation)
data/test/test_parsec.rb CHANGED
@@ -60,7 +60,6 @@ class TestParsec < Minitest::Test
60
60
  assert_equal(5, parser.eval_equation('number("5")'))
61
61
  assert_equal('Hello', parser.eval_equation('left("Hello World", 5)'))
62
62
  assert_equal('World', parser.eval_equation('right("Hello World", 5)'))
63
- puts parser.eval_equation('link("Title", "http://foo.bar")')
64
63
  assert_equal('<a href="http://foo.bar">Title</a>', parser.eval_equation('link("Title", "http://foo.bar")'))
65
64
  assert_equal('<a href="#">Title</a>', parser.eval_equation('link("Title", "#")'))
66
65
  assert_equal('<a href="/test">Test title</a>', parser.eval_equation('link("Test title", "/test")'))
@@ -196,6 +195,15 @@ class TestParsec < Minitest::Test
196
195
  assert_equal('1-1234-1234-1234-1234', parsec.eval_equation('mask("0-0000-0000-0000-0000", 11234123412341234)'))
197
196
  end
198
197
 
198
+ def test_string_cast
199
+ parsec = Parsec::Parsec
200
+ assert_equal('4', parsec.eval_equation('string(4)'))
201
+ assert_equal('4.5', parsec.eval_equation('string(4.5)'))
202
+ assert_equal('true', parsec.eval_equation('string(true)'))
203
+ assert_equal('false', parsec.eval_equation('string(false)'))
204
+ assert_equal('4', parsec.eval_equation('string("4")'))
205
+ end
206
+
199
207
  def test_default_value
200
208
  parsec = Parsec::Parsec
201
209
 
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.9.1
4
+ version: 0.9.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-03-11 00:00:00.000000000 Z
13
+ date: 2021-03-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: minitest