fat_table 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.simplecov +18 -0
- data/fat_table.gemspec +0 -1
- data/lib/fat_table/convert.rb +10 -1
- data/lib/fat_table/version.rb +1 -1
- metadata +6 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9cce93aafbc687a599cb04bb11ead038af02ecd433b64168f904ea09707a298
|
4
|
+
data.tar.gz: d61de9b052e89b47c13afa517f1e229d05e42903ba96bb272ddb14ce81c1c563
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f5418bad20549df9794fe7c3c69226d77e017433926b220282d094b66dc5b130de88f93e62d3045763aad065a5e1fb9ffbf626ee7b20e745774ee4653bad649
|
7
|
+
data.tar.gz: 31f4eee0b70bbcef9cba988dc4a2b7b00f1372fe23dd38732b34f520e6a1e2244d73f05abc9963f8b97cb5bd294e4c2ec406dbc0709d59a88355ce4f3676acd7
|
data/.simplecov
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
|
3
|
+
SimpleCov.start do
|
4
|
+
# any custom configs like groups and filters can be here at a central place
|
5
|
+
add_filter '/spec/'
|
6
|
+
add_filter '/tmp/'
|
7
|
+
add_group "Models", "lib/fat_table"
|
8
|
+
add_group "Core Extension", "lib/ext"
|
9
|
+
# After this many seconds between runs, old coverage stats are thrown out,
|
10
|
+
# so 3600 => 1 hour
|
11
|
+
merge_timeout 3600
|
12
|
+
# Make this true to merge rspec and cucumber coverage together
|
13
|
+
use_merging false
|
14
|
+
command_name 'Rspec'
|
15
|
+
nocov_token 'no_cover'
|
16
|
+
# Branch coverage
|
17
|
+
enable_coverage :branch
|
18
|
+
end
|
data/fat_table.gemspec
CHANGED
@@ -76,7 +76,6 @@ Gem::Specification.new do |spec|
|
|
76
76
|
spec.add_development_dependency 'rubocop-performance'
|
77
77
|
spec.add_development_dependency 'simplecov'
|
78
78
|
|
79
|
-
spec.add_runtime_dependency 'activesupport', '>3.0'
|
80
79
|
spec.add_runtime_dependency 'fat_core', '>= 4.9.0'
|
81
80
|
spec.add_runtime_dependency 'rainbow'
|
82
81
|
spec.add_runtime_dependency 'sequel'
|
data/lib/fat_table/convert.rb
CHANGED
@@ -161,13 +161,22 @@ module FatTable
|
|
161
161
|
def self.convert_to_numeric(val)
|
162
162
|
return BigDecimal(val, Float::DIG) if val.is_a?(Float)
|
163
163
|
return val if val.is_a?(Numeric)
|
164
|
+
|
164
165
|
# Eliminate any commas, $'s (or other currency symbol), or _'s.
|
165
166
|
cursym = Regexp.quote(FatTable.currency_symbol)
|
166
167
|
clean_re = /[,_#{cursym}]/
|
167
168
|
val = val.to_s.clean.gsub(clean_re, '')
|
168
169
|
return nil if val.blank?
|
170
|
+
|
169
171
|
case val
|
170
|
-
when
|
172
|
+
when /\A[-+]?\d+\.\z/
|
173
|
+
# Catch quirk in Ruby's BigDecimal converter where a number ending in
|
174
|
+
# a decimal but with no digits after the decimal throws an
|
175
|
+
# ArgumentError as an invalid value for BigDecimal(). Just append a
|
176
|
+
# '0'.
|
177
|
+
val += '0'
|
178
|
+
BigDecimal(val.to_s.clean)
|
179
|
+
when /(\A[-+]?\d+\.\d+\z)|(\A[-+]?\d*\.\d+\z)/
|
171
180
|
BigDecimal(val.to_s.clean)
|
172
181
|
when /\A[-+]?[\d]+\z/
|
173
182
|
val.to_i
|
data/lib/fat_table/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fat_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel E. Doherty
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -178,20 +178,6 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: activesupport
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - ">"
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: '3.0'
|
188
|
-
type: :runtime
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - ">"
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '3.0'
|
195
181
|
- !ruby/object:Gem::Dependency
|
196
182
|
name: fat_core
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -287,6 +273,7 @@ files:
|
|
287
273
|
- ".gitignore"
|
288
274
|
- ".rspec"
|
289
275
|
- ".rubocop.yml"
|
276
|
+
- ".simplecov"
|
290
277
|
- ".travis.yml"
|
291
278
|
- ".yardopts"
|
292
279
|
- Gemfile
|
@@ -332,7 +319,7 @@ licenses: []
|
|
332
319
|
metadata:
|
333
320
|
allowed_push_host: https://rubygems.org
|
334
321
|
yard.run: yri
|
335
|
-
post_install_message:
|
322
|
+
post_install_message:
|
336
323
|
rdoc_options: []
|
337
324
|
require_paths:
|
338
325
|
- lib
|
@@ -348,7 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
348
335
|
version: '0'
|
349
336
|
requirements: []
|
350
337
|
rubygems_version: 3.3.3
|
351
|
-
signing_key:
|
338
|
+
signing_key:
|
352
339
|
specification_version: 4
|
353
340
|
summary: Provides tools for working with tables as a data type.
|
354
341
|
test_files: []
|