libreconv 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/libreconv/version.rb +1 -1
- data/lib/libreconv.rb +4 -2
- data/spec/libreconv_spec.rb +2 -17
- metadata +2 -3
- data/doc.pdf +0 -79
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39baec4c6b5f1e2ad2cd9763a544fc2f509f9782
|
4
|
+
data.tar.gz: 33000e19179616640f0f1453bac7fce018df8084
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4285c8657072f9abd1db33cefcf1b76d63891055365f5beffb97211950a0da976cef03070166c9060ddc27bd81cec074270f85667a93dbcd9d0356528130cb2f
|
7
|
+
data.tar.gz: ca0464c97b73fb5b97dc7d4762eeef479c562fae354bab940838838688ff93a87fbc42b7a7868fceabcacfac5f73dcf42c0d75cb5373e63172ae0980e7d164e5
|
data/lib/libreconv/version.rb
CHANGED
data/lib/libreconv.rb
CHANGED
@@ -27,9 +27,11 @@ module Libreconv
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def convert
|
30
|
-
|
31
|
-
|
30
|
+
orig_stdout = $stdout.clone
|
31
|
+
$stdout.reopen File.new('/dev/null', 'w')
|
32
|
+
pid = Spoon.spawnp(@soffice_command, "--headless", "--convert-to", "pdf", @source, "-outdir", @target_path)
|
32
33
|
Process.waitpid(pid)
|
34
|
+
$stdout.reopen orig_stdout
|
33
35
|
target_tmp_file = "#{@target_path}/#{File.basename(@source, ".*")}.pdf"
|
34
36
|
FileUtils.cp target_tmp_file, @target
|
35
37
|
end
|
data/spec/libreconv_spec.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'spec_helper'
|
3
|
-
require 'webrick'
|
4
|
-
|
5
|
-
include WEBrick
|
6
3
|
|
7
4
|
describe Libreconv do
|
8
5
|
|
@@ -12,14 +9,7 @@ describe Libreconv do
|
|
12
9
|
@pptx_file = file_path("pptx.pptx")
|
13
10
|
@ppt_file = file_path("ppt.ppt")
|
14
11
|
@target_path = "/tmp/libreconv"
|
15
|
-
|
16
|
-
dir = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures'))
|
17
|
-
port = 50506
|
18
|
-
@url = "http://#{Socket.gethostname}:#{port}"
|
19
|
-
@t1 = Thread.new do
|
20
|
-
@server = HTTPServer.new(:Port => port, :DocumentRoot => dir, :AccessLog => [], :Logger => WEBrick::Log::new("/dev/null", 7))
|
21
|
-
@server.start
|
22
|
-
end
|
12
|
+
@url = "http://s3.amazonaws.com/libreconv-test/docx.docx"
|
23
13
|
end
|
24
14
|
|
25
15
|
before(:each) do
|
@@ -30,10 +20,6 @@ describe Libreconv do
|
|
30
20
|
FileUtils.rm_rf @target_path
|
31
21
|
end
|
32
22
|
|
33
|
-
after(:all) do
|
34
|
-
@t1.exit
|
35
|
-
end
|
36
|
-
|
37
23
|
describe Libreconv::Converter do
|
38
24
|
describe "#new" do
|
39
25
|
it "should raise error if soffice command does not exists" do
|
@@ -82,9 +68,8 @@ describe Libreconv do
|
|
82
68
|
end
|
83
69
|
|
84
70
|
it "should convert a docx to pdf specifying an URL as source" do
|
85
|
-
url = "#{@url}/docx.docx"
|
86
71
|
target_file = "#{@target_path}/docx.pdf"
|
87
|
-
converter = Libreconv::Converter.new(url, @target_path)
|
72
|
+
converter = Libreconv::Converter.new(@url, @target_path)
|
88
73
|
converter.convert
|
89
74
|
File.file?(target_file).should == true
|
90
75
|
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.8.
|
4
|
+
version: 0.8.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-
|
11
|
+
date: 2013-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spoon
|
@@ -80,7 +80,6 @@ files:
|
|
80
80
|
- LICENSE.txt
|
81
81
|
- README.md
|
82
82
|
- Rakefile
|
83
|
-
- doc.pdf
|
84
83
|
- lib/libreconv.rb
|
85
84
|
- lib/libreconv/version.rb
|
86
85
|
- libreconv.gemspec
|
data/doc.pdf
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
%PDF-1.4
|
2
|
-
%äüöß
|
3
|
-
2 0 obj
|
4
|
-
<</Length 3 0 R/Filter/FlateDecode>>
|
5
|
-
stream
|
6
|
-
x��P;�0��+nZ��]!��nB�A�|l�]��^s�(H.��\�Z�]ݠ��+|m�u�na8�����.j��G����k
|
7
|
-
}=�dXȧ����{o�%��(j�� ���+��n�3v�����\��g�H.��\|}�4����?
|
8
|
-
�䳴?C�=�Q�a�y����je�i�
|
9
|
-
endstream
|
10
|
-
endobj
|
11
|
-
|
12
|
-
3 0 obj
|
13
|
-
216
|
14
|
-
endobj
|
15
|
-
|
16
|
-
5 0 obj
|
17
|
-
<</Type/Font/Subtype/Type1/BaseFont/Helvetica
|
18
|
-
/Encoding/WinAnsiEncoding
|
19
|
-
>>
|
20
|
-
endobj
|
21
|
-
|
22
|
-
6 0 obj
|
23
|
-
<</F1 5 0 R
|
24
|
-
>>
|
25
|
-
endobj
|
26
|
-
|
27
|
-
7 0 obj
|
28
|
-
<</Font 6 0 R
|
29
|
-
/ProcSet[/PDF/Text]
|
30
|
-
>>
|
31
|
-
endobj
|
32
|
-
|
33
|
-
1 0 obj
|
34
|
-
<</Type/Page/Parent 4 0 R/Resources 7 0 R/MediaBox[0 0 595 842]/Group<</S/Transparency/CS/DeviceRGB/I true>>/Contents 2 0 R>>
|
35
|
-
endobj
|
36
|
-
|
37
|
-
4 0 obj
|
38
|
-
<</Type/Pages
|
39
|
-
/Resources 7 0 R
|
40
|
-
/MediaBox[ 0 0 595 842 ]
|
41
|
-
/Kids[ 1 0 R ]
|
42
|
-
/Count 1>>
|
43
|
-
endobj
|
44
|
-
|
45
|
-
8 0 obj
|
46
|
-
<</Type/Catalog/Pages 4 0 R
|
47
|
-
/OpenAction[1 0 R /XYZ null null 0]
|
48
|
-
/Lang(en)
|
49
|
-
>>
|
50
|
-
endobj
|
51
|
-
|
52
|
-
9 0 obj
|
53
|
-
<</Creator<FEFF005700720069007400650072>
|
54
|
-
/Producer<FEFF004C0069006200720065004F0066006600690063006500200034002E0030>
|
55
|
-
/CreationDate(D:20130413003036+02'00')>>
|
56
|
-
endobj
|
57
|
-
|
58
|
-
xref
|
59
|
-
0 10
|
60
|
-
0000000000 65535 f
|
61
|
-
0000000501 00000 n
|
62
|
-
0000000019 00000 n
|
63
|
-
0000000306 00000 n
|
64
|
-
0000000643 00000 n
|
65
|
-
0000000326 00000 n
|
66
|
-
0000000417 00000 n
|
67
|
-
0000000448 00000 n
|
68
|
-
0000000741 00000 n
|
69
|
-
0000000834 00000 n
|
70
|
-
trailer
|
71
|
-
<</Size 10/Root 8 0 R
|
72
|
-
/Info 9 0 R
|
73
|
-
/ID [ <5B1DA112593D69DE853EB34CE2A8F361>
|
74
|
-
<5B1DA112593D69DE853EB34CE2A8F361> ]
|
75
|
-
/DocChecksum /4269040604A6FE91FF4EF9808079BD6D
|
76
|
-
>>
|
77
|
-
startxref
|
78
|
-
1008
|
79
|
-
%%EOF
|