chupa-text-decomposer-pdf 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 030aa792be5eaf3746fe1dfade3f03b7d88d5764a53298e7188206b2640e5fa1
4
- data.tar.gz: 544fbc65a5a91f90749e698fdc84b6c0b3df9e6c0ddb0056d8c00ebaebef1342
3
+ metadata.gz: 9ee83b1f226af6155013057a578bc3cd281b585499a7cbb80cb205d34f35b17b
4
+ data.tar.gz: 00a86dc1c0a34244873517e89d6da0be8ea3fdac4b822e74d9767feba5d6ee45
5
5
  SHA512:
6
- metadata.gz: 0c41d71242e4673c3ca26d954f0437626d73f8b33e088965d78abdbd56f9d94657985ae6c7fe16bf05565a872eb6e1a201c6d4b1b2067c36b0c6fa88167149d5
7
- data.tar.gz: ea25378c33b97d84711d89fa08d3e10a2693807e8e4db942d57357b72ceac99aac5fffafe7f4567f8126cf86dae15d97e83382b0b14d1b5e0453022d356fcd2c
6
+ metadata.gz: a7ae9bb6f174da2918bbfcf8bdc6488dff306a2b59bfe2e37165647e355f12f80157c207c110ef54e0c329311aedabd3e2fcd59d3cfde3c316d84a7377174115
7
+ data.tar.gz: 6aedb4a7b7e1b43b22f7c1a7ee2c8a6a93bfcf3faee023502d2cd54bde1a17c341c36d1c530e71095bdfb633e65366700ff2064b1b4a09f93a7953cbf2dcbd72
@@ -22,7 +22,7 @@ end
22
22
 
23
23
  Gem::Specification.new do |spec|
24
24
  spec.name = "chupa-text-decomposer-pdf"
25
- spec.version = "1.0.6"
25
+ spec.version = "1.0.7"
26
26
  spec.homepage = "https://github.com/ranguba/chupa-text-decomposer-pdf"
27
27
  spec.authors = ["Kouhei Sutou"]
28
28
  spec.email = ["kou@clear-code.com"]
data/doc/text/news.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## 1.0.7: 2019-02-27
4
+
5
+ ### Improvements
6
+
7
+ * Added support for `String` path.
8
+
3
9
  ## 1.0.6: 2019-02-27
4
10
 
5
11
  ### Improvements
@@ -64,9 +64,17 @@ module ChupaText
64
64
  def create_document(data)
65
65
  _password = password(data)
66
66
  path = data.path
67
- if path and path.exist?
68
- path = path.to_s
69
- else
67
+ case path
68
+ when String
69
+ path = nil unless File.exist?(path)
70
+ when Pathname
71
+ if path.exist?
72
+ path = path.to_s
73
+ else
74
+ path = nil
75
+ end
76
+ end
77
+ if path.nil?
70
78
  file = Tempfile.new(["chupa-text-decomposer-pdf", ".pdf"])
71
79
  file.binmode
72
80
  file.write(data.body)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chupa-text-decomposer-pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou