libreconv 0.6.0 → 0.6.1
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 +4 -4
- data/lib/libreconv/version.rb +1 -1
- data/lib/libreconv.rb +7 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a009fa5b2db0723e30e82735267f0ba9e7e37d3a
|
4
|
+
data.tar.gz: acef625a46cb3405d5a62e3f3e48d76f57ead885
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eea9a950ba37821da056e71d5f4a0c279a6cb1892fad82391177b5b328611fe521e5de826406275f68d1e10706b6d9e7a4ffae7766b558dbd10c70c887a40b55
|
7
|
+
data.tar.gz: b7d03a1eb8a4f2772656a7b3db4bf2fc5195ede5145eb34540794b4bec2f3bac1e4335ac3f685ef36dc048dcd8684e846a148cf3d7d576f7153a878c6f7f3cec
|
data/lib/libreconv/version.rb
CHANGED
data/lib/libreconv.rb
CHANGED
@@ -25,7 +25,8 @@ module Libreconv
|
|
25
25
|
|
26
26
|
def convert
|
27
27
|
cmd = "#{@soffice_command} --headless --convert-to pdf #{@source} -outdir #{@target_path}"
|
28
|
-
|
28
|
+
pid = Process.spawn(cmd, [:out, :err] => "/dev/null")
|
29
|
+
Process.waitpid(pid)
|
29
30
|
end
|
30
31
|
|
31
32
|
private
|
@@ -50,15 +51,11 @@ module Libreconv
|
|
50
51
|
end
|
51
52
|
|
52
53
|
def check_source_type
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
:https
|
59
|
-
else
|
60
|
-
raise IOError, "Source (#{@source}) is neither file nor http."
|
61
|
-
end
|
54
|
+
is_file = File.exists?(@source) && !File.directory?(@source)
|
55
|
+
is_http = URI(@source).scheme == "http" && Net::HTTP.get_response(URI(@source)).is_a?(Net::HTTPSuccess)
|
56
|
+
is_https = URI(@source).scheme == "https" && Net::HTTP.get_response(URI(@source)).is_a?(Net::HTTPSuccess)
|
57
|
+
|
58
|
+
raise IOError, "Source (#{@source}) is neither a file nor an URL." unless is_file || is_http || is_https
|
62
59
|
end
|
63
60
|
end
|
64
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libreconv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Nyström
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|