chupa-text-decomposer-libreoffice-general 1.0.1 → 1.0.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ffd6e44bf422caadd0b8d2b45a4c1186a300dd3b003ab4e95f6907870665beb
|
4
|
+
data.tar.gz: a9da7633fd8fc2d46cd970591980c6994d919d90baf29da1f732938fae143e1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23507f95e03ecf78e61a4b8548da353e3750f4261d61d7b3cf392dab6c22b18eadc2045cdb6f6b2d66cfb8b7345187f794c943bfb7f00d8c92df291f3137e89a
|
7
|
+
data.tar.gz: 749fe52e7143bf8bab7da105122d1ed4c94c1643aa776744880eb75bd5211b2b40d9d6f2fa0570ce8c17b10286575eecb11be3710cc9fbe7493d6de928fa41e8
|
@@ -22,7 +22,7 @@ end
|
|
22
22
|
|
23
23
|
Gem::Specification.new do |spec|
|
24
24
|
spec.name = "chupa-text-decomposer-libreoffice-general"
|
25
|
-
spec.version = "1.0.
|
25
|
+
spec.version = "1.0.2"
|
26
26
|
spec.homepage = "https://github.com/ranguba/chupa-text-decomposer-libreoffice"
|
27
27
|
spec.authors = ["Kouhei Sutou"]
|
28
28
|
spec.email = ["kou@clear-code.com"]
|
data/doc/text/news.md
CHANGED
@@ -73,19 +73,26 @@ module ChupaText
|
|
73
73
|
|
74
74
|
def convert_to_pdf(data)
|
75
75
|
Dir.mktmpdir do |temporary_directory|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
76
|
+
home_directory = File.join(temporary_directory, "home")
|
77
|
+
FileUtils.mkdir_p(home_directory)
|
78
|
+
output_directory = File.join(temporary_directory, "output")
|
79
|
+
FileUtils.mkdir_p(output_directory)
|
80
|
+
stdout_path = File.join(temporary_directory, "stdout.log")
|
81
|
+
stderr_path = File.join(temporary_directory, "stderr.log")
|
82
|
+
succeeded = @command.run("--nologo",
|
80
83
|
"--nolockcheck",
|
81
84
|
"--norestore",
|
85
|
+
"--headless",
|
82
86
|
"--convert-to", "pdf",
|
83
|
-
"--outdir",
|
87
|
+
"--outdir", output_directory,
|
84
88
|
data.path.to_s,
|
85
89
|
{
|
90
|
+
:env => {
|
91
|
+
"HOME" => home_directory,
|
92
|
+
},
|
86
93
|
:spawn_options => {
|
87
|
-
:out =>
|
88
|
-
:err =>
|
94
|
+
:out => stdout_path,
|
95
|
+
:err => stderr_path,
|
89
96
|
},
|
90
97
|
})
|
91
98
|
unless succeeded
|
@@ -93,20 +100,20 @@ module ChupaText
|
|
93
100
|
tag = "#{log_tag}[convert][exited][abnormally]"
|
94
101
|
[
|
95
102
|
tag,
|
96
|
-
"output: <#{
|
97
|
-
"error: <#{
|
103
|
+
"output: <#{File.read(stdout_path)}>",
|
104
|
+
"error: <#{File.read(stderr_path)}>",
|
98
105
|
].join("\n")
|
99
106
|
end
|
100
107
|
return nil
|
101
108
|
end
|
102
|
-
pdf_path, = Dir.glob("#{
|
109
|
+
pdf_path, = Dir.glob("#{output_directory}/*.pdf")
|
103
110
|
if pdf_path.nil?
|
104
111
|
error do
|
105
112
|
tag = "#{log_tag}[convert][failed]"
|
106
113
|
[
|
107
114
|
"#{tag}: LibreOffice may be running",
|
108
|
-
"output: <#{
|
109
|
-
"error: <#{
|
115
|
+
"output: <#{File.read(stdout_path)}>",
|
116
|
+
"error: <#{File.read(stderr_path)}>",
|
110
117
|
].join("\n")
|
111
118
|
end
|
112
119
|
return nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chupa-text-decomposer-libreoffice-general
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chupa-text
|