svg-to-eps 0.0.1
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 +7 -0
- data/.gitignore +4 -0
- data/Gemfile +7 -0
- data/bin/svg-to-eps +7 -0
- data/fixtures/test.svg +143 -0
- data/lib/svg-to-eps.rb +8 -0
- data/spec/svg-to-eps_spec.rb +24 -0
- data/svg-to-eps.gemspec +16 -0
- metadata +53 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5658c4850cef1be3c312034104bbd45f05942664
|
4
|
+
data.tar.gz: b722595075b0e292e49c5698eb7679c2635c1e57
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a9632dac27ec5f6ce93029364667663622575294ac119e8d8e946e446bcf79998d5b8d9ace753123d711e38fba24cc0786ae0d916f4821316ea09ad450e70779
|
7
|
+
data.tar.gz: 3d827edc62c48dbcfa484a0e9d9b1b6db8dce9567ad98bbb2f032293f207dfeff848968baad65888d38a7f1ca47bda31d125eca9b56992f327f041c5fc8d397b
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/bin/svg-to-eps
ADDED
data/fixtures/test.svg
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
3
|
+
|
4
|
+
<svg
|
5
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
6
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
7
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
8
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
10
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
11
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
12
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
13
|
+
width="210mm"
|
14
|
+
height="297mm"
|
15
|
+
id="svg2"
|
16
|
+
version="1.1"
|
17
|
+
inkscape:version="0.48.4 r9939"
|
18
|
+
sodipodi:docname="新規ドキュメント 1">
|
19
|
+
<defs
|
20
|
+
id="defs4">
|
21
|
+
<linearGradient
|
22
|
+
inkscape:collect="always"
|
23
|
+
id="linearGradient3779">
|
24
|
+
<stop
|
25
|
+
style="stop-color:#ff0000;stop-opacity:1;"
|
26
|
+
offset="0"
|
27
|
+
id="stop3781" />
|
28
|
+
<stop
|
29
|
+
style="stop-color:#ff0000;stop-opacity:0;"
|
30
|
+
offset="1"
|
31
|
+
id="stop3783" />
|
32
|
+
</linearGradient>
|
33
|
+
<linearGradient
|
34
|
+
inkscape:collect="always"
|
35
|
+
id="linearGradient3771">
|
36
|
+
<stop
|
37
|
+
style="stop-color:#0080f8;stop-opacity:1;"
|
38
|
+
offset="0"
|
39
|
+
id="stop3773" />
|
40
|
+
<stop
|
41
|
+
style="stop-color:#0080f8;stop-opacity:0;"
|
42
|
+
offset="1"
|
43
|
+
id="stop3775" />
|
44
|
+
</linearGradient>
|
45
|
+
<linearGradient
|
46
|
+
inkscape:collect="always"
|
47
|
+
xlink:href="#linearGradient3771"
|
48
|
+
id="linearGradient3777"
|
49
|
+
x1="505.71429"
|
50
|
+
y1="315.21932"
|
51
|
+
x2="662.85715"
|
52
|
+
y2="315.21932"
|
53
|
+
gradientUnits="userSpaceOnUse" />
|
54
|
+
<radialGradient
|
55
|
+
inkscape:collect="always"
|
56
|
+
xlink:href="#linearGradient3779"
|
57
|
+
id="radialGradient3785"
|
58
|
+
cx="132.85714"
|
59
|
+
cy="643.79074"
|
60
|
+
fx="132.85714"
|
61
|
+
fy="643.79074"
|
62
|
+
r="61.42857"
|
63
|
+
gradientTransform="matrix(1,0,0,4.2325583,0,-2081.0911)"
|
64
|
+
gradientUnits="userSpaceOnUse" />
|
65
|
+
</defs>
|
66
|
+
<sodipodi:namedview
|
67
|
+
id="base"
|
68
|
+
pagecolor="#ffffff"
|
69
|
+
bordercolor="#666666"
|
70
|
+
borderopacity="1.0"
|
71
|
+
inkscape:pageopacity="0.0"
|
72
|
+
inkscape:pageshadow="2"
|
73
|
+
inkscape:zoom="0.35"
|
74
|
+
inkscape:cx="-195"
|
75
|
+
inkscape:cy="540"
|
76
|
+
inkscape:document-units="px"
|
77
|
+
inkscape:current-layer="layer1"
|
78
|
+
showgrid="false"
|
79
|
+
inkscape:window-width="1920"
|
80
|
+
inkscape:window-height="1026"
|
81
|
+
inkscape:window-x="0"
|
82
|
+
inkscape:window-y="26"
|
83
|
+
inkscape:window-maximized="1" />
|
84
|
+
<metadata
|
85
|
+
id="metadata7">
|
86
|
+
<rdf:RDF>
|
87
|
+
<cc:Work
|
88
|
+
rdf:about="">
|
89
|
+
<dc:format>image/svg+xml</dc:format>
|
90
|
+
<dc:type
|
91
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
92
|
+
<dc:title></dc:title>
|
93
|
+
</cc:Work>
|
94
|
+
</rdf:RDF>
|
95
|
+
</metadata>
|
96
|
+
<g
|
97
|
+
inkscape:label="レイヤー 1"
|
98
|
+
inkscape:groupmode="layer"
|
99
|
+
id="layer1">
|
100
|
+
<path
|
101
|
+
sodipodi:type="arc"
|
102
|
+
style="color:#000000;fill:#2b2b2b;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.20000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
103
|
+
id="path2985"
|
104
|
+
sodipodi:cx="328.57144"
|
105
|
+
sodipodi:cy="383.79074"
|
106
|
+
sodipodi:rx="108.57143"
|
107
|
+
sodipodi:ry="145.71428"
|
108
|
+
d="m 437.14287,383.79074 a 108.57143,145.71428 0 1 1 -217.14285,0 108.57143,145.71428 0 1 1 217.14285,0 z" />
|
109
|
+
<rect
|
110
|
+
style="color:#000000;fill:#ff00ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.20000004999999987;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
111
|
+
id="rect2987"
|
112
|
+
width="331.42856"
|
113
|
+
height="197.14285"
|
114
|
+
x="82.85714"
|
115
|
+
y="103.79076" />
|
116
|
+
<path
|
117
|
+
sodipodi:type="spiral"
|
118
|
+
style="fill:#00ff00;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
119
|
+
id="path2989"
|
120
|
+
sodipodi:cx="420"
|
121
|
+
sodipodi:cy="738.07648"
|
122
|
+
sodipodi:expansion="1"
|
123
|
+
sodipodi:revolution="3"
|
124
|
+
sodipodi:radius="206.28888"
|
125
|
+
sodipodi:argument="-17.916721"
|
126
|
+
sodipodi:t0="0"
|
127
|
+
d="m 420,738.07648 c 6.15987,8.30864 -8.16083,12.40257 -13.80952,10.2381 -15.30759,-5.86557 -14.84107,-26.5192 -6.66669,-37.85714 14.62204,-20.2809 44.5024,-18.47355 61.90476,-3.09528 25.53866,22.56823 22.25444,62.74428 -0.47613,85.95238 -30.29627,30.93276 -81.07991,26.101 -110,-4.04754 -36.39299,-37.93885 -29.98203,-99.46069 7.61895,-134.04762 45.53982,-41.8894 117.86701,-33.88312 158.09524,11.19036 47.40758,53.11753 37.79681,136.28926 -14.76177,182.14287 -60.68095,52.9398 -154.72213,41.71889 -206.19048,-18.33318 -58.48162,-68.23499 -45.64687,-173.16248 21.90458,-230.23811 75.78253,-64.03024 191.60827,-49.57911 254.28574,25.476 69.58387,83.32538 53.51452,210.05813 -29.04741,278.33335" />
|
128
|
+
<rect
|
129
|
+
style="color:#000000;fill:url(#radialGradient3785);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.20000004999999987;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
130
|
+
id="rect2991"
|
131
|
+
width="122.85714"
|
132
|
+
height="520"
|
133
|
+
x="71.428574"
|
134
|
+
y="383.79074" />
|
135
|
+
<rect
|
136
|
+
style="color:#000000;fill:url(#linearGradient3777);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.20000004999999987;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
137
|
+
id="rect3769"
|
138
|
+
width="157.14285"
|
139
|
+
height="251.42857"
|
140
|
+
x="505.71429"
|
141
|
+
y="189.50504" />
|
142
|
+
</g>
|
143
|
+
</svg>
|
data/lib/svg-to-eps.rb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
|
2
|
+
# actual converter (just calls inkscape...)
|
3
|
+
class SVGtoEPS
|
4
|
+
def self.convert(input, output = nil)
|
5
|
+
output = input.to_s.gsub(/.svg/, '.eps') if output.nil?
|
6
|
+
system "inkscape --export-text-to-path --without-gui --file=#{input.to_s} --export-eps=#{output.to_s}"
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'svg-to-eps'
|
2
|
+
|
3
|
+
|
4
|
+
context 'usage as library' do
|
5
|
+
describe 'SVGtoEPS' do
|
6
|
+
let(:testfile) { './fixtures/test.svg' }
|
7
|
+
|
8
|
+
describe '.convert' do
|
9
|
+
it 'converts to a specified output file' do
|
10
|
+
@outfile = './fixtures/outtest.eps'
|
11
|
+
File.delete @outfile if File.exists? @outfile
|
12
|
+
SVGtoEPS.convert(testfile, @outfile)
|
13
|
+
expect(File).to exist(@outfile)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'automatically changes file name extension when not specified' do
|
17
|
+
@outfile = './fixtures/test.eps'
|
18
|
+
File.delete @outfile if File.exists? @outfile
|
19
|
+
SVGtoEPS.convert(testfile)
|
20
|
+
expect(File).to exist(@outfile)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/svg-to-eps.gemspec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'svg-to-eps'
|
3
|
+
s.version = '0.0.1'
|
4
|
+
s.license = 'GPL3'
|
5
|
+
s.summary = 'SVG to EPS converter (command line and lib)'
|
6
|
+
s.description = 'SVG to EPS converter. Requires inkscape! lib and command line tool are included.'
|
7
|
+
s.authors = ['Rei Kagetsuki']
|
8
|
+
s.email = 'zero@genshin.org'
|
9
|
+
s.homepage = 'http://www.github.com/Genshin/svg-to-eps'
|
10
|
+
|
11
|
+
s.files = `git ls-files`.split("\n")
|
12
|
+
s.require_path = 'lib'
|
13
|
+
s.executables = ['svg-to-eps']
|
14
|
+
|
15
|
+
s.requirements << 'inkscape'
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: svg-to-eps
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rei Kagetsuki
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-08-29 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: SVG to EPS converter. Requires inkscape! lib and command line tool are
|
14
|
+
included.
|
15
|
+
email: zero@genshin.org
|
16
|
+
executables:
|
17
|
+
- svg-to-eps
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- ".gitignore"
|
22
|
+
- Gemfile
|
23
|
+
- bin/svg-to-eps
|
24
|
+
- fixtures/test.svg
|
25
|
+
- lib/svg-to-eps.rb
|
26
|
+
- spec/svg-to-eps_spec.rb
|
27
|
+
- svg-to-eps.gemspec
|
28
|
+
homepage: http://www.github.com/Genshin/svg-to-eps
|
29
|
+
licenses:
|
30
|
+
- GPL3
|
31
|
+
metadata: {}
|
32
|
+
post_install_message:
|
33
|
+
rdoc_options: []
|
34
|
+
require_paths:
|
35
|
+
- lib
|
36
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
requirements:
|
47
|
+
- inkscape
|
48
|
+
rubyforge_project:
|
49
|
+
rubygems_version: 2.2.2
|
50
|
+
signing_key:
|
51
|
+
specification_version: 4
|
52
|
+
summary: SVG to EPS converter (command line and lib)
|
53
|
+
test_files: []
|