arithmetic 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/Gemfile.lock +4 -1
- data/lib/arithmetic/nodes.rb +11 -1
- data/lib/arithmetic/version.rb +1 -1
- data/spec/arithmetic_spec.rb +4 -0
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NzU1ZWJlOTViNzIxZGY2MzA1YjczNTdjM2NmMWRkYTY5ZTQ3OGM3ZQ==
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b8c6ca40238fa6f91a63c2e1ca8e4dad24d32173cf0aa155f00da34aefe9e48e
|
4
|
+
data.tar.gz: b7f1e55c16263fe2085f43e8d9444ce1b98b9465587b3e81e97922ea32cc1991
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
OTMzMGEyZDI2MDkzMjE2MDJiMmIzOGQwYTAxYzQwYTgwNzAyMDRkZDdmNGIx
|
11
|
-
ZTM5ZGE0OGVjZGVkYTk1MGI0YmE1NTcxNzU4NmQ4Y2RlNmJmNGY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ODYyODFiZTFkOGRkMGZiNGUwZDhkYzE4MDVkMzMyMjczM2IwYzM4NTJjZjgx
|
14
|
-
ODIxNDJkNjBkYzYzYTAxNDlkZDA2NzIxZDgwZGUxMTc5MWJjMjAzZDY3ZWRl
|
15
|
-
YzU5Y2M5NjRkNDJkZWNlM2FmODg5NGQwOWE4OTg3MTRhYWIxMGI=
|
6
|
+
metadata.gz: a4f60179977cb1d3ec75d432cf50bbfdcba0f1a4d15a633de9dcfcd10ea51f321fe5448c3b01b8573fc342b2938304c1481842ec6499416afa4eccbe0389a369
|
7
|
+
data.tar.gz: 96eab3b67e6e403357bfdf0b8cd014d7ef7ae76a6a1ef9768d8be7813cf32d283bce4aee6c4d9d189fcbf903e9e8f2de06230363f0f77c011f1da7cb0eae0187
|
data/Gemfile.lock
CHANGED
data/lib/arithmetic/nodes.rb
CHANGED
@@ -11,7 +11,17 @@ module Arithmetic
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def eval
|
14
|
-
|
14
|
+
if has_dangling_decimal_point?
|
15
|
+
BigDecimal.new(@operand + "0")
|
16
|
+
else
|
17
|
+
BigDecimal.new(@operand)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def has_dangling_decimal_point?
|
24
|
+
@operand.is_a?(String) && @operand.end_with?(".")
|
15
25
|
end
|
16
26
|
end
|
17
27
|
|
data/lib/arithmetic/version.rb
CHANGED
data/spec/arithmetic_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arithmetic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Kirby
|
@@ -9,34 +9,34 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
description: Simple arithmetic calculator for Ruby
|
@@ -47,7 +47,7 @@ executables: []
|
|
47
47
|
extensions: []
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
|
-
- .gitignore
|
50
|
+
- ".gitignore"
|
51
51
|
- Gemfile
|
52
52
|
- Gemfile.lock
|
53
53
|
- LICENSE.txt
|
@@ -71,17 +71,17 @@ require_paths:
|
|
71
71
|
- lib
|
72
72
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
83
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.
|
84
|
+
rubygems_version: 2.7.6.2
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: Simple arithmetic calculator for Ruby
|