parsecs 0.3.1 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95191e497a3b1574f7a3e20a500d302624ded3f11717af0cf5300c556d5e31cc
4
- data.tar.gz: 983d7ac08769c875431ca5486ca9a349684c55042f779a91b83db60bf47a09a7
3
+ metadata.gz: 219c85823eeec9cf36a7623ce522c5059b7fb0d2b4e19fdff86bbf7a4fa0a763
4
+ data.tar.gz: c2f6a125b730db44fa8aefeb507287e913389be64d18806ea5e6e237fd6d1e8b
5
5
  SHA512:
6
- metadata.gz: ff7a5a611816c7b0f7056158b1096ab69526191223cf702a738226a869db78d3992667b1c8c55f9d61e80147e5c924e5879cff518e840eab6c8408d6fb71d5d4
7
- data.tar.gz: 6f43c0e08aea7114bb9216ac4de1528dc2aceeabc80017138ea21e6e8159585736545021b7f1e9671748279937f0822c6b08dc88097f0b17fce8332e3f4bf03b
6
+ metadata.gz: 20b7f32e0dfa829c70db84c18885ff623f980045633bf8488ffcafdaa305f274d896a6a8cff01e564a3c5f969207ac8379d70010acde07255d9e5c5a76ab993a
7
+ data.tar.gz: cba4799932c699f0bccf18f0db670440a757d3c721fcde1018106211ea5b25ae853d1aa43d5aef43f4ade5371468430075191509b29bdfe797cb3769e88ee99d
@@ -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 = 'e60587a4ae9136f6c70054f230b983225074ae31'.freeze
41
+ COMMIT = '65ff99e53961d86f14d214e49154ae26c94ec221'.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.3.1'.freeze
9
+ VERSION = '0.4.1'.freeze
10
10
 
11
11
  # evaluates the equation
12
12
  def self.eval_equation(equation)
data/test/test_parsec.rb CHANGED
@@ -57,6 +57,7 @@ class TestParsec < Minitest::Test
57
57
  assert_equal('test string', parser.eval_equation('tolower("TEST STRING")'))
58
58
  assert_equal('Hello World', parser.eval_equation('concat("Hello ", "World")'))
59
59
  assert_equal(5, parser.eval_equation('str2number("5")'))
60
+ assert_equal(5, parser.eval_equation('number("5")'))
60
61
  assert_equal('Hello', parser.eval_equation('left("Hello World", 5)'))
61
62
  assert_equal('World', parser.eval_equation('right("Hello World", 5)'))
62
63
  end
@@ -84,6 +85,8 @@ class TestParsec < Minitest::Test
84
85
  assert_equal(0.55, parsec.eval_equation('avg(1,2,3,4,5,6,7,8,9,10) / 10'))
85
86
  assert_equal(5, parsec.eval_equation('round(4.62)'))
86
87
  assert_equal(4.63, parsec.eval_equation('round_decimal(4.625, 2)'))
88
+ assert_equal('5', parsec.eval_equation('string(5)'))
89
+ assert_equal('5.123', parsec.eval_equation('string(5.123)'))
87
90
  end
88
91
 
89
92
  def test_newlines_remotion
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.3.1
4
+ version: 0.4.1
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: 2019-02-12 00:00:00.000000000 Z
13
+ date: 2019-02-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: minitest
@@ -82,7 +82,7 @@ requirements:
82
82
  - swig
83
83
  - cmake
84
84
  rubyforge_project:
85
- rubygems_version: 2.7.7
85
+ rubygems_version: 2.7.6
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: A gem to evaluate equations using muparserx C++ library