rghost 0.8.7.8 → 0.8.7.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rghost/border.rb +1 -1
- data/lib/rghost/color.rb +3 -6
- data/lib/rghost/dash.rb +0 -1
- data/lib/rghost/document.rb +2 -1
- data/lib/rghost/paper.rb +4 -3
- data/lib/rghost/ruby_ghost_config.rb +1 -2
- data/lib/rghost/ruby_ghost_engine.rb +1 -1
- metadata +5 -8
- data/lib/rghost/rgengine.so +0 -0
data/lib/rghost/border.rb
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
class RGhost::Border < RGhost::PsObject
|
25
25
|
|
26
26
|
DEFAULT_OPTIONS = {:color => '#49AAFA', :dash => false, :width => 0.5, :linejoin => 0, :linecap => 0 }
|
27
|
-
|
27
|
+
|
28
28
|
def initialize(options={})
|
29
29
|
super(""){}
|
30
30
|
@options = DEFAULT_OPTIONS.dup.merge(options)
|
data/lib/rghost/color.rb
CHANGED
@@ -93,7 +93,7 @@ class RGhost::RGB < RGhost::Color
|
|
93
93
|
end
|
94
94
|
def color_params
|
95
95
|
case @color
|
96
|
-
when Hash then [@color[:
|
96
|
+
when Hash then [@color[:r] || @color[:red], @color[:g] || @color[:green],@color[:b] || @color[:blue]]
|
97
97
|
when Array then @color
|
98
98
|
when String then hex_to_rgb(@color)
|
99
99
|
when NilClass then [0,0,1]
|
@@ -101,8 +101,6 @@ class RGhost::RGB < RGhost::Color
|
|
101
101
|
|
102
102
|
|
103
103
|
end
|
104
|
-
|
105
|
-
private
|
106
104
|
|
107
105
|
def hex_to_rgb(color="#FFFFFF")
|
108
106
|
|
@@ -126,10 +124,9 @@ class RGhost::CMYK < RGhost::Color
|
|
126
124
|
|
127
125
|
def ps
|
128
126
|
value=case @color
|
129
|
-
when Hash then [@color[:
|
127
|
+
when Hash then [@color[:c] || @color[:cyan],@color[:m] || @color[:magenta] ,@color[:y] || @color[:yellow], @color[:k] || @color[:black]]
|
130
128
|
when Array then @color
|
131
129
|
end
|
132
|
-
|
133
130
|
array_to_stack(value.map{|n| n > 1 ? n/100.0: n})+"setcmykcolor"
|
134
131
|
end
|
135
132
|
|
@@ -147,7 +144,7 @@ class RGhost::CMYKSpot < RGhost::Color
|
|
147
144
|
|
148
145
|
def ps
|
149
146
|
value=case @color
|
150
|
-
when Hash then [@color[:
|
147
|
+
when Hash then [@color[:c] || @color[:cyan],@color[:m] || @color[:magenta] ,@color[:y] || @color[:yellow], @color[:k] || @color[:black]]
|
151
148
|
when Array then @color
|
152
149
|
end
|
153
150
|
|
data/lib/rghost/dash.rb
CHANGED
data/lib/rghost/document.rb
CHANGED
@@ -35,7 +35,8 @@ require 'rghost/pdf_security'
|
|
35
35
|
#The Document class child of PsFacade is used to join postscript objects to generate output file.
|
36
36
|
|
37
37
|
class RGhost::Document < RGhost::PsFacade
|
38
|
-
|
38
|
+
|
39
|
+
attr_reader :head, :callbacks, :variables, :paper, :done, :defines, :additional_params, :body
|
39
40
|
include RGhost::DocumentCallbackFacade
|
40
41
|
include RGhost::RubyToPs
|
41
42
|
DISABLE_VIRTUAL_PAGE=RGhost::Variable.new(:has_vp?, false)
|
data/lib/rghost/paper.rb
CHANGED
@@ -21,7 +21,7 @@ class RGhost::Paper < RGhost::PsObject
|
|
21
21
|
:duplex => false,
|
22
22
|
:tumble => false
|
23
23
|
}
|
24
|
-
|
24
|
+
attr_reader :paper, :landscape
|
25
25
|
include RGhost::RubyToPs
|
26
26
|
#===Examples
|
27
27
|
#
|
@@ -54,6 +54,7 @@ class RGhost::Paper < RGhost::PsObject
|
|
54
54
|
def initialize(paper=:A4, options={})
|
55
55
|
|
56
56
|
@options=DEFAULT_OPTIONS.merge(options)
|
57
|
+
@landscape = @options[:landscape] || false
|
57
58
|
@paper=paper
|
58
59
|
end
|
59
60
|
|
@@ -127,10 +128,10 @@ class RGhost::Paper < RGhost::PsObject
|
|
127
128
|
when Symbol then
|
128
129
|
|
129
130
|
p=RGhost::Constants::Papers::STANDARD[@paper.to_s.downcase.to_sym]
|
130
|
-
p.reverse! if @
|
131
|
+
p.reverse! if @landscape
|
131
132
|
{:rg => "/pagesize #{to_array( p ) } def\n", :gs => p, :done => true}
|
132
133
|
when Array then
|
133
|
-
@paper.reverse! if @
|
134
|
+
@paper.reverse! if @landscape
|
134
135
|
{:rg => "/pagesize #{to_array( @paper.map{|v| to_pt(v) } ) } def\n", :gs => @paper, :done => false}
|
135
136
|
end
|
136
137
|
|
@@ -87,8 +87,7 @@ module RGhost::Config
|
|
87
87
|
const = "RUBY_"+const if RUBY_VERSION =~ /^1.9/
|
88
88
|
GS[:path]=case Object.const_get(const)
|
89
89
|
when /linux/ then "/usr/bin/gs"
|
90
|
-
when /darwin/ then "/
|
91
|
-
when /freebsd|bsd/ then "/usr/local/bin/gs"
|
90
|
+
when /darwin|freebsd|bsd/ then "/usr/local/bin/gs"
|
92
91
|
when /mswin/ then "C:\\gs\\bin\\gswin32\\gswin32c.exe"
|
93
92
|
end
|
94
93
|
not_found_msg="\nGhostscript not found in your environment.\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"
|
@@ -39,7 +39,7 @@ class RGhost::Engine
|
|
39
39
|
params << @document.additional_params.join(" ") unless @options[:convert]
|
40
40
|
params << "-I#{RGhost::Config::GS[:pslibdir]}"
|
41
41
|
params << "-dPDFSETTINGS=/#{@options[:quality]}" if (@options[:device] ==:pdf && @options[:quality])
|
42
|
-
params << "-I#{RGhost::Config::GS[:extensions].join(' -I')}"
|
42
|
+
params << "-I#{RGhost::Config::GS[:extensions].join(' -I')}" unless RGhost::Config::GS[:extensions].empty?
|
43
43
|
params << "-sDEVICE=#{device_for(device)}"
|
44
44
|
params.concat format_params(@options[:d],"-d") if @options[:d]
|
45
45
|
params.concat format_params(@options[:s],"-s") if @options[:s]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rghost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
9
|
- 7
|
10
|
-
-
|
11
|
-
version: 0.8.7.
|
10
|
+
- 9
|
11
|
+
version: 0.8.7.9
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Shairon Toledo
|
@@ -16,8 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-
|
20
|
-
default_executable:
|
19
|
+
date: 2012-10-08 00:00:00 Z
|
21
20
|
dependencies: []
|
22
21
|
|
23
22
|
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.
|
@@ -142,7 +141,6 @@ files:
|
|
142
141
|
- lib/rghost/ps_facade.rb
|
143
142
|
- lib/rghost/ps_object.rb
|
144
143
|
- lib/rghost/rectangle_link.rb
|
145
|
-
- lib/rghost/rgengine.so
|
146
144
|
- lib/rghost/ruby_ghost_config.rb
|
147
145
|
- lib/rghost/ruby_ghost_engine.rb
|
148
146
|
- lib/rghost/ruby_ghost_version.rb
|
@@ -160,7 +158,6 @@ files:
|
|
160
158
|
- lib/rghost/vertical_line.rb
|
161
159
|
- lib/rghost/virtual_pages.rb
|
162
160
|
- lib/rghost.rb
|
163
|
-
has_rdoc: true
|
164
161
|
homepage: http://rghost.rubyforge.org
|
165
162
|
licenses: []
|
166
163
|
|
@@ -190,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
187
|
requirements: []
|
191
188
|
|
192
189
|
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.
|
190
|
+
rubygems_version: 1.8.24
|
194
191
|
signing_key:
|
195
192
|
specification_version: 3
|
196
193
|
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.
|
data/lib/rghost/rgengine.so
DELETED
Binary file
|