spreadsheet 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,12 @@
1
+ === 0.8.2 / 28.02.2013
2
+
3
+ Author: Roque Pinel <roque.pinel@infotechfl.com>
4
+ Date: Wed Feb 27 12:10:29 2013 -0500
5
+
6
+ * Requiring BigDecimal for checking.
7
+ * Made API friendly to BigDecimal precision.
8
+ * Changes introduced by the user 'valeriusjames'.
9
+
1
10
  === 0.8.1 / 18.02.2013
2
11
 
3
12
  * Updated Manifest.txt to include lib/spreadsheet/excel/rgb.rb
data/lib/spreadsheet.rb CHANGED
@@ -43,7 +43,7 @@ module Spreadsheet
43
43
 
44
44
  ##
45
45
  # The version of Spreadsheet you are using.
46
- VERSION = '0.8.1'
46
+ VERSION = '0.8.2'
47
47
 
48
48
  ##
49
49
  # Default client Encoding. Change this value if your application uses a
@@ -2,6 +2,7 @@ require 'stringio'
2
2
  require 'spreadsheet/excel/writer/biff8'
3
3
  require 'spreadsheet/excel/internals'
4
4
  require 'spreadsheet/excel/internals/biff8'
5
+ require 'bigdecimal'
5
6
 
6
7
  module Spreadsheet
7
8
  module Excel
@@ -63,7 +64,7 @@ class Worksheet
63
64
  cent = 0
64
65
  int = 2
65
66
  higher = value * 100
66
- if higher.is_a?(Float) && higher < 0xfffffffc
67
+ if (higher.is_a?(BigDecimal) or higher.is_a?(Float)) && higher < 0xfffffffc
67
68
  cent = 1
68
69
  if higher == higher.to_i
69
70
  value = higher.to_i
@@ -89,7 +90,7 @@ class Worksheet
89
90
  def need_number? cell
90
91
  if cell.is_a?(Numeric) && cell.abs > 0x1fffffff
91
92
  true
92
- elsif cell.is_a?(Float) and not cell.nan?
93
+ elsif (cell.is_a?(BigDecimal) or cell.is_a?(Float)) and not cell.nan?
93
94
  higher = cell * 100
94
95
  if higher == higher.to_i
95
96
  need_number? higher.to_i
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreadsheet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-18 00:00:00.000000000 Z
12
+ date: 2013-02-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-ole
16
- requirement: &10733540 !ruby/object:Gem::Requirement
16
+ requirement: &12870380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *10733540
24
+ version_requirements: *12870380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rdoc
27
- requirement: &10733120 !ruby/object:Gem::Requirement
27
+ requirement: &12869960 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.10'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *10733120
35
+ version_requirements: *12869960
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hoe
38
- requirement: &10732560 !ruby/object:Gem::Requirement
38
+ requirement: &12869520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '2.13'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *10732560
46
+ version_requirements: *12869520
47
47
  description: ! 'The Spreadsheet Library is designed to read and write Spreadsheet
48
48
  Documents.
49
49