rghost 0.9.7 → 0.9.8
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/rghost/gs_alone.rb +2 -2
- data/lib/rghost/ruby_ghost_config.rb +1 -1
- data/lib/rghost/ruby_ghost_engine.rb +6 -6
- data/lib/rghost/ruby_ghost_version.rb +2 -2
- data/lib/rghost.rb +1 -2
- metadata +6 -7
- data/lib/rghost/merge_pdfs.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19399799fab0577cd7192fd7c08c030acc1cbce6a237d81158555b1bc71b3a8a
|
4
|
+
data.tar.gz: a8e7c939a8f5cd63d5a62096711bc4d947ec6deea1d9d0d6d4275d75f08ee0e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '092afe79c88d1a74538ed47f4894297f153ed45ad9f90c2f744776cab6c717bd30d69cbf7eb94e41122becd93d495f74fb06d78a7bbcc2a606aba014d41f4490'
|
7
|
+
data.tar.gz: 851f4c27ac2cc91577d7bda43ceea0af49524f0dfb8941db3d6d97a27d9558c03c00db8cf5c4f7bed528939415e7353f95a3e5b425b3ea3012d160f18c1fcf8b
|
data/lib/rghost/gs_alone.rb
CHANGED
@@ -8,8 +8,8 @@ class RGhost::GSAlone #:nodoc:
|
|
8
8
|
|
9
9
|
def run
|
10
10
|
cmd=@params.join(" ")
|
11
|
-
#puts File.
|
12
|
-
unless File.
|
11
|
+
#puts File.exist?(RGhost::Config::GS[:path].to_s)
|
12
|
+
unless File.exist?(RGhost::Config::GS[:path].to_s)
|
13
13
|
RGhost::Config.config_platform
|
14
14
|
end
|
15
15
|
r=system(RGhost::Config::GS[:path]+cmd)
|
@@ -85,7 +85,7 @@ module RGhost::Config
|
|
85
85
|
else ''
|
86
86
|
end
|
87
87
|
not_found_msg="\nGhostscript not found in your system environment (#{RbConfig::CONFIG['host_os']}).\nInstall it and set the variable RGhost::Config::GS[:path] with the executable.\nExample: RGhost::Config::GS[:path]='/path/to/my/gs' #unix-style\n RGhost::Config::GS[:path]=\"C:\\\\gs\\\\bin\\\\gswin32c.exe\" #windows-style\n"
|
88
|
-
raise not_found_msg unless (File.
|
88
|
+
raise not_found_msg unless (File.exist? GS[:path])
|
89
89
|
end
|
90
90
|
|
91
91
|
#Test if your environment is ready to works. If yes the page below will show.
|
@@ -52,9 +52,11 @@ 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
|
+
|
55
57
|
case @document
|
56
58
|
when RGhost::Document
|
57
|
-
file_in
|
59
|
+
file_in="#{tmp_filename}.rgin"
|
58
60
|
params.concat @document.gs_paper
|
59
61
|
mode=external_encoding.nil? ? 'w' : "w:#{external_encoding}"
|
60
62
|
fi=File.open(file_in,mode)
|
@@ -64,14 +66,12 @@ class RGhost::Engine
|
|
64
66
|
file_in=@document.path
|
65
67
|
#@delete_input=false unless @options[:debug]
|
66
68
|
when String
|
67
|
-
file_in
|
68
|
-
when Array
|
69
|
-
file_in = @document.map{|d| shellescape(d) }.join(' ')
|
69
|
+
file_in=@document
|
70
70
|
else
|
71
71
|
raise RuntimeError.new("Cannot convert #{@document.class}. Supported classes are RGhost::Document or File or String.")
|
72
72
|
end
|
73
73
|
|
74
|
-
params << file_in
|
74
|
+
params << shellescape(file_in)
|
75
75
|
|
76
76
|
if RGhost::Config::GS[:mode] == :gslib
|
77
77
|
require "rghost/rgengine"
|
@@ -84,7 +84,7 @@ class RGhost::Engine
|
|
84
84
|
end
|
85
85
|
|
86
86
|
if @error # if error
|
87
|
-
@errors=File.open(file_err).readlines if File.
|
87
|
+
@errors=File.open(file_err).readlines if File.exist?(file_err)
|
88
88
|
raise RGhost::RenderException.new(@errors.join(" ")) if RGhost::Config::GS[:raise_on_error]
|
89
89
|
else
|
90
90
|
if multipage
|
data/lib/rghost.rb
CHANGED
@@ -12,8 +12,7 @@ require 'rghost/variable'
|
|
12
12
|
require 'rghost/ps_facade'
|
13
13
|
require 'rghost/function'
|
14
14
|
require 'rghost/document'
|
15
|
-
require 'rghost/
|
16
|
-
require 'rghost/grid/grid'
|
15
|
+
require 'rghost/grid/grid'
|
17
16
|
RGhost::Config::GS[:PATH]="/opt/local/bin/gs"
|
18
17
|
|
19
18
|
|
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.
|
4
|
+
version: 0.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shairon Toledo
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-24 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,7 +61,6 @@ 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
|
65
64
|
- lib/rghost/newpath.rb
|
66
65
|
- lib/rghost/paper.rb
|
67
66
|
- lib/rghost/parse_text.rb
|
@@ -152,7 +151,7 @@ files:
|
|
152
151
|
homepage: http://rghost.rubyforge.org
|
153
152
|
licenses: []
|
154
153
|
metadata: {}
|
155
|
-
post_install_message:
|
154
|
+
post_install_message:
|
156
155
|
rdoc_options: []
|
157
156
|
require_paths:
|
158
157
|
- lib
|
@@ -167,8 +166,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
166
|
- !ruby/object:Gem::Version
|
168
167
|
version: '0'
|
169
168
|
requirements: []
|
170
|
-
rubygems_version: 3.
|
171
|
-
signing_key:
|
169
|
+
rubygems_version: 3.2.32
|
170
|
+
signing_key:
|
172
171
|
specification_version: 4
|
173
172
|
summary: Ruby Ghostscript Engine is a document creation and conversion API, support(PDF,PS,GIF,TIF,PNG,JPG...).
|
174
173
|
test_files: []
|
data/lib/rghost/merge_pdfs.rb
DELETED
@@ -1,12 +0,0 @@
|
|
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
|