honeybii 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/honeybii +5 -5
- data/lib/honeybii/shaded_ascii.rb +6 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d0947089595e853e9f872274272e230790f9c4d
|
4
|
+
data.tar.gz: 67617adb4259f2382c8da9c0c60d4972e78b3dfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19e25da9de48e7dc00383ea9385e3b8c67c9da82da09107c0d52ce839206620f889806feb841d1186de5c9aedea5bc8a00db4bd3633623f668234ac430cbc58e
|
7
|
+
data.tar.gz: 713ab498b2eb6e94f3f6c4211c67728559161e43dd72cbb89c78bd922c03e4812d0ab3435dcff57b2c1c4ed5b43be3ab496467cb7e0aeed9ed85ec30ffc0e48f
|
data/bin/honeybii
CHANGED
@@ -12,7 +12,7 @@ option_parser = OptionParser.new do |opts|
|
|
12
12
|
|
13
13
|
gradients = ShadedAscii.gradients.map.with_index { |g, i| {i => g.join} }
|
14
14
|
opts.on('-g', '--gradient N', Integer, "Gradient characters [default: 0] #{gradients}") do |g|
|
15
|
-
options[:
|
15
|
+
options[:gradient] = g
|
16
16
|
end
|
17
17
|
|
18
18
|
opts.on('-o', '--one-to-one', "One-to-one shading, as opposed to relative") do |o|
|
@@ -35,12 +35,12 @@ end
|
|
35
35
|
|
36
36
|
# defaults
|
37
37
|
options[:pixel_size] = 12 unless options[:pixel_size]
|
38
|
-
options[:
|
38
|
+
options[:gradient] = 0 unless options[:gradient]
|
39
39
|
options[:style] = 'relative' unless options[:style]
|
40
40
|
|
41
41
|
# validations
|
42
|
-
unless options[:
|
43
|
-
raise ArgumentError, "Please choose a gradient
|
42
|
+
unless options[:gradient].between? 0, ShadedAscii.gradients.size - 1
|
43
|
+
raise ArgumentError, "Please choose a gradient between 0 and #{ShadedAscii.gradients.size - 1}"
|
44
44
|
end
|
45
45
|
|
46
|
-
puts ShadedAscii.new(image, options[:pixel_size],
|
46
|
+
puts ShadedAscii.new(image, options[:pixel_size], gradient: options[:gradient], style: options[:style])
|
@@ -4,14 +4,15 @@ class ShadedAscii < AsciiImage
|
|
4
4
|
end
|
5
5
|
|
6
6
|
@gradients = [
|
7
|
-
['@', '%', '8', '#', '$', 'V', 'Y', 'x', '*', '=', '+', ':', '~', '-', '.', ' '],
|
8
|
-
['8', 'O', 'o', ':', '.', ' '],
|
9
|
-
['#', '+', ':', ' '],
|
7
|
+
['@', '%', '8', '#', '$', 'V', 'Y', 'x', '*', '=', '+', ':', '~', '-', '.', ' ', ' '],
|
8
|
+
['8', 'O', 'o', ':', '.', ' ', ' '],
|
9
|
+
['#', '+', ':', ' ', ' '],
|
10
|
+
['0', '1', ' ', ' '],
|
10
11
|
]
|
11
12
|
|
12
|
-
def initialize(image_filename, point_size = 12,
|
13
|
+
def initialize(image_filename, point_size = 12, gradient: 0, style: 'one_to_one')
|
13
14
|
super image_filename, point_size
|
14
|
-
@gradient = ShadedAscii.gradients[
|
15
|
+
@gradient = ShadedAscii.gradients[gradient]
|
15
16
|
@style = style
|
16
17
|
to_ascii!
|
17
18
|
end
|