fractional 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fractional.gemspec +1 -1
- data/lib/fractional.rb +1 -3
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 515eba1b411367859891df3da293d8429b458e44
|
4
|
+
data.tar.gz: 8dd7a05144b6d76d8e1a9bdbd872a09401ca5af0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38a327967a97293acecfa8755c70589f407b134e5e1f151b6e030dd75a83da7df50c331c180d90c508fa162136db5a3e235a8aceb071c80f0c2a43bb8fb45f65
|
7
|
+
data.tar.gz: bd7c7fd573616306b05ea224bb9583c07c8aa436568e3fa01d0966926549725946a30b905f6e21593265978c1c621e1b254d1f82694268da2bcac787201eefbb
|
data/fractional.gemspec
CHANGED
data/lib/fractional.rb
CHANGED
@@ -13,14 +13,12 @@ class Fractional < Numeric
|
|
13
13
|
@value = value
|
14
14
|
when String
|
15
15
|
@value = Fractional.string_to_fraction( value, options )
|
16
|
-
when
|
16
|
+
when Numeric
|
17
17
|
if @value == @value.to_i
|
18
18
|
@value = Rational(value)
|
19
19
|
else # It's still Rational if it's a natural number
|
20
20
|
@value = Fractional.float_to_fraction( value.to_f, options )
|
21
21
|
end
|
22
|
-
when Numeric
|
23
|
-
@value = Fractional.float_to_fraction( value.to_f, options )
|
24
22
|
else
|
25
23
|
raise TypeError, "Cannot instantiate Fractional from #{value.class}"
|
26
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fractional
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris O'Sullivan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.6.11
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: 'You can use fractional to convert decimal numbers to string representations
|
@@ -113,4 +113,3 @@ summary: 'You can use fractional to convert decimal numbers to string representa
|
|
113
113
|
test_files:
|
114
114
|
- spec/fractional_spec.rb
|
115
115
|
- spec/spec_helper.rb
|
116
|
-
has_rdoc:
|