victor 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -3
- data/lib/victor/attributes.rb +1 -0
- data/lib/victor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3cdae62bfe9bdf04869f383eef7038fe861d35a
|
4
|
+
data.tar.gz: ed07aa80408c354b15375e1ba63895278b1de630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66282482e34d83d87407df196c2fafd5cd8d117e3fa3f719f6454edb3ad6edf098790cfed7cbc8fa6a06be6d06e6ed1ff826a2d8d5ffc1ddede6a9470601775f
|
7
|
+
data.tar.gz: 29eb27242933106499bf0a585ba1e7da56a8f6bb8b7e049160b6be3df83bdb176681d62b33c37f8d5f7dbadd0735e214f1e2bac1340d19d7b194ae9cb65f8ebf
|
data/README.md
CHANGED
@@ -93,6 +93,13 @@ svg.rect x: 2, y: 2, width: 200, height: 200
|
|
93
93
|
# => <rect x="2" y="2" width="200" height="200"/>
|
94
94
|
```
|
95
95
|
|
96
|
+
In other words, these are the same:
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
svg.element :anything, option: 'value'
|
100
|
+
svg.anything option: 'value'
|
101
|
+
```
|
102
|
+
|
96
103
|
You can use the `build` method, to generate the SVG with a block
|
97
104
|
|
98
105
|
```ruby
|
@@ -114,11 +121,10 @@ If the value of an attribute is an array, it will be converted to a
|
|
114
121
|
space delimited string:
|
115
122
|
|
116
123
|
```ruby
|
117
|
-
svg.path ['M', 150, 0, 'L', 75, 200, 'L', 225, 200, 'Z']
|
118
|
-
# => <
|
124
|
+
svg.path d: ['M', 150, 0, 'L', 75, 200, 'L', 225, 200, 'Z']
|
125
|
+
# => <path d="M 159 9 L 75 200 L 225 200 Z"/>
|
119
126
|
```
|
120
127
|
|
121
|
-
|
122
128
|
For SVG elements that have an inner content - such as text - simply pass it as
|
123
129
|
the first argument:
|
124
130
|
|
@@ -127,6 +133,19 @@ svg.text "Victor", x: 40, y: 50
|
|
127
133
|
# => <text x="40" y="50">Victor</text>
|
128
134
|
```
|
129
135
|
|
136
|
+
You can also nest elements with blocks:
|
137
|
+
|
138
|
+
```ruby
|
139
|
+
svg.build do
|
140
|
+
g font_size: 30, font_family: 'arial', fill: 'white' do
|
141
|
+
text "Scalable Victor Graphics", x: 40, y: 50
|
142
|
+
end
|
143
|
+
end
|
144
|
+
# => <g font-size="30" font-family="arial" fill="white">
|
145
|
+
# <text x="40" y="50">Scalable Victor Graphics</text>
|
146
|
+
# </g>
|
147
|
+
```
|
148
|
+
|
130
149
|
Underscores in attribute names are converted to dashes:
|
131
150
|
|
132
151
|
```ruby
|
data/lib/victor/attributes.rb
CHANGED
data/lib/victor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: victor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: runfile
|