rghost 0.9.7 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- 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.rb +0 -2
- metadata +12 -13
- data/lib/rghost/merge_pdfs.rb +0 -12
- data/lib/rghost/ruby_ghost_version.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f987c8d8137c7bf5c3c25f99d784bf7eab043eafe6d75cc555be31d2d444dced
|
4
|
+
data.tar.gz: 578708ca6343315a510a939493b6d36db220eb126850baac4b28c25258288135
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fccef573211c6f2eef152fbac96afe99a92a510287b42017ad8fae07394c4c386595c8c70cc7e7f21301d01b5974aa44caac7b314fc9dabe30c6f6f7fe16766f
|
7
|
+
data.tar.gz: f1753e3fd389841b281f89cb1a03e67aba0e669709e9addbd0540c20d0b41398b1f8b0960e27417fb6cb9d4d6883fbca1e71f02f20d5bfd985ef7007fd0e3535
|
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
@@ -6,13 +6,11 @@ module RGhost
|
|
6
6
|
class RenderException < Exception; end
|
7
7
|
end
|
8
8
|
|
9
|
-
require 'rghost/ruby_ghost_version'
|
10
9
|
require 'rghost/ps_object'
|
11
10
|
require 'rghost/variable'
|
12
11
|
require 'rghost/ps_facade'
|
13
12
|
require 'rghost/function'
|
14
13
|
require 'rghost/document'
|
15
|
-
require 'rghost/merge_pdfs'
|
16
14
|
require 'rghost/grid/grid'
|
17
15
|
RGhost::Config::GS[:PATH]="/opt/local/bin/gs"
|
18
16
|
|
metadata
CHANGED
@@ -1,18 +1,18 @@
|
|
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.9
|
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: 2024-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Ruby Ghostscript Engine is a document creation and conversion API,
|
14
|
-
It uses the GhostScript framework for
|
15
|
-
and is optimized to work with larger documents.
|
13
|
+
description: Ruby Ghostscript Engine is a document creation and conversion API, supporting
|
14
|
+
PDF, PS, GIF, TIF, PNG, JPG… It uses the GhostScript framework for format conversion,
|
15
|
+
utilizes EPS templates, and is optimized to work with larger documents.
|
16
16
|
email: shairon.toledo@gmail.com
|
17
17
|
executables: []
|
18
18
|
extensions: []
|
@@ -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
|
@@ -135,7 +134,6 @@ files:
|
|
135
134
|
- lib/rghost/rectangle_link.rb
|
136
135
|
- lib/rghost/ruby_ghost_config.rb
|
137
136
|
- lib/rghost/ruby_ghost_engine.rb
|
138
|
-
- lib/rghost/ruby_ghost_version.rb
|
139
137
|
- lib/rghost/ruby_to_ps.rb
|
140
138
|
- lib/rghost/scale.rb
|
141
139
|
- lib/rghost/shape_content.rb
|
@@ -149,10 +147,10 @@ files:
|
|
149
147
|
- lib/rghost/variable.rb
|
150
148
|
- lib/rghost/vertical_line.rb
|
151
149
|
- lib/rghost/virtual_pages.rb
|
152
|
-
homepage:
|
150
|
+
homepage: https://github.com/shairontoledo/rghost
|
153
151
|
licenses: []
|
154
152
|
metadata: {}
|
155
|
-
post_install_message:
|
153
|
+
post_install_message:
|
156
154
|
rdoc_options: []
|
157
155
|
require_paths:
|
158
156
|
- lib
|
@@ -167,8 +165,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
165
|
- !ruby/object:Gem::Version
|
168
166
|
version: '0'
|
169
167
|
requirements: []
|
170
|
-
rubygems_version: 3.
|
171
|
-
signing_key:
|
168
|
+
rubygems_version: 3.2.32
|
169
|
+
signing_key:
|
172
170
|
specification_version: 4
|
173
|
-
summary: Ruby Ghostscript Engine is a document creation and conversion API,
|
171
|
+
summary: Ruby Ghostscript Engine is a document creation and conversion API, supporting
|
172
|
+
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
|