jruby-poi 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/jruby-poi.gemspec +5 -3
- data/lib/poi/workbook/cell.rb +2 -3
- data/lib/poi/workbook/row.rb +3 -3
- data/lib/poi/workbook.rb +19 -0
- data/specs/data/timesheet.xlsx +0 -0
- data/specs/facade_spec.rb +48 -0
- data/specs/writing_spec.rb +5 -5
- metadata +87 -85
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.2
|
data/jruby-poi.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{jruby-poi}
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Scott Deming", "Jason Rogers"]
|
12
|
-
s.date = %q{2011-03-
|
12
|
+
s.date = %q{2011-03-31}
|
13
13
|
s.description = %q{A rubyesque library for manipulating spreadsheets and other document types for jruby, using Apache POI.}
|
14
14
|
s.email = ["sdeming@makefile.com", "jacaetevha@gmail.com"]
|
15
15
|
s.executables = ["autospec", "htmldiff", "ldiff", "rdebug", "rspec"]
|
@@ -52,7 +52,9 @@ Gem::Specification.new do |s|
|
|
52
52
|
"specs/data/simple_with_picture.ods",
|
53
53
|
"specs/data/simple_with_picture.xls",
|
54
54
|
"specs/data/spreadsheet.ods",
|
55
|
+
"specs/data/timesheet.xlsx",
|
55
56
|
"specs/data/various_samples.xlsx",
|
57
|
+
"specs/facade_spec.rb",
|
56
58
|
"specs/io_spec.rb",
|
57
59
|
"specs/spec_helper.rb",
|
58
60
|
"specs/support/java/jrubypoi/MockOutputStream.java",
|
@@ -63,7 +65,7 @@ Gem::Specification.new do |s|
|
|
63
65
|
]
|
64
66
|
s.homepage = %q{http://github.com/sdeming/jruby-poi}
|
65
67
|
s.require_paths = ["lib"]
|
66
|
-
s.rubygems_version = %q{1.
|
68
|
+
s.rubygems_version = %q{1.5.1}
|
67
69
|
s.summary = %q{Apache POI class library for jruby}
|
68
70
|
|
69
71
|
if s.respond_to? :specification_version then
|
data/lib/poi/workbook/cell.rb
CHANGED
@@ -116,9 +116,8 @@ module POI
|
|
116
116
|
@cell
|
117
117
|
end
|
118
118
|
|
119
|
-
|
120
|
-
|
121
|
-
end
|
119
|
+
# :cell_style= comes from the Façade superclass
|
120
|
+
alias :style= :cell_style=
|
122
121
|
|
123
122
|
def style! options
|
124
123
|
self.style = @row.worksheet.workbook.create_style(options)
|
data/lib/poi/workbook/row.rb
CHANGED
data/lib/poi/workbook.rb
CHANGED
@@ -8,6 +8,25 @@ module POI
|
|
8
8
|
args = method.arity.times.collect{|i| "arg#{i}"}.join(", ")
|
9
9
|
method_name = method.name.gsub(/([A-Z])/){|e| "_#{e.downcase}"}
|
10
10
|
code = "def #{method_name}(#{args}); #{delegate}.#{method.name}(#{args}); end"
|
11
|
+
|
12
|
+
if method_name =~ /^get_[a-z]/
|
13
|
+
alias_method_name = method_name.sub('get_', '')
|
14
|
+
code += "\nalias :#{alias_method_name} :#{method_name}"
|
15
|
+
if method.return_type.to_s == 'boolean'
|
16
|
+
code += "\nalias :#{alias_method_name}? :#{method_name}"
|
17
|
+
end
|
18
|
+
elsif method_name =~ /^set_[a-z]/ && method.arity == 1
|
19
|
+
alias_method_name = "#{method_name.sub('set_', '')}"
|
20
|
+
code += "\nalias :#{alias_method_name}= :#{method_name}"
|
21
|
+
if method.argument_types.first.to_s == 'boolean'
|
22
|
+
code += "\ndef #{alias_method_name}!; #{alias_method_name} = true; end"
|
23
|
+
end
|
24
|
+
elsif method.return_type.to_s == 'boolean' && method_name =~ /is_/
|
25
|
+
code += "\nalias :#{method_name.sub('is_', '')}? :#{method_name}"
|
26
|
+
elsif method.return_type.nil? && (method.argument_types.nil? || method.argument_types.empty?)
|
27
|
+
code += "\nalias :#{method_name}! :#{method_name}"
|
28
|
+
end
|
29
|
+
|
11
30
|
cls.class_eval(code, __FILE__, __LINE__)
|
12
31
|
end
|
13
32
|
cls
|
Binary file
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'spec_helper')
|
2
|
+
|
3
|
+
describe "POI.Facade" do
|
4
|
+
it "should create specialized methods for boolean methods, getters, and setters" do
|
5
|
+
book = POI::Workbook.create('foo.xlsx')
|
6
|
+
sheet = book.create_sheet
|
7
|
+
sheet.respond_to?(:column_broken?).should be_true
|
8
|
+
sheet.respond_to?(:column_hidden?).should be_true
|
9
|
+
sheet.respond_to?(:display_formulas?).should be_true
|
10
|
+
sheet.respond_to?(:display_gridlines?).should be_true
|
11
|
+
sheet.respond_to?(:selected?).should be_true
|
12
|
+
sheet.respond_to?(:column_breaks).should be_true
|
13
|
+
sheet.respond_to?(:column_break=).should be_true
|
14
|
+
sheet.respond_to?(:autobreaks?).should be_true
|
15
|
+
sheet.respond_to?(:autobreaks=).should be_true
|
16
|
+
sheet.respond_to?(:autobreaks!).should be_true
|
17
|
+
sheet.respond_to?(:column_broken?).should be_true
|
18
|
+
sheet.respond_to?(:fit_to_page).should be_true
|
19
|
+
sheet.respond_to?(:fit_to_page?).should be_true
|
20
|
+
sheet.respond_to?(:fit_to_page=).should be_true
|
21
|
+
sheet.respond_to?(:fit_to_page!).should be_true
|
22
|
+
|
23
|
+
sheet.respond_to?(:array_formula).should_not be_true
|
24
|
+
sheet.respond_to?(:array_formula=).should_not be_true
|
25
|
+
|
26
|
+
row = sheet[0]
|
27
|
+
row.respond_to?(:first_cell_num).should be_true
|
28
|
+
row.respond_to?(:height).should be_true
|
29
|
+
row.respond_to?(:height=).should be_true
|
30
|
+
row.respond_to?(:height_in_points).should be_true
|
31
|
+
row.respond_to?(:height_in_points=).should be_true
|
32
|
+
row.respond_to?(:zero_height?).should be_true
|
33
|
+
row.respond_to?(:zero_height!).should be_true
|
34
|
+
row.respond_to?(:zero_height=).should be_true
|
35
|
+
|
36
|
+
cell = row[0]
|
37
|
+
cell.respond_to?(:boolean_cell_value).should be_true
|
38
|
+
cell.respond_to?(:boolean_cell_value?).should be_true
|
39
|
+
cell.respond_to?(:cached_formula_result_type).should be_true
|
40
|
+
cell.respond_to?(:cell_error_value=).should be_true
|
41
|
+
cell.respond_to?(:cell_value=).should be_true
|
42
|
+
cell.respond_to?(:hyperlink=).should be_true
|
43
|
+
cell.respond_to?(:cell_value!).should be_true
|
44
|
+
cell.respond_to?(:remove_cell_comment!).should be_true
|
45
|
+
cell.respond_to?(:cell_style).should be_true
|
46
|
+
cell.respond_to?(:cell_style=).should be_true
|
47
|
+
end
|
48
|
+
end
|
data/specs/writing_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe "writing Workbooks" do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
it "should create a new workbook and write something to it" do
|
13
|
-
name =
|
13
|
+
name = "specs/data/timesheet-#{Time.now.strftime('%Y%m%d%H%M%S%s')}.xlsx"
|
14
14
|
create_timesheet_spreadsheet(name)
|
15
15
|
book = POI::Workbook.open(name)
|
16
16
|
book.worksheets.size.should == 1
|
@@ -42,10 +42,10 @@ describe "writing Workbooks" do
|
|
42
42
|
:alignment => :align_center, :vertical_alignment => :vertical_center
|
43
43
|
|
44
44
|
sheet = book.create_sheet 'Timesheet'
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
45
|
+
print_setup = sheet.print_setup
|
46
|
+
print_setup.landscape = true
|
47
|
+
sheet.fit_to_page = true
|
48
|
+
sheet.horizontally_center = true
|
49
49
|
|
50
50
|
title_row = sheet.rows[0]
|
51
51
|
title_row.height_in_points = 45
|
metadata
CHANGED
@@ -2,98 +2,100 @@
|
|
2
2
|
name: jruby-poi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.7.
|
5
|
+
version: 0.7.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
|
-
- Scott Deming
|
9
|
-
- Jason Rogers
|
8
|
+
- Scott Deming
|
9
|
+
- Jason Rogers
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-
|
14
|
+
date: 2011-04-01 00:00:00 -04:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
|
-
- !ruby/object:Gem::Dependency
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
name: rspec
|
19
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "0"
|
25
|
+
requirement: *id001
|
26
|
+
prerelease: false
|
27
|
+
type: :development
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: ruby-debug
|
30
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: "0"
|
36
|
+
requirement: *id002
|
37
|
+
prerelease: false
|
38
|
+
type: :development
|
39
39
|
description: A rubyesque library for manipulating spreadsheets and other document types for jruby, using Apache POI.
|
40
40
|
email:
|
41
|
-
- sdeming@makefile.com
|
42
|
-
- jacaetevha@gmail.com
|
41
|
+
- sdeming@makefile.com
|
42
|
+
- jacaetevha@gmail.com
|
43
43
|
executables:
|
44
|
-
- autospec
|
45
|
-
- htmldiff
|
46
|
-
- ldiff
|
47
|
-
- rdebug
|
48
|
-
- rspec
|
44
|
+
- autospec
|
45
|
+
- htmldiff
|
46
|
+
- ldiff
|
47
|
+
- rdebug
|
48
|
+
- rspec
|
49
49
|
extensions: []
|
50
50
|
|
51
51
|
extra_rdoc_files:
|
52
|
-
- LICENSE
|
53
|
-
- README.markdown
|
52
|
+
- LICENSE
|
53
|
+
- README.markdown
|
54
54
|
files:
|
55
|
-
- Gemfile
|
56
|
-
- Gemfile.lock
|
57
|
-
- LICENSE
|
58
|
-
- NOTICE
|
59
|
-
- README.markdown
|
60
|
-
- Rakefile
|
61
|
-
- VERSION
|
62
|
-
- bin/autospec
|
63
|
-
- bin/htmldiff
|
64
|
-
- bin/ldiff
|
65
|
-
- bin/rdebug
|
66
|
-
- bin/rspec
|
67
|
-
- jruby-poi.gemspec
|
68
|
-
- lib/ooxml-lib/dom4j-1.6.1.jar
|
69
|
-
- lib/ooxml-lib/geronimo-stax-api_1.0_spec-1.0.jar
|
70
|
-
- lib/ooxml-lib/xmlbeans-2.3.0.jar
|
71
|
-
- lib/poi-3.6-20091214.jar
|
72
|
-
- lib/poi-contrib-3.6-20091214.jar
|
73
|
-
- lib/poi-examples-3.6-20091214.jar
|
74
|
-
- lib/poi-ooxml-3.6-20091214.jar
|
75
|
-
- lib/poi-ooxml-schemas-3.6-20091214.jar
|
76
|
-
- lib/poi-scratchpad-3.6-20091214.jar
|
77
|
-
- lib/poi.rb
|
78
|
-
- lib/poi/workbook.rb
|
79
|
-
- lib/poi/workbook/area.rb
|
80
|
-
- lib/poi/workbook/cell.rb
|
81
|
-
- lib/poi/workbook/named_range.rb
|
82
|
-
- lib/poi/workbook/row.rb
|
83
|
-
- lib/poi/workbook/workbook.rb
|
84
|
-
- lib/poi/workbook/worksheet.rb
|
85
|
-
- spec_debug.sh
|
86
|
-
- specs/data/simple_with_picture.ods
|
87
|
-
- specs/data/simple_with_picture.xls
|
88
|
-
- specs/data/spreadsheet.ods
|
89
|
-
- specs/data/
|
90
|
-
- specs/
|
91
|
-
- specs/
|
92
|
-
- specs/
|
93
|
-
- specs/
|
94
|
-
- specs/support/
|
95
|
-
- specs/
|
96
|
-
- specs/
|
55
|
+
- Gemfile
|
56
|
+
- Gemfile.lock
|
57
|
+
- LICENSE
|
58
|
+
- NOTICE
|
59
|
+
- README.markdown
|
60
|
+
- Rakefile
|
61
|
+
- VERSION
|
62
|
+
- bin/autospec
|
63
|
+
- bin/htmldiff
|
64
|
+
- bin/ldiff
|
65
|
+
- bin/rdebug
|
66
|
+
- bin/rspec
|
67
|
+
- jruby-poi.gemspec
|
68
|
+
- lib/ooxml-lib/dom4j-1.6.1.jar
|
69
|
+
- lib/ooxml-lib/geronimo-stax-api_1.0_spec-1.0.jar
|
70
|
+
- lib/ooxml-lib/xmlbeans-2.3.0.jar
|
71
|
+
- lib/poi-3.6-20091214.jar
|
72
|
+
- lib/poi-contrib-3.6-20091214.jar
|
73
|
+
- lib/poi-examples-3.6-20091214.jar
|
74
|
+
- lib/poi-ooxml-3.6-20091214.jar
|
75
|
+
- lib/poi-ooxml-schemas-3.6-20091214.jar
|
76
|
+
- lib/poi-scratchpad-3.6-20091214.jar
|
77
|
+
- lib/poi.rb
|
78
|
+
- lib/poi/workbook.rb
|
79
|
+
- lib/poi/workbook/area.rb
|
80
|
+
- lib/poi/workbook/cell.rb
|
81
|
+
- lib/poi/workbook/named_range.rb
|
82
|
+
- lib/poi/workbook/row.rb
|
83
|
+
- lib/poi/workbook/workbook.rb
|
84
|
+
- lib/poi/workbook/worksheet.rb
|
85
|
+
- spec_debug.sh
|
86
|
+
- specs/data/simple_with_picture.ods
|
87
|
+
- specs/data/simple_with_picture.xls
|
88
|
+
- specs/data/spreadsheet.ods
|
89
|
+
- specs/data/timesheet.xlsx
|
90
|
+
- specs/data/various_samples.xlsx
|
91
|
+
- specs/facade_spec.rb
|
92
|
+
- specs/io_spec.rb
|
93
|
+
- specs/spec_helper.rb
|
94
|
+
- specs/support/java/jrubypoi/MockOutputStream.java
|
95
|
+
- specs/support/java/support.jar
|
96
|
+
- specs/support/matchers/cell_matcher.rb
|
97
|
+
- specs/workbook_spec.rb
|
98
|
+
- specs/writing_spec.rb
|
97
99
|
has_rdoc: true
|
98
100
|
homepage: http://github.com/sdeming/jruby-poi
|
99
101
|
licenses: []
|
@@ -102,23 +104,23 @@ post_install_message:
|
|
102
104
|
rdoc_options: []
|
103
105
|
|
104
106
|
require_paths:
|
105
|
-
- lib
|
107
|
+
- lib
|
106
108
|
required_ruby_version: !ruby/object:Gem::Requirement
|
107
109
|
none: false
|
108
110
|
requirements:
|
109
|
-
|
110
|
-
|
111
|
-
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: "0"
|
112
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
115
|
none: false
|
114
116
|
requirements:
|
115
|
-
|
116
|
-
|
117
|
-
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: "0"
|
118
120
|
requirements: []
|
119
121
|
|
120
122
|
rubyforge_project:
|
121
|
-
rubygems_version: 1.
|
123
|
+
rubygems_version: 1.5.1
|
122
124
|
signing_key:
|
123
125
|
specification_version: 3
|
124
126
|
summary: Apache POI class library for jruby
|