ascii_to_svg 0.1.2 → 0.1.3
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 +4 -4
- data/README.md +21 -23
- data/ascii_to_svg-0.1.2.gem +0 -0
- data/lib/ascii_to_svg.rb +8 -1
- data/lib/ascii_to_svg/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59147262422241f699345ffd08445d66f8d0e09009e0a30f51146072bf6a9b24
|
4
|
+
data.tar.gz: 7aa553a522b3855dd8b5d5fd4724abe9029e224f0393a40e7ea505597bfd3c92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d945f419cc14bfce3fe245104da1892b9907b43441d07165f1e660a02b210084b9cc546e84858c2eb33305d32b83799a4684d94b2a34c7681057ef3d14795e8
|
7
|
+
data.tar.gz: 8f20193e4835419a1b511edd8aa23ce9fce2329d3e094dd1d732e287ce7a32d62ec67080a162f3aadd7cb5a2a18514b24d9149acf29df503cbc61a50b676f65c
|
data/README.md
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
<img src="https://github.com/a6b8/a6b8/blob/main/docs/ascii-to-svg-for-ruby/readme/ascii-to-svg-generator-headline.png" height="70" /><br>
|
2
|
+
**Ascii to Svg Generator for Ruby**
|
3
|
+
|
4
|
+
This module generates beautiful svg images based on a input string.
|
3
5
|
|
4
6
|
## Examples
|
5
7
|
e
|
6
8
|
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/banners/0.svg">
|
7
9
|
|
8
10
|
```ruby
|
9
|
-
character_set = [ '-', '/', '|', "
|
11
|
+
character_set = [ '-', '/', '|', "\", '#' ]
|
10
12
|
```
|
11
13
|
|
12
14
|
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/banners/3.svg">
|
@@ -18,7 +20,7 @@ character_set = [ '-', '|', '#' ]
|
|
18
20
|
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/banners/4.svg">
|
19
21
|
|
20
22
|
```ruby
|
21
|
-
character_set = [ '-', '|', '#', 'o', '
|
23
|
+
character_set = [ '-', '|', '#', 'o', '\' ]
|
22
24
|
```
|
23
25
|
|
24
26
|
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/banners/6.svg">
|
@@ -34,7 +36,7 @@ options = {
|
|
34
36
|
<img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/banners/7.svg">
|
35
37
|
|
36
38
|
```ruby
|
37
|
-
character_set = [ '/', '
|
39
|
+
character_set = [ '/', '\' ]
|
38
40
|
options = {
|
39
41
|
style__line__stroke__color: 'brown',
|
40
42
|
style__ellipse__stroke__color: 'orange'
|
@@ -68,7 +70,7 @@ options = {
|
|
68
70
|
require 'ascii_to_svg'
|
69
71
|
|
70
72
|
# Generate Example String
|
71
|
-
ascii = AsciiToSvg.example_string( ['x', 'o'], 256 )
|
73
|
+
ascii = AsciiToSvg.example_string( [ 'x', 'o' ], 256 )
|
72
74
|
|
73
75
|
# Generate SVG
|
74
76
|
svg = AsciiToSvg.from_string( ascii, 16, {} )
|
@@ -93,7 +95,7 @@ options = {
|
|
93
95
|
|
94
96
|
```ruby
|
95
97
|
one = AsciiToSvg.example_string()
|
96
|
-
two = AsciiToSvg.example_string( ['x', 'o' ], 512 )
|
98
|
+
two = AsciiToSvg.example_string( [ 'x', 'o' ], 512 )
|
97
99
|
```
|
98
100
|
|
99
101
|
### AsciiToSvg.from_string()
|
@@ -117,10 +119,10 @@ options = {
|
|
117
119
|
### AsciiToSvg.similar_svg()
|
118
120
|
|
119
121
|
```ruby
|
120
|
-
original_str = AsciiToSvg.example_string( ['x', 'o'], 256 )
|
122
|
+
original_str = AsciiToSvg.example_string( [ 'x', 'o' ], 256 )
|
121
123
|
original_svg = AsciiToSvg.from_string( original_str, 16, {} )
|
122
124
|
|
123
|
-
copy_str = original_str[ 0, original_str.length-1 ]
|
125
|
+
copy_str = original_str[ 0, original_str.length - 1 ]
|
124
126
|
copy_svg = AsciiToSvg.from_string( copy_str, 16, {} )
|
125
127
|
|
126
128
|
AsciiToSvg.similar_svg( original_svg, copy_svg )
|
@@ -147,10 +149,6 @@ Canvas
|
|
147
149
|
| | ------------------------
|
148
150
|
```
|
149
151
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
152
|
## Signs
|
155
153
|
|
156
154
|
| Nr | Sign | Image | SVG Element |
|
@@ -191,14 +189,14 @@ Defines the Area of one symbol including offset.
|
|
191
189
|
Defines which `char` will be interpreted as "`svg element`"
|
192
190
|
| Nr | Name | Key | Default | Type | Image |
|
193
191
|
| :-- | :-- | :-- | :-- | :-- | :-- |
|
194
|
-
| C.1. | \ |:
|
195
|
-
| C.2. | / | :
|
196
|
-
| C.3. | X | :
|
197
|
-
| C.4. | - | :
|
198
|
-
| C.5. | \| | :
|
199
|
-
| C.6. | O | :
|
200
|
-
| C.7. | + | :
|
201
|
-
| C.8. | # | :
|
192
|
+
| C.1. | \ |:"symbols__\\\\" | `[ "\\" ]` | Array | <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/symbols/3-tl-br.svg"> |
|
193
|
+
| C.2. | / | :"symbols__/" | `[ "/" ]` | Array | <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/symbols/1-tr-bl.svg"> |
|
194
|
+
| C.3. | X | :"symbols__X" | `[ "X", "x" ]` | Array | <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/symbols/7-x.svg"> |
|
195
|
+
| C.4. | - | :"symbols__-" | `[ "-" ]` | Array | <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/symbols/0-minus.svg"> |
|
196
|
+
| C.5. | \| | :"symbols__\" | | `[ "\|", "1" ]` | Array | <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/symbols/2-vertical.svg"> |
|
197
|
+
| C.6. | O | :"symbols__O" | `[ "O", "o", "0" ]` | Array | <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/symbols/8-ellipse.svg"> |
|
198
|
+
| C.7. | + | :"symbols__+" | `[ "+" ]` | Array | <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/symbols/4-plus.svg"> |
|
199
|
+
| C.8. | # | :"symbols__#" | `[ "#" ]` | Array | <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/ascii-to-svg-for-ruby/readme/symbols/5-rectangle.svg"> |
|
202
200
|
|
203
201
|
|
204
202
|
### Style
|
@@ -236,7 +234,7 @@ Defines all Style Attributes. Styles can only changed by type of the svg element
|
|
236
234
|
|
237
235
|
## Contributing
|
238
236
|
|
239
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
237
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/a6b8/ascii_to_svg. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/a6b8/ascii_to_svg/blob/master/CODE_OF_CONDUCT.md).
|
240
238
|
|
241
239
|
## License
|
242
240
|
|
@@ -244,4 +242,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
244
242
|
|
245
243
|
## Code of Conduct
|
246
244
|
|
247
|
-
Everyone interacting in the AsciiToSvg project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
245
|
+
Everyone interacting in the AsciiToSvg project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/a6b8/ascii_to_svg/blob/master/CODE_OF_CONDUCT.md).
|
Binary file
|
data/lib/ascii_to_svg.rb
CHANGED
@@ -174,7 +174,14 @@ module AsciiToSvg
|
|
174
174
|
:canvas__margin__bottom,
|
175
175
|
:cell__x__offset,
|
176
176
|
:cell__y__offset,
|
177
|
-
:
|
177
|
+
:"symbols__\\",
|
178
|
+
:"symbols__/",
|
179
|
+
:"symbols__X",
|
180
|
+
:"symbols__-",
|
181
|
+
:"symbols__|",
|
182
|
+
:"symbols__O",
|
183
|
+
:"symbols__+",
|
184
|
+
:"symbols__#",
|
178
185
|
:style__line__stroke__width,
|
179
186
|
:style__line__stroke__color,
|
180
187
|
:style__line__stroke__opacity,
|
data/lib/ascii_to_svg/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ascii_to_svg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- a6b8
|
@@ -27,6 +27,7 @@ files:
|
|
27
27
|
- Rakefile
|
28
28
|
- ascii_to_svg-0.1.0.gem
|
29
29
|
- ascii_to_svg-0.1.1.gem
|
30
|
+
- ascii_to_svg-0.1.2.gem
|
30
31
|
- ascii_to_svg.gemspec
|
31
32
|
- bin/console
|
32
33
|
- bin/setup
|