html2odt 0.4.4 → 0.4.6

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
- SHA256:
3
- metadata.gz: 464efb77c678a0b0e3e0027fcb31008ab6df1a2e78b9d9ae0ecfc39f173863ba
4
- data.tar.gz: f2d86c56e5e8671cdfeec2df5d48b6011b35580245201f62a78328fadbcaa2f1
2
+ SHA1:
3
+ metadata.gz: f516bc8a83378731a7fa9962c56543784bbaf8d9
4
+ data.tar.gz: 9851cb1589a9cb5b30aed2061b38c8686202b02e
5
5
  SHA512:
6
- metadata.gz: '0289085cedecd1c97daf05fbdbe507d88324bc301435abbc30dde0c873f991ab284840ec65fa31c778de87dfd8f3d12cfc9a75dd59e0bc246b69a74ebcd46011'
7
- data.tar.gz: 745d2fc688b79c66ca747b75022af33e78f93f6d4e2be223d06e8137355c2bcb50046265cacdafaf6c4cb6886538ec50e78d155bfedd7419b76ee40b76063fce
6
+ metadata.gz: f28b6b63b34290a0eaff83ed813ca0b7add7f57911bf89e965073b1fec4ea745c575f0f49ab0cf67a596090b444411d3507e5699279d74241164b65db08e792e
7
+ data.tar.gz: 55f00819a1e29f07a3de4a239c579cd7c7e33703ae948f8aec9ee56ea96666941b818e7e44395207887af5caac20f3ca8a5e145c8c6ec6b6168bb03f9e173d2f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # v0.4.6 - 2021-03-23
2
+
3
+ Support resources behind redirects.
4
+ Check for source being a file before trying to read it
5
+
6
+ # v0.4.5 - 2021-01-06
7
+
8
+ Force binmode when writing out the ODT
9
+
1
10
  # v0.4.4 - 2020-01-06
2
11
 
3
12
  Fix exception occurring with some document contents
@@ -174,7 +174,7 @@ class Html2Odt::Document
174
174
  end
175
175
 
176
176
  def write_to(path)
177
- File.write(path, data)
177
+ File.write(path, data, mode: 'wb')
178
178
  end
179
179
 
180
180
  protected
@@ -399,6 +399,9 @@ class Html2Odt::Document
399
399
  def uri_to_file(uri)
400
400
  Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") do |http|
401
401
  resp = http.get(uri.path)
402
+ if resp.is_a?(Net::HTTPRedirection) and redirect_uri = URI.parse(resp['location'])
403
+ resp = http.get(redirect_uri)
404
+ end
402
405
 
403
406
  return nil unless resp.is_a?(Net::HTTPSuccess)
404
407
 
@@ -18,7 +18,7 @@ class Html2Odt::Image
18
18
  end
19
19
 
20
20
  def valid?
21
- return false if source.nil? or !File.readable?(source)
21
+ return false if source.nil? or !File.readable?(source) or !File.file?(source)
22
22
 
23
23
  if @valid.nil?
24
24
  File.open(source, "rb") do |io|
@@ -1,3 +1,3 @@
1
1
  module Html2Odt
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html2odt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregor Schmidt (Planio)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-06 00:00:00.000000000 Z
11
+ date: 2021-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dimensions
@@ -180,7 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  requirements: []
183
- rubygems_version: 3.1.2
183
+ rubyforge_project:
184
+ rubygems_version: 2.6.14.4
184
185
  signing_key:
185
186
  specification_version: 4
186
187
  summary: html2odt generates ODT documents based on HTML fragments