rghost 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MmEwZTEzYmU1MzQxZmM0OTc0N2UxMzAwYWNjN2YyODgwZDVmOWE2Mw==
5
- data.tar.gz: !binary |-
6
- YTdiYWZkOTBhMjRjMmE2YjU0MTQ5N2YxODllMDk0ZjlhOGVmNDJkYQ==
2
+ SHA256:
3
+ metadata.gz: 4a13b5e2e99e0b48b7beec30296c2e578f23991bf3de4b2ac0cd87afe87fac10
4
+ data.tar.gz: 65db7916b2a0dc94383fdefbc8c6555fe40e0f38f4f983c8b8afd1d6c6497b50
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MWQyMTUxMWVlYmI3YjdmNDFmNjc3ZGVhNjBkMzUwYzNjM2MwMDQ1YzhiOTkz
10
- OTFmOWZiZGVlMDU4N2Q5NjFiOTA2NWViMGQ4NDM4Zjk4ZTk5ZDA4YmYwYjNk
11
- Y2JkNjBiOGUwYzc5MzY3ZTdkOTY2ZDRmODBhNmM2ZWIzODUxYzg=
12
- data.tar.gz: !binary |-
13
- NzY3YmNmMjkxODY4NTBmZGIyMzU2YjBkNTlhMzU4MGRiMWQzOTE0ZjcyZWFk
14
- OGU2YmFiMWE5OGQ5ZjIyMzU3YjVlMzY5ODA3ZmZiZjZkZmY5NmY0ZGZlMTUx
15
- MDFlMzE4MTUwOWY1Zjc0YzFjMDAzZGFkYWE5NjhhNTc2N2U5MzM=
6
+ metadata.gz: bb42950761acc59d41f8cfc6e0e65528c1ff020d1fc871283fe8300594495056b25241caf4200b2c22ff5144966a1ad1b0188efc913b7b5432be8ffddbaa9aa1
7
+ data.tar.gz: b6c37359954906b8486680fce4222c1ee3baeaac8349549c0b0d9e94dd52fc2c078d5b741538ffd68a3445906cd28543f066059222e3c2c3ffa5114a979c034f
@@ -12,7 +12,8 @@ require 'rghost/variable'
12
12
  require 'rghost/ps_facade'
13
13
  require 'rghost/function'
14
14
  require 'rghost/document'
15
- require 'rghost/grid/grid'
15
+ require 'rghost/merge_pdfs'
16
+ require 'rghost/grid/grid'
16
17
  RGhost::Config::GS[:PATH]="/opt/local/bin/gs"
17
18
 
18
19
 
@@ -0,0 +1,12 @@
1
+ class RGhost::MergePdfs
2
+ attr_reader :error, :errors
3
+ DEFAULT_OPTIONS = { :convert => true }
4
+
5
+ def self.merge(pdfs, options={})
6
+ rge = RGhost::Engine.new(pdfs,DEFAULT_OPTIONS.merge(options))
7
+ out = rge.render(:pdf)
8
+ @error = rge.error
9
+ @errors = rge.errors
10
+ out
11
+ end
12
+ end
@@ -52,11 +52,9 @@ class RGhost::Engine
52
52
  params << "-sstdout=#{shellescape(file_err)}"
53
53
  params << "-sOutputFile=#{shellescape(file_out)}"
54
54
  params << @options[:raw] if @options[:raw]
55
-
56
-
57
55
  case @document
58
56
  when RGhost::Document
59
- file_in="#{tmp_filename}.rgin"
57
+ file_in = shellescape("#{tmp_filename}.rgin")
60
58
  params.concat @document.gs_paper
61
59
  mode=external_encoding.nil? ? 'w' : "w:#{external_encoding}"
62
60
  fi=File.open(file_in,mode)
@@ -66,10 +64,14 @@ class RGhost::Engine
66
64
  file_in=@document.path
67
65
  #@delete_input=false unless @options[:debug]
68
66
  when String
69
- file_in=@document
67
+ file_in = shellescape(@document)
68
+ when Array
69
+ file_in = @document.map{|d| shellescape(d) }.join(' ')
70
+ else
71
+ raise RuntimeError.new("Cannot convert #{@document.class}. Supported classes are RGhost::Document or File or String.")
70
72
  end
71
73
 
72
- params << shellescape(file_in)
74
+ params << file_in
73
75
 
74
76
  if RGhost::Config::GS[:mode] == :gslib
75
77
  require "rghost/rgengine"
@@ -1,8 +1,8 @@
1
1
  module RGhost::VERSION #:nodoc:
2
2
  MAJOR = 0
3
- MINOR = 8
3
+ MINOR = 9
4
4
  TINY = 7
5
5
  DATE=1244286414
6
6
  STRING = [MAJOR, MINOR, TINY].join('.')
7
-
7
+
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rghost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shairon Toledo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-07 00:00:00.000000000 Z
11
+ date: 2019-09-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby Ghostscript Engine is a document creation and conversion API, support(PDF,PS,GIF,TIF,PNG,JPG...).
14
14
  It uses the GhostScript framework for the format conversion, utilizes EPS templates
@@ -61,6 +61,7 @@ files:
61
61
  - lib/rghost/line.rb
62
62
  - lib/rghost/line_width.rb
63
63
  - lib/rghost/load.rb
64
+ - lib/rghost/merge_pdfs.rb
64
65
  - lib/rghost/newpath.rb
65
66
  - lib/rghost/paper.rb
66
67
  - lib/rghost/parse_text.rb
@@ -157,19 +158,16 @@ require_paths:
157
158
  - lib
158
159
  required_ruby_version: !ruby/object:Gem::Requirement
159
160
  requirements:
160
- - - ! '>='
161
+ - - ">="
161
162
  - !ruby/object:Gem::Version
162
163
  version: '0'
163
164
  required_rubygems_version: !ruby/object:Gem::Requirement
164
165
  requirements:
165
- - - ! '>='
166
+ - - ">="
166
167
  - !ruby/object:Gem::Version
167
168
  version: '0'
168
169
  requirements: []
169
- rubyforge_project: Ruby Ghostscript Engine is a document creation and conversion API,
170
- support(PDF,PS,GIF,TIF,PNG,JPG...). It uses the GhostScript framework for the format
171
- conversion, utilizes EPS templates and is optimized to work with larger documents.
172
- rubygems_version: 2.2.2
170
+ rubygems_version: 3.0.4
173
171
  signing_key:
174
172
  specification_version: 4
175
173
  summary: Ruby Ghostscript Engine is a document creation and conversion API, support(PDF,PS,GIF,TIF,PNG,JPG...).