datashift 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/datashift.gemspec +2 -2
- data/lib/applications/apache_poi_extensions.rb +1 -1
- data/lib/applications/excel_base.rb +1 -3
- data/lib/applications/jexcel_file.rb +1 -1
- data/lib/applications/ruby_poi_translations.rb +17 -2
- data/spec/fixtures/db/datashift_test_models_db.sqlite +0 -0
- metadata +2 -2
data/Rakefile
CHANGED
@@ -31,7 +31,7 @@ Jeweler::Tasks.new do |gem|
|
|
31
31
|
gem.homepage = "http://github.com/autotelik/datashift"
|
32
32
|
gem.license = "MIT"
|
33
33
|
gem.summary = %Q{ Shift data betwen Excel/CSV and any Ruby app}
|
34
|
-
gem.description = %Q{
|
34
|
+
gem.description = %Q{Comprehensive tools to import/export between Excel/CSV and ActiveRecord databases, Rails apps, and any Ruby project.}
|
35
35
|
gem.email = "rubygems@autotelik.co.uk"
|
36
36
|
gem.authors = ["Thomas Statter"]
|
37
37
|
# dependencies defined in Gemfile
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.1
|
data/datashift.gemspec
CHANGED
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "datashift"
|
8
|
-
s.version = "0.10.
|
8
|
+
s.version = "0.10.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Thomas Statter"]
|
12
12
|
s.date = "2012-09-25"
|
13
|
-
s.description = "
|
13
|
+
s.description = "Comprehensive tools to import/export between Excel/CSV and ActiveRecord databases, Rails apps, and any Ruby project."
|
14
14
|
s.email = "rubygems@autotelik.co.uk"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
@@ -33,7 +33,7 @@ if(DataShift::Guards::jruby?)
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def []=( column, value )
|
36
|
-
get_or_create_cell(column, value).setCellValue((value
|
36
|
+
get_or_create_cell(column, value).setCellValue( poi_cell_value(value) )
|
37
37
|
end
|
38
38
|
|
39
39
|
def get_or_create_cell( column, value = nil )
|
@@ -44,11 +44,26 @@ if(DataShift::Guards::jruby?)
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
# Return the suitable type for a HSSFCell from a Ruby data type
|
48
47
|
|
48
|
+
# Cell.CELL_TYPE_NUMERIC, Cell.CELL_TYPE_STRING, Cell.CELL_TYPE_FORMULA,
|
49
|
+
# Cell.CELL_TYPE_BLANK, Cell.CELL_TYPE_BOOLEAN, Cell.CELL_TYPE_ERROR
|
50
|
+
|
51
|
+
# TODO - properly
|
52
|
+
def poi_cell_value(data)
|
53
|
+
case(data)
|
54
|
+
when BigDecimal
|
55
|
+
data.to_f
|
56
|
+
when Numeric, TrueClass, FalseClass
|
57
|
+
data
|
58
|
+
else
|
59
|
+
data.to_s
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Return the suitable type for a HSSFCell from a Ruby data type
|
49
64
|
def poi_cell_type(data)
|
50
65
|
|
51
|
-
if(data.
|
66
|
+
if(data.is_a?(Numeric))
|
52
67
|
HSSFCell::CELL_TYPE_NUMERIC
|
53
68
|
elsif(data.nil?)
|
54
69
|
HSSFCell::CELL_TYPE_BLANK
|
Binary file
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: datashift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.10.
|
5
|
+
version: 0.10.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Thomas Statter
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
version: "0"
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id002
|
37
|
-
description:
|
37
|
+
description: Comprehensive tools to import/export between Excel/CSV and ActiveRecord databases, Rails apps, and any Ruby project.
|
38
38
|
email: rubygems@autotelik.co.uk
|
39
39
|
executables: []
|
40
40
|
|