spreadsheet 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -2
- data/Gemfile.lock +2 -2
- data/History.txt +13 -0
- data/Manifest.txt +1 -1
- data/lib/spreadsheet/excel/rgb.rb +85 -85
- data/lib/spreadsheet.rb +1 -1
- data/spreadsheet.gemspec +1 -0
- data/test/data/test_adding_data_to_existing_file.xls +0 -0
- data/test/excel/writer/worksheet.rb +1 -1
- data/test/integration.rb +2 -2
- metadata +3 -3
- data/test/excel/writer/n_worksheet.rb +0 -55
data/Gemfile
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
|
-
gemspec
|
3
|
+
gemspec
|
data/Gemfile.lock
CHANGED
data/History.txt
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
=== 0.8.7 / 24.07.2013
|
2
|
+
|
3
|
+
Author: Yasuhiro Asaka <yasaka@ywesee.com>
|
4
|
+
Date: Wed Jul 24 11:31:12 2013 +0900
|
5
|
+
|
6
|
+
* Remove warnings for test suite
|
7
|
+
* warning: mismatched indentations at 'end' with 'class' at xxx
|
8
|
+
* warning: method redefined; discarding old xxx
|
9
|
+
* warning: assigned but unused variable xxx
|
10
|
+
* warning: previous definition of xxx was here
|
11
|
+
* The source :rubygems is deprecated because HTTP
|
12
|
+
* requests are insecure. (Gemfile)
|
13
|
+
|
1
14
|
=== 0.8.6 / 11.07.2013
|
2
15
|
|
3
16
|
Author: Arjun Anand and Robert Stern <dev+arjuna+rstern@reenhanced.com>
|
data/Manifest.txt
CHANGED
@@ -48,6 +48,7 @@ lib/spreadsheet/workbook.rb
|
|
48
48
|
lib/spreadsheet/worksheet.rb
|
49
49
|
lib/spreadsheet/writer.rb
|
50
50
|
spreadsheet.gemspec
|
51
|
+
test/data/test_adding_data_to_existing_file.xls
|
51
52
|
test/data/test_borders.xls
|
52
53
|
test/data/test_changes.xls
|
53
54
|
test/data/test_copy.xls
|
@@ -64,7 +65,6 @@ test/data/test_version_excel97.xls
|
|
64
65
|
test/data/test_version_excel97_2010.xls
|
65
66
|
test/excel/reader.rb
|
66
67
|
test/excel/row.rb
|
67
|
-
test/excel/writer/n_worksheet.rb
|
68
68
|
test/excel/writer/workbook.rb
|
69
69
|
test/excel/writer/worksheet.rb
|
70
70
|
test/font.rb
|
@@ -10,92 +10,92 @@
|
|
10
10
|
|
11
11
|
module Spreadsheet
|
12
12
|
module Excel
|
13
|
-
|
14
|
-
|
13
|
+
class Rgb
|
14
|
+
attr_accessor :r, :g, :b
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
16
|
+
@@RGB_MAP = {
|
17
|
+
:xls_color_0 => 0x000000,
|
18
|
+
:xls_color_1 => 0xffffff,
|
19
|
+
:xls_color_2 => 0xff0000,
|
20
|
+
:xls_color_3 => 0x00ff00,
|
21
|
+
:xls_color_4 => 0x0000ff,
|
22
|
+
:xls_color_5 => 0xffff00,
|
23
|
+
:xls_color_6 => 0xff00ff,
|
24
|
+
:xls_color_7 => 0x00ffff,
|
25
|
+
:xls_color_8 => 0x800000,
|
26
|
+
:xls_color_9 => 0x008000,
|
27
|
+
:xls_color_10 => 0x008000,
|
28
|
+
:xls_color_11 => 0x000080,
|
29
|
+
:xls_color_12 => 0x808080,
|
30
|
+
:xls_color_13 => 0x008080,
|
31
|
+
:xls_color_14 => 0xc0c0c0,
|
32
|
+
:xls_color_15 => 0x808080,
|
33
|
+
:xls_color_16 => 0x9999ff,
|
34
|
+
:xls_color_17 => 0x993366,
|
35
|
+
:xls_color_18 => 0xffffcc,
|
36
|
+
:xls_color_19 => 0xccffff,
|
37
|
+
:xls_color_20 => 0x660066,
|
38
|
+
:xls_color_21 => 0xff8080,
|
39
|
+
:xls_color_22 => 0x0066cc,
|
40
|
+
:xls_color_23 => 0xccccff,
|
41
|
+
:xls_color_24 => 0x000080,
|
42
|
+
:xls_color_25 => 0xff00ff,
|
43
|
+
:xls_color_26 => 0xffff00,
|
44
|
+
:xls_color_27 => 0x00ffff,
|
45
|
+
:xls_color_28 => 0x800080,
|
46
|
+
:xls_color_29 => 0x800000,
|
47
|
+
:xls_color_30 => 0x008080,
|
48
|
+
:xls_color_31 => 0x0000ff,
|
49
|
+
:xls_color_32 => 0x00ccff,
|
50
|
+
:xls_color_33 => 0xccffff,
|
51
|
+
:xls_color_34 => 0xccffcc,
|
52
|
+
:xls_color_35 => 0xffff99,
|
53
|
+
:xls_color_36 => 0x99ccff,
|
54
|
+
:xls_color_37 => 0xff99cc,
|
55
|
+
:xls_color_38 => 0xcc99ff,
|
56
|
+
:xls_color_39 => 0xffcc99,
|
57
|
+
:xls_color_40 => 0x3366ff,
|
58
|
+
:xls_color_41 => 0x33cccc,
|
59
|
+
:xls_color_42 => 0x99cc00,
|
60
|
+
:xls_color_43 => 0xffcc00,
|
61
|
+
:xls_color_44 => 0xff9900,
|
62
|
+
:xls_color_45 => 0xff6600,
|
63
|
+
:xls_color_46 => 0x666699,
|
64
|
+
:xls_color_47 => 0x969696,
|
65
|
+
:xls_color_48 => 0x003366,
|
66
|
+
:xls_color_49 => 0x339966,
|
67
|
+
:xls_color_50 => 0x003300,
|
68
|
+
:xls_color_51 => 0x333300,
|
69
|
+
:xls_color_52 => 0x993300,
|
70
|
+
:xls_color_53 => 0x993366,
|
71
|
+
:xls_color_54 => 0x333399,
|
72
|
+
:xls_color_55 => 0x333333,
|
73
|
+
:builtin_black => 0x000000,
|
74
|
+
:builtin_white => 0xffffff,
|
75
|
+
:builtin_red => 0xff0000,
|
76
|
+
:builtin_green => 0x00ff00,
|
77
|
+
:builtin_blue => 0x0000ff,
|
78
|
+
:builtin_yellow => 0xffff00,
|
79
|
+
:builtin_magenta => 0xff00ff,
|
80
|
+
:builtin_cyan => 0x00ffff,
|
81
|
+
:aqua => 0x00ffff,
|
82
|
+
:black => 0x000000,
|
83
|
+
:blue => 0x0000ff,
|
84
|
+
:cyan => 0x00ffff,
|
85
|
+
:brown => 0x800000,
|
86
|
+
:fuchsia => 0xff00ff,
|
87
|
+
:gray => 0x808080,
|
88
|
+
:grey => 0x808080,
|
89
|
+
:green => 0x008000,
|
90
|
+
:lime => 0x00ff00,
|
91
|
+
:magenta => 0xff00ff,
|
92
|
+
:navy => 0x000080,
|
93
|
+
:orange => 0xff9900,
|
94
|
+
:purple => 0x800080,
|
95
|
+
:red => 0xff0000,
|
96
|
+
:silver => 0xc0c0c0,
|
97
|
+
:white => 0xffffff,
|
98
|
+
:yellow => 0xffff00
|
99
99
|
}
|
100
100
|
|
101
101
|
def self.to_rgb color_symbol
|
data/lib/spreadsheet.rb
CHANGED
data/spreadsheet.gemspec
CHANGED
@@ -6,6 +6,7 @@ spec = Gem::Specification.new do |s|
|
|
6
6
|
s.author = "Masaomi Hatakeyama, Zeno R.R. Davatz"
|
7
7
|
s.email = "mhatakeyama@ywesee.com, zdavatz@ywesee.com"
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
|
+
s.license = "GPLv3"
|
9
10
|
s.files = Dir.glob("{bin,lib,test}/**/*") + Dir.glob("*.txt")
|
10
11
|
s.test_file = "test/suite.rb"
|
11
12
|
s.executables << "xlsopcodes"
|
Binary file
|
@@ -7,7 +7,7 @@ require 'spreadsheet/excel/writer/worksheet'
|
|
7
7
|
module Spreadsheet
|
8
8
|
module Excel
|
9
9
|
module Writer
|
10
|
-
|
10
|
+
class TestWorksheet < Test::Unit::TestCase
|
11
11
|
def test_need_number
|
12
12
|
sheet = Worksheet.new nil, nil
|
13
13
|
assert_equal false, sheet.need_number?(10)
|
data/test/integration.rb
CHANGED
@@ -1274,8 +1274,8 @@ module Spreadsheet
|
|
1274
1274
|
temp_file = Tempfile.new('temp')
|
1275
1275
|
book.write(temp_file.path)
|
1276
1276
|
|
1277
|
-
|
1278
|
-
assert_equal(2,
|
1277
|
+
temp_book = Spreadsheet.open temp_file.path
|
1278
|
+
assert_equal(2, temp_book.worksheet(0).rows.count)
|
1279
1279
|
|
1280
1280
|
temp_file.unlink
|
1281
1281
|
end
|
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.
|
4
|
+
version: 0.8.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ruby-ole
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- lib/spreadsheet/worksheet.rb
|
132
132
|
- lib/spreadsheet/writer.rb
|
133
133
|
- spreadsheet.gemspec
|
134
|
+
- test/data/test_adding_data_to_existing_file.xls
|
134
135
|
- test/data/test_borders.xls
|
135
136
|
- test/data/test_changes.xls
|
136
137
|
- test/data/test_copy.xls
|
@@ -147,7 +148,6 @@ files:
|
|
147
148
|
- test/data/test_version_excel97_2010.xls
|
148
149
|
- test/excel/reader.rb
|
149
150
|
- test/excel/row.rb
|
150
|
-
- test/excel/writer/n_worksheet.rb
|
151
151
|
- test/excel/writer/workbook.rb
|
152
152
|
- test/excel/writer/worksheet.rb
|
153
153
|
- test/font.rb
|
@@ -1,55 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# Excel::Writer::TestWorksheet -- Spreadheet -- 21.11.2007 -- hwyss@ywesee.com
|
3
|
-
|
4
|
-
require 'test/unit'
|
5
|
-
require 'spreadsheet/excel/writer/worksheet'
|
6
|
-
|
7
|
-
module Spreadsheet
|
8
|
-
module Excel
|
9
|
-
module Writer
|
10
|
-
class TestWorksheet < Test::Unit::TestCase
|
11
|
-
def test_need_number
|
12
|
-
sheet = Worksheet.new nil, nil
|
13
|
-
assert_equal false, sheet.need_number?(10)
|
14
|
-
assert_equal false, sheet.need_number?(114.55)
|
15
|
-
assert_equal false, sheet.need_number?(0.1)
|
16
|
-
assert_equal false, sheet.need_number?(0.01)
|
17
|
-
assert_equal false, sheet.need_number?(0 / 0.0) # NaN
|
18
|
-
assert_equal true, sheet.need_number?(0.001)
|
19
|
-
assert_equal true, sheet.need_number?(10000000.0)
|
20
|
-
end
|
21
|
-
|
22
|
-
class RowMock
|
23
|
-
attr_accessor :idx, :first_used, :first_unused, :height, :outline_level
|
24
|
-
|
25
|
-
def initialize
|
26
|
-
@idx, @first_used, @first_unused, @height, @outline_level = 0,0,0,0,1
|
27
|
-
end
|
28
|
-
|
29
|
-
def method_missing name, *args
|
30
|
-
nil
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_write_row_should_not_write_if_the_row_has_no_used_columns
|
35
|
-
sheet = Worksheet.new nil, nil
|
36
|
-
row = RowMock.new
|
37
|
-
row.first_used = nil
|
38
|
-
|
39
|
-
sheet.write_row row
|
40
|
-
|
41
|
-
assert_equal '', sheet.data
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_write_row_should_write_if_any_column_is_used
|
45
|
-
sheet = Worksheet.new nil, nil
|
46
|
-
row = RowMock.new
|
47
|
-
|
48
|
-
sheet.write_row row
|
49
|
-
|
50
|
-
assert_equal false, sheet.data.empty?
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|