slascii 0.1.0 → 0.1.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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +57 -0
- data/lib/slascii/cli.rb +7 -1
- data/lib/slascii/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: e910a1abd27120f277f84cab84506cd3544ecf50
|
4
|
+
data.tar.gz: e7c9bd54f8361c8b9d3c664c8c7a69825390d5f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a893964bfb01db9aff12fe1555ba7b9c3628f6237f13c8b347babf48f59b2cc40c78a965f268feb10b2eb8eba5d46e41ca4593c3fd4351d795157e184e175de
|
7
|
+
data.tar.gz: 4c914cd0dffa1b33f71891affe1e2208061fc37d168220c46300d575725b13eb6be6c5360b286b20dd898ab621a496aadd9cc4d9668a07061361ba42811c74e5
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -52,6 +52,63 @@ oo33----++33333333333333333333333333333333333333--------33oo
|
|
52
52
|
--++oo330000000033oo++--
|
53
53
|
```
|
54
54
|
|
55
|
+
## Options
|
56
|
+
|
57
|
+
- `-i`, `--invert` - Invert the chosen palette (ie, white-on-black becomes black-on-white)
|
58
|
+
|
59
|
+
```text
|
60
|
+
$ slascii face.png --width 15
|
61
|
+
|
62
|
+
--++3333333333++--
|
63
|
+
--oooo----------oooo--
|
64
|
+
--33++--------------++33--
|
65
|
+
--33oooo++------++++oo--++oo--
|
66
|
+
++33++oo00----++++--3333--oo++
|
67
|
+
33oo --oo++--++-- ++oo++--33
|
68
|
+
33oo++++++++--++++++++oo++--33
|
69
|
+
33--++++++------++++++++----33
|
70
|
+
33--oo3333333333333333oo----33
|
71
|
+
33--oo000000000000000000----33
|
72
|
+
++oo++000000003333000033--oo++
|
73
|
+
--oo++oo000033++++++00oo++oo--
|
74
|
+
--33++3300++--++oooo++33--
|
75
|
+
--oooooooooooo++oooo--
|
76
|
+
--++3333333333++--
|
77
|
+
|
78
|
+
(464 chars)
|
79
|
+
|
80
|
+
$ slascii face.png --width 15 --invert
|
81
|
+
|
82
|
+
00000033oo----------oo33000000
|
83
|
+
000033++++3333333333++++330000
|
84
|
+
0033--oo33333333333333oo--3300
|
85
|
+
33--++++oo333333oooo++33oo++33
|
86
|
+
oo--oo++ 3333oooo33----33++oo
|
87
|
+
--++0033++oo33oo3300oo++oo33--
|
88
|
+
--++oooooooo33oooooooo++oo33--
|
89
|
+
--33oooooo333333oooooooo3333--
|
90
|
+
--33++----------------++3333--
|
91
|
+
--33++ 3333--
|
92
|
+
oo++oo ---- --33++oo
|
93
|
+
33++oo++ --oooooo ++oo++33
|
94
|
+
0033--oo-- oo33oo++++oo--3300
|
95
|
+
000033++++++++++++oo++++330000
|
96
|
+
00000033oo----------oo33000000
|
97
|
+
|
98
|
+
(464 chars)
|
99
|
+
```
|
100
|
+
|
101
|
+
- `-c`, `--chars` - The number of characters to use in generating output. Slascii will generate the largest image it
|
102
|
+
can without using *more* than this number of characters. The actual number used will usually be less, as the image's
|
103
|
+
aspect ratio may not allow for *exactly* the requested number of characters.
|
104
|
+
|
105
|
+
|
106
|
+
- `-w`, `--width` - The width of output in columns, overriding the default character count of 4000. Slascii will
|
107
|
+
generate output that is exactly the width requested.
|
108
|
+
|
109
|
+
- `-b` `--no-banner` - Don't print the `(XXX chars)` banner after the image. By default, Slascii will tell you how many
|
110
|
+
characters were in the output so you have some idea whether your messaging app will accept it.
|
111
|
+
|
55
112
|
## A note about palettes
|
56
113
|
|
57
114
|
Some palettes won't make sense for you, because your team won't have our custom emoji. Some palettes output emoji in
|
data/lib/slascii/cli.rb
CHANGED
@@ -25,6 +25,7 @@ module Slascii
|
|
25
25
|
palette = options[:palette]
|
26
26
|
palette = palette.reverse if options[:invert]
|
27
27
|
|
28
|
+
@banner = options.fetch(:banner, true)
|
28
29
|
@output = if options[:chars]
|
29
30
|
make_art_to_character_count(options[:filename], palette, options[:chars])
|
30
31
|
else
|
@@ -33,7 +34,8 @@ module Slascii
|
|
33
34
|
end
|
34
35
|
|
35
36
|
def write_output
|
36
|
-
puts
|
37
|
+
puts output
|
38
|
+
puts "\n\n(#{output.length} chars)" if @banner
|
37
39
|
end
|
38
40
|
|
39
41
|
private
|
@@ -69,6 +71,10 @@ module Slascii
|
|
69
71
|
end
|
70
72
|
end
|
71
73
|
|
74
|
+
opts.on '-b', '--no-banner', 'Do not print the character count below the output' do
|
75
|
+
options[:banner] = false
|
76
|
+
end
|
77
|
+
|
72
78
|
opts.on '-i', '--invert', 'Invert colors' do
|
73
79
|
options[:invert] = true
|
74
80
|
end
|
data/lib/slascii/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slascii
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Eagar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|