hesabu 0.1.3 → 0.1.4

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: a7919ff5f5986fbf22b42ccbc75d9b782619a6a037219d4e379528777e86168c
4
- data.tar.gz: 7b33587c21aaf91e74c2d64d835d54b923a729e20dcd1419597b53411ca2972a
3
+ metadata.gz: b89b737f24684f9cc743989c0b641873653cd3bb242c74dfbfab218a17685f65
4
+ data.tar.gz: 17cd26ba5d1d309bbe4bd83b0a4cc09723b1d46b38b920c147b94f255639e810
5
5
  SHA512:
6
- metadata.gz: 93953561238b518ae4287e12a72725c55668402ebf0e7cac31f9559b12eabd45bde96af2b5a256d3d0ea2157a82a77eb8d217907d53a17afdffc94e87903b3a0
7
- data.tar.gz: 1950edd4e3a4c757d8e97d8fde8b6d9013b470474545ce590925bf50314d2339cfea816732b1dc86da444c541763d7b9498f203a71d6e457b15543ea669dffe4
6
+ metadata.gz: 81eaf12d1f76033f8c02cc1fa09e061f4af3e678ed8ac57907bee046fc1f43802ffb3ad3a4139613b49709f1ba961508846801985aef1d54c16af2c7941915f1
7
+ data.tar.gz: b454820dcbab67c1c24e3aef4402e464573edd2d8d9d35264c9a9910ad6b17424f729b33fc5a2a950415085415d1e20b7877f4e8dd10c166280d8ec0b03ea22c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hesabu (0.1.2)
4
+ hesabu (0.1.3)
5
5
  parslet
6
6
 
7
7
  GEM
data/lib/hesabu/errors.rb CHANGED
@@ -2,6 +2,8 @@
2
2
  module Hesabu
3
3
  class Error < StandardError
4
4
  end
5
+ class ArgumentError < Error
6
+ end
5
7
  class ParseError < Error
6
8
  end
7
9
  class CalculationError < Error
data/lib/hesabu/solver.rb CHANGED
@@ -14,6 +14,10 @@ module Hesabu
14
14
  end
15
15
 
16
16
  def add(name, raw_expression)
17
+ if raw_expression.nil? || name.nil?
18
+ raise Hesabu::ArgumentError, "name or expression can't be nil : '#{name}', '#{raw_expression}'"
19
+ end
20
+
17
21
  if ::Hesabu::Types.as_numeric(raw_expression)
18
22
  add_numeric(name, raw_expression)
19
23
  else
@@ -1,3 +1,3 @@
1
1
  module Hesabu
2
- VERSION = "0.1.3".freeze
2
+ VERSION = "0.1.4".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hesabu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stéphan Mestach