rghost 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/lib/rghost/ruby_ghost_config.rb +8 -8
- data/lib/rghost/ruby_to_ps.rb +19 -3
- metadata +30 -33
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MTA2ZGRmNDM2NTVhZmViYmJmNmM5M2IwM2I4ZTIzY2I2ODliYmE3NA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MTE1ZTk0YTkwZmM3YzBlYjY5YjFlMmJlOWQ3YTVjYTE2NzFlMGU4Mw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZGRkNzM3MDgzY2I0YzI5ODkzNTFkMTJlMmYwMjFmY2VhNDEyMmJkMmVkNGU0
|
10
|
+
MmVmMzA1MjA0NTM4ZTgzN2E4YjA5NzQ3Mjk3Y2YwNjcyYjMzYWM1ZTFmZTc4
|
11
|
+
NGFmZjBmYTM4OTNiNWZjOTZkNGZhZWI2Y2NmZmJhYmZhZmM4YTc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
Njk5NjE0NTVmODU0NzFlM2NlYmRlNmZiMmM4MDI4YmFlMjljNDBkMTFmNDYx
|
14
|
+
NDI5ZGU5NTNjYjExOTY3MDBjMjc2MGZjMjJkNjI1OGNlMTc3MmQzNzIyMWI0
|
15
|
+
ZWE2YzdlNzEwYTFkMmM0ODk5NDg2NDQyYjU0Zjc3ZDRhNGNiNzg=
|
@@ -84,14 +84,14 @@ module RGhost::Config
|
|
84
84
|
}
|
85
85
|
|
86
86
|
def self.config_platform #:nodoc:
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
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"
|
87
|
+
require 'rbconfig'
|
88
|
+
GS[:path]=case RbConfig::CONFIG['host_os']
|
89
|
+
when /linux/ then '/usr/bin/gs'
|
90
|
+
when /mac|darwin|freebsd|bsd/ then '/usr/local/bin/gs'
|
91
|
+
when /mswin|mingw/ then 'C:\\gs\\bin\\gswin32\\gswin32c.exe'
|
92
|
+
else ''
|
93
|
+
end
|
94
|
+
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"
|
95
95
|
raise not_found_msg unless (File.exists? GS[:path])
|
96
96
|
end
|
97
97
|
|
data/lib/rghost/ruby_to_ps.rb
CHANGED
@@ -1,6 +1,22 @@
|
|
1
1
|
#Converts Ruby types to Postscript types
|
2
2
|
module RGhost::RubyToPs
|
3
3
|
|
4
|
+
UTF8_ENCODINGS = {
|
5
|
+
'¡' => 0xA1, '¢' => 0xA2, '£' => 0xA3, '€' => 0xA4, '¥' => 0xA5, 'Š' => 0xA6, '§' => 0xA7,
|
6
|
+
'š' => 0xA8, '©' => 0xA9, 'ª' => 0xAA, '«' => 0xAB, '¬' => 0xAC, '®' => 0xAE, '¯' => 0xAF,
|
7
|
+
'°' => 0xB0, '±' => 0xB1, '²' => 0xB2, '³' => 0xB3, 'Ž' => 0xB4, 'µ' => 0xB5, '¶' => 0xB6,
|
8
|
+
'·' => 0xB7, 'ž' => 0xB8, '¹' => 0xB9, 'º' => 0xBA, '»' => 0xBB, 'Œ' => 0xBC, 'œ' => 0xBD,
|
9
|
+
'Ÿ' => 0xBE, '¿' => 0xBF, 'À' => 0xC0, 'Á' => 0xC1, 'Â' => 0xC2, 'Ã' => 0xC3, 'Ä' => 0xC4,
|
10
|
+
'Å' => 0xC5, 'Æ' => 0xC6, 'Ç' => 0xC7, 'È' => 0xC8, 'É' => 0xC9, 'Ê' => 0xCA, 'Ë' => 0xCB,
|
11
|
+
'Ì' => 0xCC, 'Í' => 0xCD, 'Î' => 0xCE, 'Ï' => 0xCF, 'Ð' => 0xD0, 'Ñ' => 0xD1, 'Ò' => 0xD2,
|
12
|
+
'Ó' => 0xD3, 'Ô' => 0xD4, 'Õ' => 0xD5, 'Ö' => 0xD6, '×' => 0xD7, 'Ø' => 0xD8, 'Ù' => 0xD9,
|
13
|
+
'Ú' => 0xDA, 'Û' => 0xDB, 'Ü' => 0xDC, 'Ý' => 0xDD, 'Þ' => 0xDE, 'ß' => 0xDF, 'à' => 0xE0,
|
14
|
+
'á' => 0xE1, 'â' => 0xE2, 'ã' => 0xE3, 'ä' => 0xE4, 'å' => 0xE5, 'æ' => 0xE6, 'ç' => 0xE7,
|
15
|
+
'è' => 0xE8, 'é' => 0xE9, 'ê' => 0xEA, 'ë' => 0xEB, 'ì' => 0xEC, 'í' => 0xED, 'î' => 0xEE,
|
16
|
+
'ï' => 0xEF, 'ð' => 0xF0, 'ñ' => 0xF1, 'ò' => 0xF2, 'ó' => 0xF3, 'ô' => 0xF4, 'õ' => 0xF5,
|
17
|
+
'ö' => 0xF6, '÷' => 0xF7, 'ø' => 0xF8, 'ù' => 0xF9, 'ú' => 0xFA, 'û' => 0xFB, 'ü' => 0xFC,
|
18
|
+
'ý' => 0xFD, 'þ' => 0xFE, 'ÿ' => 0xFF }
|
19
|
+
|
4
20
|
|
5
21
|
def to_string(value)
|
6
22
|
#ps escape
|
@@ -8,7 +24,6 @@ module RGhost::RubyToPs
|
|
8
24
|
ps_str=ps_escape(value)
|
9
25
|
|
10
26
|
"(#{ps_str}) "
|
11
|
-
|
12
27
|
end
|
13
28
|
|
14
29
|
def pack_string(s)
|
@@ -21,8 +36,9 @@ module RGhost::RubyToPs
|
|
21
36
|
|
22
37
|
|
23
38
|
def ps_escape(value)
|
24
|
-
|
25
|
-
|
39
|
+
value.to_s.gsub(/(\(|\)|\\)/,'\\\\\1') .gsub(/./) do |char|
|
40
|
+
UTF8_ENCODINGS[char] ? "\\#{UTF8_ENCODINGS[char].to_s(8)}" : char
|
41
|
+
end
|
26
42
|
end
|
27
43
|
|
28
44
|
def to_bool(value)
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rghost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
5
|
-
prerelease:
|
4
|
+
version: 0.9.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Shairon Toledo
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-03-26 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Ruby Ghostscript Engine is a document creation and conversion API, support(PDF,PS,GIF,TIF,PNG,JPG...).
|
15
14
|
It uses the GhostScript framework for the format conversion, utilizes EPS templates
|
@@ -19,6 +18,7 @@ executables: []
|
|
19
18
|
extensions: []
|
20
19
|
extra_rdoc_files: []
|
21
20
|
files:
|
21
|
+
- lib/rghost.rb
|
22
22
|
- lib/rghost/border.rb
|
23
23
|
- lib/rghost/callback.rb
|
24
24
|
- lib/rghost/circle.rb
|
@@ -68,15 +68,9 @@ files:
|
|
68
68
|
- lib/rghost/point.rb
|
69
69
|
- lib/rghost/point_with_command.rb
|
70
70
|
- lib/rghost/polygon.rb
|
71
|
-
- lib/rghost/ps/_cusor.ps
|
72
71
|
- lib/rghost/ps/AdobeExpert.enc
|
73
72
|
- lib/rghost/ps/AdobeLatinEncoding.enc
|
74
|
-
- lib/rghost/ps/basic.ps
|
75
|
-
- lib/rghost/ps/begin_document.ps
|
76
73
|
- lib/rghost/ps/Bengali.enc
|
77
|
-
- lib/rghost/ps/callbacks.ps
|
78
|
-
- lib/rghost/ps/code128.font
|
79
|
-
- lib/rghost/ps/code39.font
|
80
74
|
- lib/rghost/ps/CodePage1250.enc
|
81
75
|
- lib/rghost/ps/CodePage1251.enc
|
82
76
|
- lib/rghost/ps/CodePage1252.enc
|
@@ -86,24 +80,42 @@ files:
|
|
86
80
|
- lib/rghost/ps/CodePage1257.enc
|
87
81
|
- lib/rghost/ps/CodePage1258.enc
|
88
82
|
- lib/rghost/ps/CodePage874.enc
|
83
|
+
- lib/rghost/ps/Fontmap
|
84
|
+
- lib/rghost/ps/IsoLatin.enc
|
85
|
+
- lib/rghost/ps/MacCentralEuropean.enc
|
86
|
+
- lib/rghost/ps/MacCyrillice.desnc
|
87
|
+
- lib/rghost/ps/MacGreek.enc
|
88
|
+
- lib/rghost/ps/MacHebrew.enc
|
89
|
+
- lib/rghost/ps/TeX-CorkEncoding.enc
|
90
|
+
- lib/rghost/ps/TeX-LGR-Greek.enc
|
91
|
+
- lib/rghost/ps/TeX-T2AModified2Encoding.enc
|
92
|
+
- lib/rghost/ps/TeX-T2BAdobeEncoding.enc
|
93
|
+
- lib/rghost/ps/TeX-T2CAdobeEncoding.enc
|
94
|
+
- lib/rghost/ps/TeX-X2AdobeEncoding.enc
|
95
|
+
- lib/rghost/ps/TeX-XL2encoding.enc
|
96
|
+
- lib/rghost/ps/TeXMathExtensionEncoding.enc
|
97
|
+
- lib/rghost/ps/TeXMathItalicEncoding.enc
|
98
|
+
- lib/rghost/ps/TeXMathSymbolEncoding.enc
|
99
|
+
- lib/rghost/ps/US-ASCII.enc
|
100
|
+
- lib/rghost/ps/UTF-8.enc
|
101
|
+
- lib/rghost/ps/_cusor.ps
|
102
|
+
- lib/rghost/ps/basic.ps
|
103
|
+
- lib/rghost/ps/begin_document.ps
|
104
|
+
- lib/rghost/ps/callbacks.ps
|
105
|
+
- lib/rghost/ps/code128.font
|
106
|
+
- lib/rghost/ps/code39.font
|
89
107
|
- lib/rghost/ps/cursor.ps
|
90
108
|
- lib/rghost/ps/datagrid.ps
|
91
109
|
- lib/rghost/ps/developer.ps
|
92
110
|
- lib/rghost/ps/ean.font
|
93
111
|
- lib/rghost/ps/eps.ps
|
94
112
|
- lib/rghost/ps/font.ps
|
95
|
-
- lib/rghost/ps/Fontmap
|
96
113
|
- lib/rghost/ps/frame.ps
|
97
114
|
- lib/rghost/ps/gif.ps
|
98
115
|
- lib/rghost/ps/horizontal_line.ps
|
99
116
|
- lib/rghost/ps/i25.font
|
100
|
-
- lib/rghost/ps/IsoLatin.enc
|
101
117
|
- lib/rghost/ps/jpeg.ps
|
102
118
|
- lib/rghost/ps/link.ps
|
103
|
-
- lib/rghost/ps/MacCentralEuropean.enc
|
104
|
-
- lib/rghost/ps/MacCyrillice.desnc
|
105
|
-
- lib/rghost/ps/MacGreek.enc
|
106
|
-
- lib/rghost/ps/MacHebrew.enc
|
107
119
|
- lib/rghost/ps/paper.ps
|
108
120
|
- lib/rghost/ps/rect_link.ps
|
109
121
|
- lib/rghost/ps/rectangle.ps
|
@@ -111,22 +123,10 @@ files:
|
|
111
123
|
- lib/rghost/ps/row.ps
|
112
124
|
- lib/rghost/ps/show.ps
|
113
125
|
- lib/rghost/ps/table_callbacks.ps
|
114
|
-
- lib/rghost/ps/TeX-CorkEncoding.enc
|
115
|
-
- lib/rghost/ps/TeX-LGR-Greek.enc
|
116
|
-
- lib/rghost/ps/TeX-T2AModified2Encoding.enc
|
117
|
-
- lib/rghost/ps/TeX-T2BAdobeEncoding.enc
|
118
|
-
- lib/rghost/ps/TeX-T2CAdobeEncoding.enc
|
119
|
-
- lib/rghost/ps/TeX-X2AdobeEncoding.enc
|
120
|
-
- lib/rghost/ps/TeX-XL2encoding.enc
|
121
|
-
- lib/rghost/ps/TeXMathExtensionEncoding.enc
|
122
|
-
- lib/rghost/ps/TeXMathItalicEncoding.enc
|
123
|
-
- lib/rghost/ps/TeXMathSymbolEncoding.enc
|
124
126
|
- lib/rghost/ps/text.ps
|
125
127
|
- lib/rghost/ps/textarea.ps
|
126
128
|
- lib/rghost/ps/type.ps
|
127
129
|
- lib/rghost/ps/unit.ps
|
128
|
-
- lib/rghost/ps/US-ASCII.enc
|
129
|
-
- lib/rghost/ps/UTF-8.enc
|
130
130
|
- lib/rghost/ps/vertical_line.ps
|
131
131
|
- lib/rghost/ps/virtual_pages.ps
|
132
132
|
- lib/rghost/ps_facade.rb
|
@@ -148,21 +148,19 @@ files:
|
|
148
148
|
- lib/rghost/variable.rb
|
149
149
|
- lib/rghost/vertical_line.rb
|
150
150
|
- lib/rghost/virtual_pages.rb
|
151
|
-
- lib/rghost.rb
|
152
151
|
homepage: http://rghost.rubyforge.org
|
153
152
|
licenses: []
|
153
|
+
metadata: {}
|
154
154
|
post_install_message:
|
155
155
|
rdoc_options: []
|
156
156
|
require_paths:
|
157
157
|
- lib
|
158
158
|
required_ruby_version: !ruby/object:Gem::Requirement
|
159
|
-
none: false
|
160
159
|
requirements:
|
161
160
|
- - ! '>='
|
162
161
|
- !ruby/object:Gem::Version
|
163
162
|
version: '0'
|
164
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
-
none: false
|
166
164
|
requirements:
|
167
165
|
- - ! '>='
|
168
166
|
- !ruby/object:Gem::Version
|
@@ -171,9 +169,8 @@ requirements: []
|
|
171
169
|
rubyforge_project: Ruby Ghostscript Engine is a document creation and conversion API,
|
172
170
|
support(PDF,PS,GIF,TIF,PNG,JPG...). It uses the GhostScript framework for the format
|
173
171
|
conversion, utilizes EPS templates and is optimized to work with larger documents.
|
174
|
-
rubygems_version:
|
172
|
+
rubygems_version: 2.2.2
|
175
173
|
signing_key:
|
176
|
-
specification_version:
|
174
|
+
specification_version: 4
|
177
175
|
summary: Ruby Ghostscript Engine is a document creation and conversion API, support(PDF,PS,GIF,TIF,PNG,JPG...).
|
178
176
|
test_files: []
|
179
|
-
has_rdoc:
|