pdfunite 0.2.0 → 0.3.0

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
  SHA1:
3
- metadata.gz: aec7840f94b79b8e0f9dbe6c6e6b5f3b5240e1c3
4
- data.tar.gz: ba5134602e29d237580b079d525da4d264399d59
3
+ metadata.gz: 29e5d158cd6b9da9c8492fffbd17a1ed0bd2045f
4
+ data.tar.gz: e0089aa79fea511177dcce053b6f866cff2f801d
5
5
  SHA512:
6
- metadata.gz: 8459093ce02a57d73bdabef10bcd46f33eaca580dfc054ea9f12a3611f426c060a9d56f68c730b3f21ab97ec583129b002d9fe283ed4cddfa427d3269da898e7
7
- data.tar.gz: f7876915782be2775cb7cc4cb739037448bb812a2a6f179cba12c9f6b5e643b626073d89cc92277819ee56a65d3d419596eccdb78626777ed28d23546ba4b521
6
+ metadata.gz: 469e1202c596ba22cd4a238f4070395dfc200582c05363bb8fe6355526d087f2056f0bf794af63745d0ed9e9754324afbb429a8b9916978b3abaf4a4ee0ba77c
7
+ data.tar.gz: a6c5dc3dff1d243d3ed43e377ff2304a756b0f0079ddb5021416ee488a028c959385b1b16dd55450c04f883d17b1971319309cd8198f18e797223df3d566393a
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.3.0 - Dec 6, 2014
2
+
3
+ * Do not read existing files, use paths instead
4
+
1
5
  0.2.0 - Nov 27, 2014
2
6
 
3
7
  * added Pdfunite.binary configuration option
@@ -44,10 +44,15 @@ module Pdfunite
44
44
  tmpdir = Pathname.new(dir).realpath
45
45
  files = args.flatten(1).inject({}) do |hsh, arg|
46
46
  idx = hsh.size
47
- data = block_given? ? yield(arg) : File.binread(arg)
48
- tmpfile = tmpdir.join("#{idx}.pdf")
49
- tmpfile.open('wb') { |f| f << data }
50
- hsh.update(:"f_#{idx}" => tmpfile.realpath.to_s)
47
+ realpath = if block_given?
48
+ data = yield(arg)
49
+ file = tmpdir.join("#{idx}.pdf")
50
+ file.open('wb') { |f| f << data }
51
+ file.realpath
52
+ else
53
+ Pathname.new(arg).realpath
54
+ end
55
+ hsh.update(:"f_#{idx}" => realpath.to_s)
51
56
  end
52
57
  cmdline = Cocaine::CommandLine.new(binary, "#{files.keys.map(&:inspect).join(' ')} :outfile", logger: Pdfunite.logger || Logger.new(STDOUT))
53
58
  outfile = tmpdir.join('output.pdf')
@@ -1,3 +1,3 @@
1
1
  module Pdfunite
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdfunite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-27 00:00:00.000000000 Z
11
+ date: 2014-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocaine
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '5.0'
97
- description: Ruby wrapper for the pdfunite command line tool. No Java required
97
+ description: A Ruby wrapper for the pdfunite command line tool
98
98
  email:
99
99
  - mtgrosser@gmx.net
100
100
  executables: []
@@ -130,5 +130,5 @@ rubyforge_project:
130
130
  rubygems_version: 2.2.2
131
131
  signing_key:
132
132
  specification_version: 4
133
- summary: Merge PDF files with Ruby
133
+ summary: Merge PDF files with Ruby - no Java required
134
134
  test_files: []