spreadbase 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89cb94c9ff4d62b429681c6d4cca60ea78b168e2764c4a17a8b94f62b3e39ba4
4
- data.tar.gz: be8c13aca79e8ee79ecf409f2d8f009e5e1c71220cf67368243e779d2432f35b
3
+ metadata.gz: 603c441b06a1eb85d926da95f9ce1c384fcd1642402e786fa7fc6106cd2e6def
4
+ data.tar.gz: 973d5b1f2908261266e760b028f7cc884e5c9e9ba651488d9c7396f9d39ec688
5
5
  SHA512:
6
- metadata.gz: 2f12dcc306f702bba5d0ae6a726c3e61a3a4088d4de68e0fb82aadd04a8b226b5da34f17123326816de6532ffdf4ca5c7c5f0f6f161a52f9216a0ad258c04112
7
- data.tar.gz: eabcb7bd63da042b2aba2013fca3510e2e17f2033d7510bb52970f9d2eff9bcea3698271ffcdc52e0cd9b45dad1219efec1a0a2466ba97f230448c9a36570874
6
+ metadata.gz: 99e574f21843aa28699d5732942165e11f5b213a3dfe932f365b4f9bd0c0798fca7b4b49a84a755e2d9dbfabdfacab5cc3a840eb727ef09a9890d8f1255d470e
7
+ data.tar.gz: 1fbe613fa5c63cd02853ce36d8d423a2597ab536e560c6c14f79ca9e5c7b247fc9f643b7390561221c20346f54ac72954048b3d9e5f2e90b64f4b7f4c2718cfe
@@ -5,3 +5,4 @@ rvm:
5
5
  - 2.4
6
6
  - 2.5
7
7
  - 2.6
8
+ - 2.7
@@ -1,4 +1,4 @@
1
- require 'zipruby'
1
+ require 'zip'
2
2
  require 'rexml/document'
3
3
 
4
4
  module SpreadBase # :nodoc:
@@ -37,11 +37,9 @@ module SpreadBase # :nodoc:
37
37
  document_buffer = encode_to_content_xml(el_document, options)
38
38
  zip_buffer = ''
39
39
 
40
- Zip::Archive.open_buffer(zip_buffer, Zip::CREATE) do | zip_file |
41
- zip_file.add_dir('META-INF')
42
-
43
- zip_file.add_buffer('META-INF/manifest.xml', MANIFEST_XML);
44
- zip_file.add_buffer('content.xml', document_buffer);
40
+ Zip::File.open_buffer(zip_buffer) do | zip_file |
41
+ zip_file.get_output_stream('META-INF/manifest.xml') { |f| f << MANIFEST_XML }
42
+ zip_file.get_output_stream('content.xml') { |f| f << document_buffer }
45
43
  end
46
44
 
47
45
  zip_buffer
@@ -61,9 +59,8 @@ module SpreadBase # :nodoc:
61
59
  # _returns_ the SpreadBase::Document instance.
62
60
  #
63
61
  def decode_archive(zip_buffer, options={})
64
- content_xml_data = Zip::Archive.open_buffer(zip_buffer) do | zip_file |
65
- zip_file.fopen('content.xml') { | file | file.read }
66
- end
62
+ io = StringIO.new(zip_buffer)
63
+ content_xml_data = Zip::File.new(io, false, true).read('content.xml')
67
64
 
68
65
  decode_content_xml(content_xml_data, options)
69
66
  end
@@ -1,3 +1,3 @@
1
1
  module SpreadBase
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -10,14 +10,14 @@ Gem::Specification.new do |s|
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.required_ruby_version = '>= 2.3.0'
12
12
  s.authors = ["Saverio Miroddi"]
13
- s.date = '2020-02-03'
13
+ s.date = '2020-07-15'
14
14
  s.email = ["saverio.pub2@gmail.com"]
15
15
  s.homepage = "https://github.com/saveriomiroddi/spreadbase"
16
16
  s.summary = %q{Library for reading/writing OpenOffice Calc documents.}
17
17
  s.description = %q{Library for reading/writing OpenOffice Calc documents.}
18
18
  s.license = "GPL-3.0"
19
19
 
20
- s.add_runtime_dependency "zipruby", "~>0.3.6"
20
+ s.add_runtime_dependency "rubyzip", ">=1.3.0"
21
21
  s.add_development_dependency "rspec", "~>3.9.0"
22
22
 
23
23
  s.add_development_dependency "rake", "~>13.0"
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreadbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saverio Miroddi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-03 00:00:00.000000000 Z
11
+ date: 2020-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: zipruby
14
+ name: rubyzip
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.6
19
+ version: 1.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.6
26
+ version: 1.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  requirements: []
110
- rubygems_version: 3.0.6
110
+ rubygems_version: 3.0.8
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: Library for reading/writing OpenOffice Calc documents.