rodf 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -4
- data/README.md +10 -15
- data/lib/rodf/cell.rb +18 -17
- data/lib/rodf/column.rb +0 -4
- data/lib/rodf/compatibility.rb +0 -4
- data/lib/rodf/container.rb +0 -4
- data/lib/rodf/data_style.rb +0 -4
- data/lib/rodf/document.rb +0 -4
- data/lib/rodf/hyperlink.rb +0 -4
- data/lib/rodf/master_page.rb +0 -4
- data/lib/rodf/page_layout.rb +0 -4
- data/lib/rodf/paragraph.rb +0 -4
- data/lib/rodf/paragraph_container.rb +0 -4
- data/lib/rodf/property.rb +0 -4
- data/lib/rodf/row.rb +0 -4
- data/lib/rodf/skeleton.rb +0 -4
- data/lib/rodf/span.rb +0 -4
- data/lib/rodf/spreadsheet.rb +0 -4
- data/lib/rodf/style.rb +0 -4
- data/lib/rodf/style_section.rb +0 -4
- data/lib/rodf/tab.rb +0 -5
- data/lib/rodf/table.rb +0 -4
- data/lib/rodf/text.rb +0 -5
- data/lib/rodf/version.rb +1 -1
- metadata +3 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 448589026c98db61c56b1f4078725adf5cb08282a9257cc0be55ba6f6d90d885
|
4
|
+
data.tar.gz: 2c387630e0250037207433aad4fc886a7e5cbddf624fb1b1943d0aae6585fd7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 974dc5d9c321154811ed47ce27f1c04d065542c08242bbc0f65f9c3c3e685cd80b3165b9ddc0f10eebfc13643cbb38aef48dd92da83dc367990afac78f46d783
|
7
|
+
data.tar.gz: ad463dcab3b3589b4e29fc50b224323a05a23cc662923bf73bcc02b49105daee0de0ee72cbe29c0843a12df6ecef7d25742c295aaee3f8dc8f54544961ad8e08
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,18 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## Unreleased
|
4
|
+
- Nothing yet
|
5
|
+
|
6
|
+
## v1.1.1
|
7
|
+
- [Issue #36](https://github.com/westonganger/rodf/issues/36) - Improve compatibility for Float Cells
|
8
|
+
- Fix gemspec require for Ruby 1.9
|
9
|
+
- Cleanup File Commenting
|
10
|
+
|
3
11
|
## v1.1.0
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
12
|
+
- [#34](https://github.com/westonganger/rodf/pull/34) - Add ability to add many rows or cells at once
|
13
|
+
- [#29](https://github.com/westonganger/rodf/pull/29) - Remove ActiveSupport dependency in favor of `dry-inflector`
|
14
|
+
- [#21](https://github.com/thiagoarrais/rodf/pull/21) - Allow more attributes for the `data_style` method
|
15
|
+
- [#19](https://github.com/westonganger/rodf/issues/19) - Changes to Date/Time handling
|
8
16
|
|
9
17
|
## v1.0.0
|
10
18
|
- Rename main module ODF to RODF, Fix cell types
|
data/README.md
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
# RODF
|
2
2
|
<a href="https://badge.fury.io/rb/rodf" target="_blank"><img height="21" style='border:0px;height:21px;' border='0' src="https://badge.fury.io/rb/rodf.svg" alt="Gem Version"></a>
|
3
|
-
<a href='https://travis-ci.
|
3
|
+
<a href='https://travis-ci.com/westonganger/rodf' target='_blank'><img height='21' style='border:0px;height:21px;' src='https://travis-ci.com/westonganger/rodf.svg?branch=master' border='0' alt='Build Status' /></a>
|
4
4
|
<a href='https://rubygems.org/gems/rodf' target='_blank'><img height='21' style='border:0px;height:21px;' src='https://ruby-gem-downloads-badge.herokuapp.com/rodf?label=rubygems&type=total&total_label=downloads&color=brightgreen' border='0' alt='RubyGems Downloads' /></a>
|
5
5
|
<a href='https://ko-fi.com/A5071NK' target='_blank'><img height='22' style='border:0px;height:22px;' src='https://az743702.vo.msecnd.net/cdn/kofi1.png?v=a' border='0' alt='Buy Me a Coffee' /></a>
|
6
6
|
|
7
|
-
|
7
|
+
RODF is a library for writing to ODF output from Ruby. It mainly focuses creating ODS spreadsheets.
|
8
8
|
|
9
|
-
As well as writing ODS spreadsheets, this library also can write ODT text documents but it is undocumented and will require knowledge of the ODF spec. It currently does not support ODP Slide shows.
|
10
|
-
|
11
|
-
This is NOT an ODF reading library.
|
9
|
+
As well as writing ODS spreadsheets, this library also can write ODT text documents but it is undocumented and will require knowledge of the ODF spec. It currently does not support ODP Slide shows. Also this is NOT an ODF reading library.
|
12
10
|
|
13
11
|
## Install
|
14
12
|
|
@@ -18,7 +16,7 @@ gem install rodf
|
|
18
16
|
|
19
17
|
## How do I use it?
|
20
18
|
|
21
|
-
|
19
|
+
RODF works pretty much like Builder, but with ODF-aware constructs. For example:
|
22
20
|
|
23
21
|
```ruby
|
24
22
|
require 'rodf'
|
@@ -26,7 +24,7 @@ require 'rodf'
|
|
26
24
|
RODF::Spreadsheet.file("my-spreadsheet.ods") do
|
27
25
|
table 'My first table from Ruby' do
|
28
26
|
row do
|
29
|
-
cell 'Hello
|
27
|
+
cell 'Hello world!'
|
30
28
|
end
|
31
29
|
end
|
32
30
|
end
|
@@ -37,7 +35,7 @@ For access to variables and methods from outer code you can use block parameter:
|
|
37
35
|
```ruby
|
38
36
|
require 'rodf'
|
39
37
|
|
40
|
-
@data = 'Hello
|
38
|
+
@data = 'Hello world!'
|
41
39
|
|
42
40
|
RODF::Spreadsheet.file("my-spreadsheet.ods") do |spreadsheet|
|
43
41
|
spreadsheet.table 'My first table from Ruby' do |table|
|
@@ -70,8 +68,7 @@ end
|
|
70
68
|
|
71
69
|
## Procedural style
|
72
70
|
|
73
|
-
The declarative style shown above is just syntatic sugar. A more procedural
|
74
|
-
style can also be used. Like so:
|
71
|
+
The declarative style shown above is just syntatic sugar. A more procedural style can also be used. Like so:
|
75
72
|
|
76
73
|
```ruby
|
77
74
|
require 'rodf'
|
@@ -79,7 +76,7 @@ require 'rodf'
|
|
79
76
|
ss = RODF::Spreadsheet.new
|
80
77
|
t = ss.table 'My first table from Ruby'
|
81
78
|
r = t.row
|
82
|
-
c = r.cell 'Hello
|
79
|
+
c = r.cell 'Hello world!'
|
83
80
|
|
84
81
|
# two methods to write to file
|
85
82
|
ss.write_to 'my-spreadsheet.ods'
|
@@ -96,7 +93,7 @@ require 'rodf'
|
|
96
93
|
ss = RODF::Spreadsheet.new
|
97
94
|
ss.table 'My first table from Ruby' do
|
98
95
|
row do
|
99
|
-
cell 'Hello
|
96
|
+
cell 'Hello world!'
|
100
97
|
end
|
101
98
|
end
|
102
99
|
|
@@ -205,10 +202,8 @@ property :table,
|
|
205
202
|
'writing-mode' => 'lr-tb',
|
206
203
|
```
|
207
204
|
|
208
|
-
|
209
205
|
## Credits
|
210
|
-
Currently Maintained by [@westonganger](https://github.com/westonganger) for simplified ODS spreadsheet creation in the [spreadsheet_architect](https://github.com/westonganger/spreadsheet_architect) gem
|
211
206
|
|
212
207
|
Originally Created by [@thiagoarrais](https://github.com/thiagoarrais)
|
213
208
|
|
214
|
-
|
209
|
+
Maintained by [@westonganger](https://github.com/westonganger) since 2016, for simplified ODS spreadsheet creation within the [spreadsheet_architect](https://github.com/westonganger/spreadsheet_architect) gem
|
data/lib/rodf/cell.rb
CHANGED
@@ -1,7 +1,3 @@
|
|
1
|
-
# Copyright (c) 2008 Thiago Arrais
|
2
|
-
#
|
3
|
-
# This file is part of rODF.
|
4
|
-
|
5
1
|
require 'date'
|
6
2
|
|
7
3
|
require 'builder'
|
@@ -74,10 +70,6 @@ module RODF
|
|
74
70
|
|
75
71
|
private
|
76
72
|
|
77
|
-
def contains_string?
|
78
|
-
:string == @type && !empty?(@value)
|
79
|
-
end
|
80
|
-
|
81
73
|
def make_element_attributes(type, value, opts)
|
82
74
|
attrs = {}
|
83
75
|
|
@@ -117,16 +109,25 @@ module RODF
|
|
117
109
|
end
|
118
110
|
|
119
111
|
def make_value_paragraph
|
120
|
-
if
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
112
|
+
if !empty?(@value)
|
113
|
+
case @type
|
114
|
+
when :float
|
115
|
+
### https://github.com/westonganger/rodf/issues/36
|
116
|
+
value = @value
|
125
117
|
paragraph do
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
118
|
+
self << value
|
119
|
+
end
|
120
|
+
when :string
|
121
|
+
cell, value, url = self, @value, @url
|
122
|
+
|
123
|
+
# Split out newlines to be new cells since the text has been escaped at this point
|
124
|
+
value.to_s.split("\n").each do |split_value|
|
125
|
+
paragraph do
|
126
|
+
if cell.contains_url?
|
127
|
+
link split_value, href: url
|
128
|
+
else
|
129
|
+
self << split_value
|
130
|
+
end
|
130
131
|
end
|
131
132
|
end
|
132
133
|
end
|
data/lib/rodf/column.rb
CHANGED
data/lib/rodf/compatibility.rb
CHANGED
data/lib/rodf/container.rb
CHANGED
data/lib/rodf/data_style.rb
CHANGED
data/lib/rodf/document.rb
CHANGED
data/lib/rodf/hyperlink.rb
CHANGED
data/lib/rodf/master_page.rb
CHANGED
data/lib/rodf/page_layout.rb
CHANGED
data/lib/rodf/paragraph.rb
CHANGED
data/lib/rodf/property.rb
CHANGED
data/lib/rodf/row.rb
CHANGED
data/lib/rodf/skeleton.rb
CHANGED
data/lib/rodf/span.rb
CHANGED
data/lib/rodf/spreadsheet.rb
CHANGED
data/lib/rodf/style.rb
CHANGED
data/lib/rodf/style_section.rb
CHANGED
data/lib/rodf/tab.rb
CHANGED
data/lib/rodf/table.rb
CHANGED
data/lib/rodf/text.rb
CHANGED
data/lib/rodf/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rodf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Weston Ganger
|
8
8
|
- Thiago Arrais
|
9
|
-
- Foivos Zakkak
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2020-01-31 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: builder
|
@@ -179,8 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
178
|
- !ruby/object:Gem::Version
|
180
179
|
version: '0'
|
181
180
|
requirements: []
|
182
|
-
|
183
|
-
rubygems_version: 2.7.6
|
181
|
+
rubygems_version: 3.0.3
|
184
182
|
signing_key:
|
185
183
|
specification_version: 4
|
186
184
|
summary: This is a library for writing to ODF output from Ruby. It mainly focuses
|