rodf 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +1 -0
  3. data/lib/odf/document.rb +17 -8
  4. data/rodf.gemspec +4 -4
  5. metadata +24 -38
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 26bc83e35a41f6d2b90e6dbaa15465364223ef37
4
+ data.tar.gz: 49bfa1ee2a941d2cac1e26b19ac9545bc7275060
5
+ SHA512:
6
+ metadata.gz: 5eb5f596ede184c968dfb948f3aa62c0001d0401a7144e9445bbfa0c1c23f709cf5f2d9a8da533161d07ad7f0e1629c348ce572bdc3dd6ec96bea1e5bc825c2b
7
+ data.tar.gz: 3696a52edc521282ea76341b1288b0c226cd2bd1a78753494b61d06fca2dc12ce17a6a41e6199feb1fbe4c755f8722b0de8229e403997456f716f9586943db2d
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v0.3.6. Resulting ODF files as bitstrings
1
2
  v0.3.5. Allows current libraries
2
3
  v0.3.4. Procedural cell styling
3
4
  v0.3.3. Documents can now write themselves to disk
data/lib/odf/document.rb CHANGED
@@ -33,17 +33,26 @@ module ODF
33
33
  end
34
34
 
35
35
  def write_to(ods_file_name)
36
- ods_file = Zip::File.open(ods_file_name, Zip::File::CREATE)
37
- ods_file.get_output_stream('META-INF/manifest.xml') {|f| f << self.class.skeleton.manifest(self.class.doc_type) }
36
+ File.open(ods_file_name, 'w') { |f| f << self.bytes }
37
+ end
38
+
39
+ def bytes
40
+ buffer = Zip::OutputStream::write_buffer do |zio|
41
+ zio.put_next_entry('META-INF/manifest.xml')
42
+ zio << self.class.skeleton.manifest(self.class.doc_type)
43
+
44
+ zio.put_next_entry('styles.xml')
45
+ zio << self.class.skeleton.styles
46
+ zio << self.office_styles_xml unless self.office_styles.empty?
47
+ zio << "</office:styles> </office:document-styles>"
38
48
 
39
- ods_file.get_output_stream('styles.xml') do |f|
40
- f << self.class.skeleton.styles
41
- f << self.office_styles_xml unless self.office_styles.empty?
42
- f << "</office:styles> </office:document-styles>"
49
+ zio.put_next_entry('content.xml')
50
+ zio << self.xml
43
51
  end
44
- ods_file.get_output_stream('content.xml') {|f| f << self.xml}
45
52
 
46
- ods_file.close
53
+ buffer.set_encoding('ASCII-8BIT')
54
+ buffer.rewind
55
+ buffer.sysread
47
56
  end
48
57
  private
49
58
  def self.skeleton
data/rodf.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rodf"
5
- s.version = "0.3.5"
5
+ s.version = "0.3.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Thiago Arrais, Foivos Zakkak"]
9
- s.date = "2014-01-20"
9
+ s.date = "2014-10-09"
10
10
  s.description = "ODF generation library for Ruby"
11
11
  s.email = "thiago.arrais@gmail.com"
12
12
  s.extra_rdoc_files = ["CHANGELOG", "LICENSE.LGPL", "README.rdoc", "lib/odf/cell.rb", "lib/odf/column.rb", "lib/odf/compatibility.rb", "lib/odf/container.rb", "lib/odf/data_style.rb", "lib/odf/document.rb", "lib/odf/hyperlink.rb", "lib/odf/master_page.rb", "lib/odf/page_layout.rb", "lib/odf/paragraph.rb", "lib/odf/paragraph_container.rb", "lib/odf/property.rb", "lib/odf/row.rb", "lib/odf/skeleton.rb", "lib/odf/skeleton/manifest.xml.erb", "lib/odf/skeleton/styles.pxml", "lib/odf/span.rb", "lib/odf/spreadsheet.rb", "lib/odf/style.rb", "lib/odf/style_section.rb", "lib/odf/tab.rb", "lib/odf/table.rb", "lib/odf/text.rb"]
@@ -15,11 +15,11 @@ Gem::Specification.new do |s|
15
15
  s.rdoc_options = ["--line-numbers", "--title", "Rodf", "--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = "rodf"
18
- s.rubygems_version = "1.8.25"
18
+ s.rubygems_version = "2.0.3"
19
19
  s.summary = "ODF generation library for Ruby"
20
20
 
21
21
  if s.respond_to? :specification_version then
22
- s.specification_version = 3
22
+ s.specification_version = 4
23
23
 
24
24
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
25
  s.add_runtime_dependency(%q<builder>, ["~> 3.0"])
metadata CHANGED
@@ -1,116 +1,103 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rodf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
5
- prerelease:
4
+ version: 0.3.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Thiago Arrais, Foivos Zakkak
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-01-20 00:00:00.000000000 Z
11
+ date: 2014-10-09 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: builder
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '3.0'
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: '3.0'
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.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.0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: activesupport
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '3.0'
54
- - - <
48
+ - - "<"
55
49
  - !ruby/object:Gem::Version
56
50
  version: '5.0'
57
51
  type: :runtime
58
52
  prerelease: false
59
53
  version_requirements: !ruby/object:Gem::Requirement
60
- none: false
61
54
  requirements:
62
- - - ! '>='
55
+ - - ">="
63
56
  - !ruby/object:Gem::Version
64
57
  version: '3.0'
65
- - - <
58
+ - - "<"
66
59
  - !ruby/object:Gem::Version
67
60
  version: '5.0'
68
61
  - !ruby/object:Gem::Dependency
69
62
  name: rspec
70
63
  requirement: !ruby/object:Gem::Requirement
71
- none: false
72
64
  requirements:
73
- - - ~>
65
+ - - "~>"
74
66
  - !ruby/object:Gem::Version
75
67
  version: '2.9'
76
68
  type: :development
77
69
  prerelease: false
78
70
  version_requirements: !ruby/object:Gem::Requirement
79
- none: false
80
71
  requirements:
81
- - - ~>
72
+ - - "~>"
82
73
  - !ruby/object:Gem::Version
83
74
  version: '2.9'
84
75
  - !ruby/object:Gem::Dependency
85
76
  name: rspec_hpricot_matchers
86
77
  requirement: !ruby/object:Gem::Requirement
87
- none: false
88
78
  requirements:
89
- - - ~>
79
+ - - "~>"
90
80
  - !ruby/object:Gem::Version
91
81
  version: '1.0'
92
82
  type: :development
93
83
  prerelease: false
94
84
  version_requirements: !ruby/object:Gem::Requirement
95
- none: false
96
85
  requirements:
97
- - - ~>
86
+ - - "~>"
98
87
  - !ruby/object:Gem::Version
99
88
  version: '1.0'
100
89
  - !ruby/object:Gem::Dependency
101
90
  name: echoe
102
91
  requirement: !ruby/object:Gem::Requirement
103
- none: false
104
92
  requirements:
105
- - - ~>
93
+ - - "~>"
106
94
  - !ruby/object:Gem::Version
107
95
  version: '4.6'
108
96
  type: :development
109
97
  prerelease: false
110
98
  version_requirements: !ruby/object:Gem::Requirement
111
- none: false
112
99
  requirements:
113
- - - ~>
100
+ - - "~>"
114
101
  - !ruby/object:Gem::Version
115
102
  version: '4.6'
116
103
  description: ODF generation library for Ruby
@@ -194,31 +181,30 @@ files:
194
181
  - spec/text_spec.rb
195
182
  homepage: http://github.com/thiagoarrais/rodf/tree
196
183
  licenses: []
184
+ metadata: {}
197
185
  post_install_message:
198
186
  rdoc_options:
199
- - --line-numbers
200
- - --title
187
+ - "--line-numbers"
188
+ - "--title"
201
189
  - Rodf
202
- - --main
190
+ - "--main"
203
191
  - README.rdoc
204
192
  require_paths:
205
193
  - lib
206
194
  required_ruby_version: !ruby/object:Gem::Requirement
207
- none: false
208
195
  requirements:
209
- - - ! '>='
196
+ - - ">="
210
197
  - !ruby/object:Gem::Version
211
198
  version: '0'
212
199
  required_rubygems_version: !ruby/object:Gem::Requirement
213
- none: false
214
200
  requirements:
215
- - - ! '>='
201
+ - - ">="
216
202
  - !ruby/object:Gem::Version
217
203
  version: '1.2'
218
204
  requirements: []
219
205
  rubyforge_project: rodf
220
- rubygems_version: 1.8.25
206
+ rubygems_version: 2.0.3
221
207
  signing_key:
222
- specification_version: 3
208
+ specification_version: 4
223
209
  summary: ODF generation library for Ruby
224
210
  test_files: []