rghost 0.8.7.7 → 0.8.7.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rghost/ruby_ghost_engine.rb +20 -3
  2. metadata +44 -27
@@ -49,9 +49,9 @@ class RGhost::Engine
49
49
  params << "-dFirstPage=#{@options[:range].first}"
50
50
  params << "-dLastPage=#{@options[:range].last}"
51
51
  end
52
- params << "-sstdout=#{file_err}"
52
+ params << "-sstdout=#{shellescape(file_err)}"
53
53
  params << @options[:raw] if @options[:raw]
54
- params << "-sOutputFile=#{file_out}"
54
+ params << "-sOutputFile=#{shellescape(file_out)}"
55
55
 
56
56
 
57
57
  case @document
@@ -70,7 +70,7 @@ class RGhost::Engine
70
70
  #@delete_input=false unless @options[:debug]
71
71
  end
72
72
 
73
- params << file_in
73
+ params << shellescape(file_in)
74
74
 
75
75
  #puts params.inspect
76
76
 
@@ -153,5 +153,22 @@ class RGhost::Engine
153
153
  return r;
154
154
  end
155
155
 
156
+ def shellescape(str)
157
+ # An empty argument will be skipped, so return empty quotes.
158
+ return "''" if str.empty?
159
+
160
+ str = str.dup
161
+
162
+ # Process as a single byte sequence because not all shell
163
+ # implementations are multibyte aware.
164
+ str.gsub!(/([^A-Za-z0-9_\-.,:\/@\n])/n, "\\\\\\1")
165
+
166
+ # A LF cannot be escaped with a backslash because a backslash + LF
167
+ # combo is regarded as line continuation and simply ignored.
168
+ str.gsub!(/\n/, "'\n'")
169
+
170
+ return str
171
+ end
172
+
156
173
  end
157
174
 
metadata CHANGED
@@ -1,24 +1,34 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rghost
3
- version: !ruby/object:Gem::Version
4
- version: 0.8.7.7
3
+ version: !ruby/object:Gem::Version
4
+ hash: 3
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 8
9
+ - 7
10
+ - 8
11
+ version: 0.8.7.8
6
12
  platform: ruby
7
- authors:
13
+ authors:
8
14
  - Shairon Toledo
9
15
  autorequire:
10
16
  bindir: bin
11
17
  cert_chain: []
12
- date: 2012-04-19 00:00:00.000000000 Z
18
+
19
+ date: 2012-04-23 00:00:00 -03:00
20
+ default_executable:
13
21
  dependencies: []
14
- description: Ruby Ghostscript Engine is a document creation and conversion API, support(PDF,PS,GIF,TIF,PNG,JPG...).
15
- It uses the GhostScript framework for the format conversion, utilizes EPS templates
16
- and is optimized to work with larger documents.
22
+
23
+ description: Ruby Ghostscript Engine is a document creation and conversion API, support(PDF,PS,GIF,TIF,PNG,JPG...). It uses the GhostScript framework for the format conversion, utilizes EPS templates and is optimized to work with larger documents.
17
24
  email: shairon.toledo@gmail.com
18
25
  executables: []
26
+
19
27
  extensions: []
28
+
20
29
  extra_rdoc_files: []
21
- files:
30
+
31
+ files:
22
32
  - lib/rghost/border.rb
23
33
  - lib/rghost/callback.rb
24
34
  - lib/rghost/circle.rb
@@ -150,32 +160,39 @@ files:
150
160
  - lib/rghost/vertical_line.rb
151
161
  - lib/rghost/virtual_pages.rb
152
162
  - lib/rghost.rb
163
+ has_rdoc: true
153
164
  homepage: http://rghost.rubyforge.org
154
165
  licenses: []
166
+
155
167
  post_install_message:
156
168
  rdoc_options: []
157
- require_paths:
169
+
170
+ require_paths:
158
171
  - lib
159
- required_ruby_version: !ruby/object:Gem::Requirement
172
+ required_ruby_version: !ruby/object:Gem::Requirement
160
173
  none: false
161
- requirements:
162
- - - ! '>='
163
- - !ruby/object:Gem::Version
164
- version: '0'
165
- required_rubygems_version: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ hash: 3
178
+ segments:
179
+ - 0
180
+ version: "0"
181
+ required_rubygems_version: !ruby/object:Gem::Requirement
166
182
  none: false
167
- requirements:
168
- - - ! '>='
169
- - !ruby/object:Gem::Version
170
- version: '0'
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ hash: 3
187
+ segments:
188
+ - 0
189
+ version: "0"
171
190
  requirements: []
172
- rubyforge_project: Ruby Ghostscript Engine is a document creation and conversion API,
173
- support(PDF,PS,GIF,TIF,PNG,JPG...). It uses the GhostScript framework for the format
174
- conversion, utilizes EPS templates and is optimized to work with larger documents.
175
- rubygems_version: 1.8.17
191
+
192
+ rubyforge_project: Ruby Ghostscript Engine is a document creation and conversion API, support(PDF,PS,GIF,TIF,PNG,JPG...). It uses the GhostScript framework for the format conversion, utilizes EPS templates and is optimized to work with larger documents.
193
+ rubygems_version: 1.5.3
176
194
  signing_key:
177
195
  specification_version: 3
178
- summary: Ruby Ghostscript Engine is a document creation and conversion API, support(PDF,PS,GIF,TIF,PNG,JPG...).
179
- It uses the GhostScript framework for the format conversion, utilizes EPS templates
180
- and is optimized to work with larger documents.
196
+ summary: Ruby Ghostscript Engine is a document creation and conversion API, support(PDF,PS,GIF,TIF,PNG,JPG...). It uses the GhostScript framework for the format conversion, utilizes EPS templates and is optimized to work with larger documents.
181
197
  test_files: []
198
+