oxcelix 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +3 -2
- data/CHANGES +10 -0
- data/LICENSE +20 -20
- data/README.md +79 -70
- data/README.rdoc +70 -62
- data/lib/oxcelix.rb +48 -47
- data/lib/oxcelix/cell.rb +22 -22
- data/lib/oxcelix/cellhelper.rb +48 -48
- data/lib/oxcelix/nf.rb +172 -172
- data/lib/oxcelix/numformats.rb +115 -114
- data/lib/oxcelix/sax/comments.rb +28 -28
- data/lib/oxcelix/sax/sharedstrings.rb +17 -17
- data/lib/oxcelix/sax/styles.rb +48 -48
- data/lib/oxcelix/sax/xlsheet.rb +136 -78
- data/lib/oxcelix/sheet.rb +96 -75
- data/lib/oxcelix/workbook.rb +393 -256
- data/oxcelix.gemspec +26 -26
- data/spec/cell_spec.rb +14 -13
- data/spec/fixnum_spec.rb +12 -11
- data/spec/helper.rb +10 -0
- data/spec/matrix_spec.rb +12 -11
- data/spec/oxcelix_spec.rb +37 -36
- data/spec/spec_helper.rb +3 -3
- data/spec/string_spec.rb +19 -19
- metadata +21 -25
data/oxcelix.gemspec
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
require 'rake'
|
4
|
-
Gem::Specification.new do |s|
|
5
|
-
s.name = 'oxcelix'
|
6
|
-
s.version = '0.
|
7
|
-
s.date = '2014-
|
8
|
-
s.summary = 'A fast Excel 2007/2010 file parser'
|
9
|
-
s.description = 'A fast Excel 2007/2010 (.xlsx) file parser that returns a collection of Matrix objects'
|
10
|
-
s.authors = 'Giovanni Biczo'
|
11
|
-
s.homepage = 'http://github.com/gbiczo/oxcelix'
|
12
|
-
s.rubyforge_project = 'oxcelix'
|
13
|
-
|
14
|
-
s.files = FileList["LICENSE", "README.rdoc", "README.md",
|
15
|
-
"lib/oxcelix.rb", "lib/oxcelix/cellhelper.rb",
|
16
|
-
"lib/oxcelix/cell.rb", "lib/oxcelix/numformats.rb",
|
17
|
-
"lib/oxcelix/nf.rb",
|
18
|
-
"lib/oxcelix/sheet.rb", "lib/oxcelix/workbook.rb",
|
19
|
-
"lib/oxcelix/sax/*",
|
20
|
-
"oxcelix.gemspec", "spec/*", ".yardopts", "CHANGES"].to_a
|
21
|
-
s.license = 'MIT'
|
22
|
-
|
23
|
-
s.add_runtime_dependency "ox", [">= 2.0.6"]
|
24
|
-
s.add_runtime_dependency "rubyzip", [">= 1.1.0"]
|
25
|
-
s.rdoc_options << '--all'
|
26
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'rake'
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 'oxcelix'
|
6
|
+
s.version = '0.4.0'
|
7
|
+
s.date = '2014-10-05'
|
8
|
+
s.summary = 'A fast Excel 2007/2010 file parser'
|
9
|
+
s.description = 'A fast Excel 2007/2010 (.xlsx) file parser that returns a collection of Matrix objects'
|
10
|
+
s.authors = 'Giovanni Biczo'
|
11
|
+
s.homepage = 'http://github.com/gbiczo/oxcelix'
|
12
|
+
s.rubyforge_project = 'oxcelix'
|
13
|
+
|
14
|
+
s.files = FileList["LICENSE", "README.rdoc", "README.md",
|
15
|
+
"lib/oxcelix.rb", "lib/oxcelix/cellhelper.rb",
|
16
|
+
"lib/oxcelix/cell.rb", "lib/oxcelix/numformats.rb",
|
17
|
+
"lib/oxcelix/nf.rb",
|
18
|
+
"lib/oxcelix/sheet.rb", "lib/oxcelix/workbook.rb",
|
19
|
+
"lib/oxcelix/sax/*",
|
20
|
+
"oxcelix.gemspec", "spec/*", ".yardopts", "CHANGES"].to_a
|
21
|
+
s.license = 'MIT'
|
22
|
+
|
23
|
+
s.add_runtime_dependency "ox", [">= 2.0.6"]
|
24
|
+
s.add_runtime_dependency "rubyzip", [">= 1.1.0"]
|
25
|
+
s.rdoc_options << '--all'
|
26
|
+
end
|
data/spec/cell_spec.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
-
#require
|
2
|
-
require_relative '../lib/oxcelix.rb'
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
c.
|
8
|
-
c.
|
9
|
-
c.
|
10
|
-
c.
|
11
|
-
|
12
|
-
|
13
|
-
end
|
1
|
+
#require "rspec"
|
2
|
+
require_relative '../lib/oxcelix.rb'
|
3
|
+
|
4
|
+
describe "Cell" do
|
5
|
+
describe '#r' do
|
6
|
+
it "sets the value of xlcoords" do
|
7
|
+
c=Oxcelix::Cell.new
|
8
|
+
c.r('H276')
|
9
|
+
c.xlcoords.should=='H276'
|
10
|
+
c.x.should==7
|
11
|
+
c.y.should==275
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/spec/fixnum_spec.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
1
|
+
#require_relative './spec_helper.rb'
|
2
|
+
require_relative '../lib/oxcelix.rb'
|
3
|
+
|
4
|
+
describe "Fixnum object" do
|
5
|
+
describe '#col_name' do
|
6
|
+
it "returns a string representing an excel column name" do
|
7
|
+
(0..25).each do |x|
|
8
|
+
x.col_name.should == ('A'..'Z').to_a[x]
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/spec/helper.rb
ADDED
data/spec/matrix_spec.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
#require './spec_helper'
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
m_obj
|
8
|
-
m_obj[3,3]
|
9
|
-
|
10
|
-
end
|
11
|
-
end
|
1
|
+
#require './spec_helper.rb'
|
2
|
+
require_relative '../lib/oxcelix.rb'
|
3
|
+
|
4
|
+
describe "Matrix object" do
|
5
|
+
describe '#[]=' do
|
6
|
+
it "should set a cell to a new value" do
|
7
|
+
m_obj=Matrix.build(4, 4){nil}
|
8
|
+
m_obj[3,3]='foo'
|
9
|
+
m_obj[3,3].should == 'foo'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/spec/oxcelix_spec.rb
CHANGED
@@ -1,36 +1,37 @@
|
|
1
|
-
#require './spec_helper'
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
w.
|
11
|
-
w.sheets
|
12
|
-
w.sheets[
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
w.
|
20
|
-
w.sheets
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
w.
|
28
|
-
w.sheets
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
end
|
1
|
+
#require './spec_helper.rb'
|
2
|
+
require_relative '../lib/oxcelix.rb'
|
3
|
+
|
4
|
+
describe "Oxcelix module" do
|
5
|
+
# before :all do
|
6
|
+
describe 'Workbook' do
|
7
|
+
context 'normal' do
|
8
|
+
it "should open the excel file and return a Workbook object" do
|
9
|
+
file = 'spec/test.xlsx'
|
10
|
+
w=Oxcelix::Workbook.new(file)
|
11
|
+
w.sheets.size.should == 2
|
12
|
+
w.sheets[0].name.should=="Testsheet1"
|
13
|
+
w.sheets[1].name.should=="Testsheet2"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
context 'with excluded sheets' do
|
17
|
+
it "should open the sheets not excluded of the excel file" do
|
18
|
+
file = 'spec/test.xlsx'
|
19
|
+
w=Oxcelix::Workbook.new(file, {:exclude=>['Testsheet2']})
|
20
|
+
w.sheets.size.should==1
|
21
|
+
w.sheets[0].name.should=="Testsheet1"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
context 'with included sheets' do
|
25
|
+
it "should open only the included sheets of the excel file" do
|
26
|
+
file = 'spec/test.xlsx'
|
27
|
+
w=Oxcelix::Workbook.new(file, {:include=>['Testsheet2']})
|
28
|
+
w.sheets.size.should==1
|
29
|
+
w.sheets[0].name.should=="Testsheet2"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
context 'with merged cells copied group-wide'
|
33
|
+
it "should open the excel file and copy the merged cells trough the mergegroup" do
|
34
|
+
end
|
35
|
+
end
|
36
|
+
# end
|
37
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
require_relative '../lib/oxcelix'
|
2
|
-
|
3
|
-
require 'yaml'
|
1
|
+
require_relative '../lib/oxcelix'
|
2
|
+
|
3
|
+
require 'yaml'
|
data/spec/string_spec.rb
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
#require './spec_helper'
|
2
|
-
|
3
|
-
describe "String object" do
|
4
|
-
describe 'numeric?' do
|
5
|
-
context "with numbers" do
|
6
|
-
it "should return true" do
|
7
|
-
(1..100).each do |x|
|
8
|
-
x.to_s.numeric?.should == true
|
9
|
-
end
|
10
|
-
end
|
11
|
-
context "with strings"
|
12
|
-
it "should return false" do
|
13
|
-
('a'..'zz').each do |x|
|
14
|
-
x.numeric?.should == false
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
1
|
+
#require './spec_helper.rb'
|
2
|
+
require_relative '../lib/oxcelix.rb'
|
3
|
+
describe "String object" do
|
4
|
+
describe 'numeric?' do
|
5
|
+
context "with numbers" do
|
6
|
+
it "should return true" do
|
7
|
+
(1..100).each do |x|
|
8
|
+
x.to_s.numeric?.should == true
|
9
|
+
end
|
10
|
+
end
|
11
|
+
context "with strings"
|
12
|
+
it "should return false" do
|
13
|
+
('a'..'zz').each do |x|
|
14
|
+
x.numeric?.should == false
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oxcelix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Giovanni Biczo
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-
|
11
|
+
date: 2014-10-05 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: ox
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 2.0.6
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 2.0.6
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rubyzip
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: 1.1.0
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: 1.1.0
|
46
41
|
description: A fast Excel 2007/2010 (.xlsx) file parser that returns a collection
|
@@ -50,54 +45,55 @@ executables: []
|
|
50
45
|
extensions: []
|
51
46
|
extra_rdoc_files: []
|
52
47
|
files:
|
48
|
+
- ".yardopts"
|
49
|
+
- CHANGES
|
53
50
|
- LICENSE
|
54
|
-
- README.rdoc
|
55
51
|
- README.md
|
52
|
+
- README.rdoc
|
56
53
|
- lib/oxcelix.rb
|
57
|
-
- lib/oxcelix/cellhelper.rb
|
58
54
|
- lib/oxcelix/cell.rb
|
59
|
-
- lib/oxcelix/
|
55
|
+
- lib/oxcelix/cellhelper.rb
|
60
56
|
- lib/oxcelix/nf.rb
|
61
|
-
- lib/oxcelix/
|
62
|
-
- lib/oxcelix/workbook.rb
|
57
|
+
- lib/oxcelix/numformats.rb
|
63
58
|
- lib/oxcelix/sax/comments.rb
|
64
59
|
- lib/oxcelix/sax/sharedstrings.rb
|
65
60
|
- lib/oxcelix/sax/styles.rb
|
66
61
|
- lib/oxcelix/sax/xlsheet.rb
|
62
|
+
- lib/oxcelix/sheet.rb
|
63
|
+
- lib/oxcelix/workbook.rb
|
67
64
|
- oxcelix.gemspec
|
68
65
|
- spec/cell_spec.rb
|
69
66
|
- spec/fixnum_spec.rb
|
67
|
+
- spec/helper.rb
|
70
68
|
- spec/matrix_spec.rb
|
71
69
|
- spec/oxcelix_spec.rb
|
72
70
|
- spec/spec_helper.rb
|
73
71
|
- spec/string_spec.rb
|
74
72
|
- spec/test.xlsx
|
75
|
-
- .yardopts
|
76
|
-
- CHANGES
|
77
73
|
homepage: http://github.com/gbiczo/oxcelix
|
78
74
|
licenses:
|
79
75
|
- MIT
|
76
|
+
metadata: {}
|
80
77
|
post_install_message:
|
81
78
|
rdoc_options:
|
82
|
-
- --all
|
79
|
+
- "--all"
|
83
80
|
require_paths:
|
84
81
|
- lib
|
85
82
|
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
-
none: false
|
87
83
|
requirements:
|
88
|
-
- -
|
84
|
+
- - ">="
|
89
85
|
- !ruby/object:Gem::Version
|
90
86
|
version: '0'
|
91
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
-
none: false
|
93
88
|
requirements:
|
94
|
-
- -
|
89
|
+
- - ">="
|
95
90
|
- !ruby/object:Gem::Version
|
96
91
|
version: '0'
|
97
92
|
requirements: []
|
98
93
|
rubyforge_project: oxcelix
|
99
|
-
rubygems_version:
|
94
|
+
rubygems_version: 2.2.1
|
100
95
|
signing_key:
|
101
|
-
specification_version:
|
96
|
+
specification_version: 4
|
102
97
|
summary: A fast Excel 2007/2010 file parser
|
103
98
|
test_files: []
|
99
|
+
has_rdoc:
|