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: 5a95e6398e5e03c544ee99ff3fb4bd8aeeb9b3f9
4
- data.tar.gz: 5bc093448d7a895e055f895c8765b4b39be682d5
3
+ metadata.gz: c19abeb6529dc9c3691a7d08929a8879e705ba82
4
+ data.tar.gz: b93177705c7c72d207e88a2926c38d4469ec980b
5
5
  SHA512:
6
- metadata.gz: ae68013751653ed932d1dbeb4c5492a12e07b08c595259dabe68191077556b3a9aeadc3f31fe18960a237b4f6e1f6bd16c025a123ce7a6fd9445f2833f7cd407
7
- data.tar.gz: 656a102fc6dda3ec3a18c4816f6611a4ccef150068dc0078acf366c2cd2ab986c3a7e09973472db29f3307ff03a006b614dfbd143759ed36f54356d8f26f4ae5
6
+ metadata.gz: 26b02e5bccd1ad7c2448be7a03d45af411b55ab2daebc2f0d04a74ef562ef08e65bbed810ee226236f665a1a7666158da0fdd190dad43719ffbaec08a12a38c3
7
+ data.tar.gz: 224900caa3d11e831fb2ac4c437ca58be07edd8cb9e0413078ebf68196293a2649d41cde525bc655852fab5423b8663b4ee1d384995f39e250c4991e19b8cbe2
@@ -33,7 +33,7 @@ module VectorSalad
33
33
 
34
34
  canvas << shape_proxy
35
35
  shape_proxy
36
- rescue LoadError # no shape available
36
+ rescue NameError # no shape available
37
37
  super
38
38
  end
39
39
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module VectorSalad
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vector_salad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon George