mileszs-importex 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/importex/core_ext/importex_value.rb +2 -2
- data/lib/importex.rb +1 -0
- metadata +2 -2
@@ -1,7 +1,7 @@
|
|
1
1
|
class Integer
|
2
2
|
def self.importex_value(str)
|
3
3
|
unless str.blank?
|
4
|
-
if str =~ /^[.\d]+$/
|
4
|
+
if str =~ /^[-]{0,1}[.\d]+$/
|
5
5
|
str.to_i
|
6
6
|
else
|
7
7
|
raise Importex::InvalidCell, "Not a number."
|
@@ -13,7 +13,7 @@ end
|
|
13
13
|
class Float
|
14
14
|
def self.importex_value(str)
|
15
15
|
unless str.blank?
|
16
|
-
if str =~ /^[.\d]+$/
|
16
|
+
if str =~ /^[-]{0,1}[.\d]+$/
|
17
17
|
str.to_f
|
18
18
|
else
|
19
19
|
raise Importex::InvalidCell, "Not a number."
|
data/lib/importex.rb
CHANGED
@@ -2,6 +2,7 @@ require 'spreadsheet'
|
|
2
2
|
|
3
3
|
require File.expand_path(File.dirname(__FILE__) + '/importex/base')
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + '/importex/column')
|
5
|
+
require File.expand_path(File.dirname(__FILE__) + '/importex/core_ext/blank.rb')
|
5
6
|
require File.expand_path(File.dirname(__FILE__) + '/importex/core_ext/importex_value.rb')
|
6
7
|
|
7
8
|
module Importex
|