vector_salad 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c19abeb6529dc9c3691a7d08929a8879e705ba82
|
4
|
+
data.tar.gz: b93177705c7c72d207e88a2926c38d4469ec980b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26b02e5bccd1ad7c2448be7a03d45af411b55ab2daebc2f0d04a74ef562ef08e65bbed810ee226236f665a1a7666158da0fdd190dad43719ffbaec08a12a38c3
|
7
|
+
data.tar.gz: 224900caa3d11e831fb2ac4c437ca58be07edd8cb9e0413078ebf68196293a2649d41cde525bc655852fab5423b8663b4ee1d384995f39e250c4991e19b8cbe2
|
data/lib/vector_salad/dsl.rb
CHANGED
@@ -76,6 +76,12 @@ module VectorSalad
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
+
class BasicShape
|
80
|
+
def to_svg
|
81
|
+
to_path.to_svg
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
79
85
|
class MultiPath
|
80
86
|
def to_svg
|
81
87
|
svg = '<path d="'
|
@@ -124,51 +130,3 @@ module VectorSalad
|
|
124
130
|
end
|
125
131
|
end
|
126
132
|
end
|
127
|
-
|
128
|
-
#include VectorSalad::StandardShapes
|
129
|
-
#p = Path.new([0,0], [50,0], [50,50])
|
130
|
-
#puts p.to_svg
|
131
|
-
|
132
|
-
#p1 = Path.new(
|
133
|
-
#N.n(0,100),
|
134
|
-
#N.q(100,0),
|
135
|
-
#N.n(200,100),
|
136
|
-
#N.q(300,200),
|
137
|
-
#N.n(400,100),
|
138
|
-
#N.n(400,200),
|
139
|
-
#N.n(0,200)
|
140
|
-
#)
|
141
|
-
#puts p1.to_svg
|
142
|
-
|
143
|
-
#p2 = Path.new(
|
144
|
-
#N.n(0,100),
|
145
|
-
#N.c(50,150),
|
146
|
-
#N.c(250,150),
|
147
|
-
#N.n(300,100),
|
148
|
-
#N.n(300,50),
|
149
|
-
#N.c(300,0),
|
150
|
-
#N.c(200,50),
|
151
|
-
#N.n(100,50),
|
152
|
-
#N.c(50,0),
|
153
|
-
#N.c(0,0),
|
154
|
-
#N.n(0,50)
|
155
|
-
#)
|
156
|
-
#puts p2.to_svg
|
157
|
-
|
158
|
-
#p3 = Path.new(
|
159
|
-
#N.n(0,200),
|
160
|
-
#N.c(50,000),
|
161
|
-
#N.c(300,100),
|
162
|
-
#N.n(400,150),
|
163
|
-
#N.q(200,500),
|
164
|
-
#N.n(50,300)
|
165
|
-
#)
|
166
|
-
#puts p3.to_svg
|
167
|
-
|
168
|
-
#puts p4.to_svg
|
169
|
-
|
170
|
-
#sq = Square.new(100, at: [50,50])
|
171
|
-
#puts sq.to_path.to_svg
|
172
|
-
|
173
|
-
#ci = Circle.new(100, at: [200,200])
|
174
|
-
#puts ci.to_path.to_svg
|
@@ -7,7 +7,6 @@ module VectorSalad
|
|
7
7
|
module StandardShapes
|
8
8
|
class Custom < BasicShape
|
9
9
|
def initialize(name, **options, &block)
|
10
|
-
#instance_eval(&block)
|
11
10
|
::VectorSalad::StandardShapes.const_set(name.to_s.capitalize.to_sym, Class.new(BasicShape) do
|
12
11
|
include VectorSalad::DSL
|
13
12
|
include VectorSalad::StandardShapes
|
data/lib/vector_salad/version.rb
CHANGED