libreconv 0.6.0 → 0.6.1

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
  SHA1:
3
- metadata.gz: 1c0b2e8c36829fb01420f9da4efb0cd1565d7a65
4
- data.tar.gz: 940540e2e7786e7834d8aa7fed9ec7cc845a2fec
3
+ metadata.gz: a009fa5b2db0723e30e82735267f0ba9e7e37d3a
4
+ data.tar.gz: acef625a46cb3405d5a62e3f3e48d76f57ead885
5
5
  SHA512:
6
- metadata.gz: b6126da8cda5ccd76b8585f5c9511349578c6713e77e67968d2d0aca2d4b6166b2c2d2061744781d79b68adf638e36769f1b5a9ce954ad59751057fcced3141d
7
- data.tar.gz: 09148e1e93cde05f3fb30b58e6774b61a73b73fe9abb92c6911fca799e659c964a8ddc8cc81b1a1709250d0bbbb55031e210790cf67a7735d64b79b503270767
6
+ metadata.gz: eea9a950ba37821da056e71d5f4a0c279a6cb1892fad82391177b5b328611fe521e5de826406275f68d1e10706b6d9e7a4ffae7766b558dbd10c70c887a40b55
7
+ data.tar.gz: b7d03a1eb8a4f2772656a7b3db4bf2fc5195ede5145eb34540794b4bec2f3bac1e4335ac3f685ef36dc048dcd8684e846a148cf3d7d576f7153a878c6f7f3cec
@@ -1,3 +1,3 @@
1
1
  module Libreconv
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
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
- system("#{cmd} > /dev/null")
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
- if File.exists?(@source) && File.directory?(@source) == false
54
- :file
55
- elsif URI(@source).scheme == "http" && Net::HTTP.get_response(URI(@source)).is_a?(Net::HTTPSuccess)
56
- :http
57
- elsif URI(@source).scheme == "https" && Net::HTTP.get_response(URI(@source)).is_a?(Net::HTTPSuccess)
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.0
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-30 00:00:00.000000000 Z
11
+ date: 2013-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler