aaq 0.1.0
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 +7 -0
- data/.gitignore +14 -0
- data/.rspec +3 -0
- data/.rubocop.yml +13 -0
- data/.rubocop_todo.yml +70 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +69 -0
- data/Rakefile +6 -0
- data/aaq.gemspec +31 -0
- data/bin/aaq +14 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/aaq.rb +150 -0
- data/lib/aaq/colors.rb +260 -0
- data/lib/aaq/version.rb +5 -0
- metadata +130 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2fadd995c10ec2a4a54e8947ac31932b9c4318c2b346d8114843f5728cfd59c8
|
4
|
+
data.tar.gz: 310a7a6032f66a994ecf290435b3e2b25d0c6bf574bc7f9f2b163e9b028f06ea
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c2cf1db9388c48788864708c4b8e36d6c7f4aa765d0236d26d5b700db3c8c3c0470d5d75127f3b7a2b5e21151a59b26ea3c76ef41a12782baf8a66f3c12c7a57
|
7
|
+
data.tar.gz: e5c90161c1934b8e7a31853f1e8179f0025c7343fc7cf4aacd535393d18458389df3138abf5cb8a586ae4146964b1bdf88bc1d491426a3dea43bbf345299e282
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2018-07-16 06:42:25 +0900 using RuboCop version 0.58.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 2
|
10
|
+
Metrics/AbcSize:
|
11
|
+
Max: 33
|
12
|
+
|
13
|
+
# Offense count: 1
|
14
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
15
|
+
# ExcludedMethods: refine
|
16
|
+
Metrics/BlockLength:
|
17
|
+
Max: 60
|
18
|
+
|
19
|
+
# Offense count: 1
|
20
|
+
# Configuration parameters: CountComments.
|
21
|
+
Metrics/ClassLength:
|
22
|
+
Max: 118
|
23
|
+
|
24
|
+
# Offense count: 2
|
25
|
+
# Configuration parameters: CountComments.
|
26
|
+
Metrics/MethodLength:
|
27
|
+
Max: 24
|
28
|
+
|
29
|
+
# Offense count: 4
|
30
|
+
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
31
|
+
# AllowedNames: io, id, to, by, on, in, at
|
32
|
+
Naming/UncommunicativeMethodParamName:
|
33
|
+
Exclude:
|
34
|
+
- 'lib/aaq.rb'
|
35
|
+
|
36
|
+
# Offense count: 1
|
37
|
+
Security/Eval:
|
38
|
+
Exclude:
|
39
|
+
- 'bin/aaq'
|
40
|
+
|
41
|
+
# Offense count: 1
|
42
|
+
Security/Open:
|
43
|
+
Exclude:
|
44
|
+
- 'spec/aaq_spec.rb'
|
45
|
+
|
46
|
+
# Offense count: 2
|
47
|
+
# Cop supports --auto-correct.
|
48
|
+
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods.
|
49
|
+
# SupportedStyles: line_count_based, semantic, braces_for_chaining
|
50
|
+
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
|
51
|
+
# FunctionalMethods: let, let!, subject, watch
|
52
|
+
# IgnoredMethods: lambda, proc, it
|
53
|
+
Style/BlockDelimiters:
|
54
|
+
Exclude:
|
55
|
+
- 'lib/aaq.rb'
|
56
|
+
|
57
|
+
# Offense count: 1
|
58
|
+
Style/Documentation:
|
59
|
+
Exclude:
|
60
|
+
- 'spec/**/*'
|
61
|
+
- 'test/**/*'
|
62
|
+
- 'lib/aaq.rb'
|
63
|
+
|
64
|
+
# Offense count: 1
|
65
|
+
# Cop supports --auto-correct.
|
66
|
+
# Configuration parameters: EnforcedStyle.
|
67
|
+
# SupportedStyles: when_needed, always, never
|
68
|
+
Style/FrozenStringLiteralComment:
|
69
|
+
Exclude:
|
70
|
+
- 'lib/aaq.rb'
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 yskoht
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# AAQ - Ascii Art Quine
|
2
|
+
|
3
|
+
```sh
|
4
|
+
# Download sample image
|
5
|
+
curl -O https://github-media-downloads.s3.amazonaws.com/Octocats.zip && unzip Octocats.zip
|
6
|
+
aaq Octocat/Octocat.png --color
|
7
|
+
```
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'aaq'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
```sh
|
20
|
+
$ bundle
|
21
|
+
```
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
```sh
|
26
|
+
$ gem install aaq
|
27
|
+
```
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
Simple quine.
|
32
|
+
|
33
|
+
```sh
|
34
|
+
aaq Octocat/Octocat.png
|
35
|
+
```
|
36
|
+
|
37
|
+
Colorful quine.
|
38
|
+
|
39
|
+
```sh
|
40
|
+
aaq Octocat/Octocat.png --color
|
41
|
+
```
|
42
|
+
|
43
|
+
Delete escape sequence.
|
44
|
+
|
45
|
+
```sh
|
46
|
+
aaq Octocat/Octocat.png --color | ruby -ne 'puts $_.gsub(/\e.*?m/, "")' | ruby
|
47
|
+
```
|
48
|
+
|
49
|
+
Put `--color` option.
|
50
|
+
|
51
|
+
```sh
|
52
|
+
aaq Octocat/Octocat.png | xargs -0 -J % ruby -e % '' --color
|
53
|
+
```
|
54
|
+
|
55
|
+
In source code.
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
require 'aaq'
|
59
|
+
|
60
|
+
puts AAQ::AAQ.new(img_file_name).convert
|
61
|
+
```
|
62
|
+
|
63
|
+
## Contributing
|
64
|
+
|
65
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/yskoht/aaq.
|
66
|
+
|
67
|
+
## License
|
68
|
+
|
69
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/aaq.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "aaq/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "aaq"
|
8
|
+
spec.version = AAQ::VERSION
|
9
|
+
spec.authors = ["yskoht"]
|
10
|
+
spec.email = ["ysk.oht@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Create ascii art quine from image file}
|
13
|
+
spec.homepage = "https://github.com/yskoht/aaq"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
# Specify which files should be added to the gem when it is released.
|
17
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
18
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
19
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
+
end
|
21
|
+
spec.bindir = "exe"
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ["lib"]
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
28
|
+
spec.add_development_dependency "rubocop", "~> 0.58"
|
29
|
+
|
30
|
+
spec.add_dependency "rmagick", "~> 2.16"
|
31
|
+
end
|
data/bin/aaq
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'aaq'
|
5
|
+
require 'optparse'
|
6
|
+
|
7
|
+
Version = AAQ::VERSION
|
8
|
+
|
9
|
+
opt = OptionParser.new
|
10
|
+
opt.banner = 'Usage: bundle exec aaq [image] [--color]'
|
11
|
+
opt.on('--color', 'output color ascii-art')
|
12
|
+
args = opt.parse(ARGV)
|
13
|
+
|
14
|
+
eval AAQ::AAQ.new(args[0]).convert.to_s
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "aaq"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/lib/aaq.rb
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
require 'aaq/version'
|
2
|
+
require 'aaq/colors'
|
3
|
+
|
4
|
+
require 'set'
|
5
|
+
require 'rmagick'
|
6
|
+
|
7
|
+
module AAQ
|
8
|
+
UNIT_W = 6
|
9
|
+
UNIT_H = 14
|
10
|
+
|
11
|
+
class AAQ
|
12
|
+
attr_reader :img, :width, :height, :data, :code
|
13
|
+
|
14
|
+
def initialize(input_img)
|
15
|
+
org_img = Magick::ImageList.new(input_img)
|
16
|
+
@img, @width, @height = resize(org_img)
|
17
|
+
end
|
18
|
+
|
19
|
+
def convert
|
20
|
+
qtz = quantize
|
21
|
+
colors = Set.new(qtz.flatten).to_a.sort
|
22
|
+
blank_color = remove_blank_color(colors)
|
23
|
+
|
24
|
+
@data = separate_color(qtz, colors).map do |x|
|
25
|
+
x.join.gsub(/0+|1+/) do |c|
|
26
|
+
"#{c[0] == '0' ? ':' : '_'}#{c.size}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
@code = encode(@data, colors, blank_color)
|
31
|
+
self
|
32
|
+
end
|
33
|
+
|
34
|
+
def encode(data, colors, blank_color)
|
35
|
+
code = <<~"QUINE"
|
36
|
+
eval $s = %w'
|
37
|
+
b = #{data}.map{ |x|
|
38
|
+
x.gsub(/:[0-9]+|_[0-9]+/){ |c|
|
39
|
+
(c[0] == \":\" ? \"0\" : \"1\") * c[1..-1].to_i
|
40
|
+
}.reverse.to_i(2)
|
41
|
+
};
|
42
|
+
e = \"eval $s = %w\" << 39 << $s;
|
43
|
+
o = \"\";
|
44
|
+
j = k = -1;
|
45
|
+
d = \"\" << 39 << \".join\";
|
46
|
+
#{width * height}.times{ |i|
|
47
|
+
e += (i < e.size) ? "" : $s;
|
48
|
+
c = #{Array.new(data.size) { |j| "b[#{j}][i] == 1 ? #{colors[j]} :" }.join(' ')} #{blank_color};
|
49
|
+
ARGV.include?(\"--color\")
|
50
|
+
? o << \"\" << 27 << \"[38;5;%sm\" % c << 27 << \"[48;5;%sm\" % c
|
51
|
+
<< (i < 10 ? e[j+=1] : i > #{width * height - 7} ? d[k+=1] : c == #{blank_color} ? 32 : e[j+=1])
|
52
|
+
<< 27 << \"[0m\"
|
53
|
+
: o << (i < 10 ? e[j+=1] : c == #{blank_color} ? 32 : e[j+=1]);
|
54
|
+
o << (i % #{width} == #{width - 1} ? 10 : \"\");
|
55
|
+
};
|
56
|
+
ARGV.include?(\"--color\") ? \"\" : o[-7, 6] = d;
|
57
|
+
puts(o)#'.join
|
58
|
+
QUINE
|
59
|
+
code.gsub(/\s/, '')
|
60
|
+
end
|
61
|
+
|
62
|
+
def to_s
|
63
|
+
b = data.map do |x|
|
64
|
+
x.gsub(/:[0-9]+|_[0-9]+/) { |c|
|
65
|
+
(c[0] == ':' ? '0' : '1') * c[1..-1].to_i
|
66
|
+
}.reverse.to_i(2)
|
67
|
+
end
|
68
|
+
|
69
|
+
str = "eval$s=%w'"
|
70
|
+
k = -1
|
71
|
+
c = co = @code.gsub("eval$s=%w'", '').gsub("'.join", '')
|
72
|
+
height.times do |h|
|
73
|
+
width.times do |w|
|
74
|
+
i = h * width + w
|
75
|
+
next if i < 10
|
76
|
+
c += co if i >= c.size
|
77
|
+
str += b.map { |x| x[i] }.include?(1) ? c[k += 1] : ' '
|
78
|
+
end
|
79
|
+
str += "\n"
|
80
|
+
end
|
81
|
+
str[-7, 6] = '' << 39 << '.join'
|
82
|
+
str
|
83
|
+
end
|
84
|
+
|
85
|
+
private
|
86
|
+
|
87
|
+
def resize(org_img)
|
88
|
+
w = org_img.columns / UNIT_W
|
89
|
+
h = org_img.rows / UNIT_H
|
90
|
+
[org_img.resize(w * UNIT_W, h * UNIT_H), w, h]
|
91
|
+
end
|
92
|
+
|
93
|
+
def quantize
|
94
|
+
memo = {}
|
95
|
+
|
96
|
+
Array.new(height) do |h|
|
97
|
+
y = h * UNIT_H
|
98
|
+
Array.new(width) do |w|
|
99
|
+
x = w * UNIT_W
|
100
|
+
to_256color(mode(x, y), memo)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def mode(x, y)
|
106
|
+
h = Hash.new(0)
|
107
|
+
y.upto(y + UNIT_H) do |dy|
|
108
|
+
x.upto(x + UNIT_W) do |dx|
|
109
|
+
h[img.pixel_color(dx, dy)] += 1
|
110
|
+
end
|
111
|
+
end
|
112
|
+
h.max_by { |a| a[1] }[0]
|
113
|
+
end
|
114
|
+
|
115
|
+
def to_256(pix)
|
116
|
+
[pix.red / 257, pix.green / 257, pix.blue / 257]
|
117
|
+
end
|
118
|
+
|
119
|
+
def to_256color(pix, memo)
|
120
|
+
return -1 if pix.opacity.positive?
|
121
|
+
return memo[pix] if memo.include?(pix)
|
122
|
+
|
123
|
+
memo[pix] = COLORS.min { |a, b|
|
124
|
+
dist(a[1], to_256(pix)) <=> dist(b[1], to_256(pix))
|
125
|
+
}[0]
|
126
|
+
end
|
127
|
+
|
128
|
+
def dist(a, b)
|
129
|
+
a.zip(b).map { |x| (x[0] - x[1])**2 }.sum
|
130
|
+
end
|
131
|
+
|
132
|
+
def remove_blank_color(colors)
|
133
|
+
if colors.include?(-1)
|
134
|
+
colors.delete(-1)
|
135
|
+
elsif colors.include?(15)
|
136
|
+
colors.delete(15)
|
137
|
+
else
|
138
|
+
-2
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
def separate_color(qtz, colors)
|
143
|
+
colors.each.map do |c|
|
144
|
+
qtz.flatten.map do |q|
|
145
|
+
q == c ? '1' : '0'
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
data/lib/aaq/colors.rb
ADDED
@@ -0,0 +1,260 @@
|
|
1
|
+
module AAQ
|
2
|
+
COLORS = [
|
3
|
+
[ 0, [ 0, 0, 0]],
|
4
|
+
[ 1, [128, 0, 0]],
|
5
|
+
[ 2, [ 0, 128, 0]],
|
6
|
+
[ 3, [128, 128, 0]],
|
7
|
+
[ 4, [ 0, 0, 128]],
|
8
|
+
[ 5, [128, 0, 128]],
|
9
|
+
[ 6, [ 0, 128, 128]],
|
10
|
+
[ 7, [192, 192, 192]],
|
11
|
+
[ 8, [128, 128, 128]],
|
12
|
+
[ 9, [255, 0, 0]],
|
13
|
+
[ 10, [ 0, 255, 0]],
|
14
|
+
[ 11, [255, 255, 0]],
|
15
|
+
[ 12, [ 0, 0, 255]],
|
16
|
+
[ 13, [255, 0, 255]],
|
17
|
+
[ 14, [ 0, 255, 255]],
|
18
|
+
[ 15, [255, 255, 255]],
|
19
|
+
[ 16, [ 0, 0, 0]],
|
20
|
+
[ 17, [ 0, 0, 95]],
|
21
|
+
[ 18, [ 0, 0, 135]],
|
22
|
+
[ 19, [ 0, 0, 175]],
|
23
|
+
[ 20, [ 0, 0, 215]],
|
24
|
+
[ 21, [ 0, 0, 255]],
|
25
|
+
[ 22, [ 0, 95, 0]],
|
26
|
+
[ 23, [ 0, 95, 95]],
|
27
|
+
[ 24, [ 0, 95, 135]],
|
28
|
+
[ 25, [ 0, 95, 175]],
|
29
|
+
[ 26, [ 0, 95, 215]],
|
30
|
+
[ 27, [ 0, 95, 255]],
|
31
|
+
[ 28, [ 0, 135, 0]],
|
32
|
+
[ 29, [ 0, 135, 95]],
|
33
|
+
[ 30, [ 0, 135, 135]],
|
34
|
+
[ 31, [ 0, 135, 175]],
|
35
|
+
[ 32, [ 0, 135, 215]],
|
36
|
+
[ 33, [ 0, 135, 255]],
|
37
|
+
[ 34, [ 0, 175, 0]],
|
38
|
+
[ 35, [ 0, 175, 95]],
|
39
|
+
[ 36, [ 0, 175, 135]],
|
40
|
+
[ 37, [ 0, 175, 175]],
|
41
|
+
[ 38, [ 0, 175, 215]],
|
42
|
+
[ 39, [ 0, 175, 255]],
|
43
|
+
[ 40, [ 0, 215, 0]],
|
44
|
+
[ 41, [ 0, 215, 95]],
|
45
|
+
[ 42, [ 0, 215, 135]],
|
46
|
+
[ 43, [ 0, 215, 175]],
|
47
|
+
[ 44, [ 0, 215, 215]],
|
48
|
+
[ 45, [ 0, 215, 255]],
|
49
|
+
[ 46, [ 0, 255, 0]],
|
50
|
+
[ 47, [ 0, 255, 95]],
|
51
|
+
[ 48, [ 0, 255, 135]],
|
52
|
+
[ 49, [ 0, 255, 175]],
|
53
|
+
[ 50, [ 0, 255, 215]],
|
54
|
+
[ 51, [ 0, 255, 255]],
|
55
|
+
[ 52, [ 95, 0, 0]],
|
56
|
+
[ 53, [ 95, 0, 95]],
|
57
|
+
[ 54, [ 95, 0, 135]],
|
58
|
+
[ 55, [ 95, 0, 175]],
|
59
|
+
[ 56, [ 95, 0, 215]],
|
60
|
+
[ 57, [ 95, 0, 255]],
|
61
|
+
[ 58, [ 95, 95, 0]],
|
62
|
+
[ 59, [ 95, 95, 95]],
|
63
|
+
[ 60, [ 95, 95, 135]],
|
64
|
+
[ 61, [ 95, 95, 175]],
|
65
|
+
[ 62, [ 95, 95, 215]],
|
66
|
+
[ 63, [ 95, 95, 255]],
|
67
|
+
[ 64, [ 95, 135, 0]],
|
68
|
+
[ 65, [ 95, 135, 95]],
|
69
|
+
[ 66, [ 95, 135, 135]],
|
70
|
+
[ 67, [ 95, 135, 175]],
|
71
|
+
[ 68, [ 95, 135, 215]],
|
72
|
+
[ 69, [ 95, 135, 255]],
|
73
|
+
[ 70, [ 95, 175, 0]],
|
74
|
+
[ 71, [ 95, 175, 95]],
|
75
|
+
[ 72, [ 95, 175, 135]],
|
76
|
+
[ 73, [ 95, 175, 175]],
|
77
|
+
[ 74, [ 95, 175, 215]],
|
78
|
+
[ 75, [ 95, 175, 255]],
|
79
|
+
[ 76, [ 95, 215, 0]],
|
80
|
+
[ 77, [ 95, 215, 95]],
|
81
|
+
[ 78, [ 95, 215, 135]],
|
82
|
+
[ 79, [ 95, 215, 175]],
|
83
|
+
[ 80, [ 95, 215, 215]],
|
84
|
+
[ 81, [ 95, 215, 255]],
|
85
|
+
[ 82, [ 95, 255, 0]],
|
86
|
+
[ 83, [ 95, 255, 95]],
|
87
|
+
[ 84, [ 95, 255, 135]],
|
88
|
+
[ 85, [ 95, 255, 175]],
|
89
|
+
[ 86, [ 95, 255, 215]],
|
90
|
+
[ 87, [ 95, 255, 255]],
|
91
|
+
[ 88, [135, 0, 0]],
|
92
|
+
[ 89, [135, 0, 95]],
|
93
|
+
[ 90, [135, 0, 135]],
|
94
|
+
[ 91, [135, 0, 175]],
|
95
|
+
[ 92, [135, 0, 215]],
|
96
|
+
[ 93, [135, 0, 255]],
|
97
|
+
[ 94, [135, 95, 0]],
|
98
|
+
[ 95, [135, 95, 95]],
|
99
|
+
[ 96, [135, 95, 135]],
|
100
|
+
[ 97, [135, 95, 175]],
|
101
|
+
[ 98, [135, 95, 215]],
|
102
|
+
[ 99, [135, 95, 255]],
|
103
|
+
[100, [135, 135, 0]],
|
104
|
+
[101, [135, 135, 95]],
|
105
|
+
[102, [135, 135, 135]],
|
106
|
+
[103, [135, 135, 175]],
|
107
|
+
[104, [135, 135, 215]],
|
108
|
+
[105, [135, 135, 255]],
|
109
|
+
[106, [135, 175, 0]],
|
110
|
+
[107, [135, 175, 95]],
|
111
|
+
[108, [135, 175, 135]],
|
112
|
+
[109, [135, 175, 175]],
|
113
|
+
[110, [135, 175, 215]],
|
114
|
+
[111, [135, 175, 255]],
|
115
|
+
[112, [135, 215, 0]],
|
116
|
+
[113, [135, 215, 95]],
|
117
|
+
[114, [135, 215, 135]],
|
118
|
+
[115, [135, 215, 175]],
|
119
|
+
[116, [135, 215, 215]],
|
120
|
+
[117, [135, 215, 255]],
|
121
|
+
[118, [135, 255, 0]],
|
122
|
+
[119, [135, 255, 95]],
|
123
|
+
[120, [135, 255, 135]],
|
124
|
+
[121, [135, 255, 175]],
|
125
|
+
[122, [135, 255, 215]],
|
126
|
+
[123, [135, 255, 255]],
|
127
|
+
[124, [175, 0, 0]],
|
128
|
+
[125, [175, 0, 95]],
|
129
|
+
[126, [175, 0, 135]],
|
130
|
+
[127, [175, 0, 175]],
|
131
|
+
[128, [175, 0, 215]],
|
132
|
+
[129, [175, 0, 255]],
|
133
|
+
[130, [175, 95, 0]],
|
134
|
+
[131, [175, 95, 95]],
|
135
|
+
[132, [175, 95, 135]],
|
136
|
+
[133, [175, 95, 175]],
|
137
|
+
[134, [175, 95, 215]],
|
138
|
+
[135, [175, 95, 255]],
|
139
|
+
[136, [175, 135, 0]],
|
140
|
+
[137, [175, 135, 95]],
|
141
|
+
[138, [175, 135, 135]],
|
142
|
+
[139, [175, 135, 175]],
|
143
|
+
[140, [175, 135, 215]],
|
144
|
+
[141, [175, 135, 255]],
|
145
|
+
[142, [175, 175, 0]],
|
146
|
+
[143, [175, 175, 95]],
|
147
|
+
[144, [175, 175, 135]],
|
148
|
+
[145, [175, 175, 175]],
|
149
|
+
[146, [175, 175, 215]],
|
150
|
+
[147, [175, 175, 255]],
|
151
|
+
[148, [175, 215, 0]],
|
152
|
+
[149, [175, 215, 95]],
|
153
|
+
[150, [175, 215, 135]],
|
154
|
+
[151, [175, 215, 175]],
|
155
|
+
[152, [175, 215, 215]],
|
156
|
+
[153, [175, 215, 255]],
|
157
|
+
[154, [175, 255, 0]],
|
158
|
+
[155, [175, 255, 95]],
|
159
|
+
[156, [175, 255, 135]],
|
160
|
+
[157, [175, 255, 175]],
|
161
|
+
[158, [175, 255, 215]],
|
162
|
+
[159, [175, 255, 255]],
|
163
|
+
[160, [215, 0, 0]],
|
164
|
+
[161, [215, 0, 95]],
|
165
|
+
[162, [215, 0, 135]],
|
166
|
+
[163, [215, 0, 175]],
|
167
|
+
[164, [215, 0, 215]],
|
168
|
+
[165, [215, 0, 255]],
|
169
|
+
[166, [215, 95, 0]],
|
170
|
+
[167, [215, 95, 95]],
|
171
|
+
[168, [215, 95, 135]],
|
172
|
+
[169, [215, 95, 175]],
|
173
|
+
[170, [215, 95, 215]],
|
174
|
+
[171, [215, 95, 255]],
|
175
|
+
[172, [215, 135, 0]],
|
176
|
+
[173, [215, 135, 95]],
|
177
|
+
[174, [215, 135, 135]],
|
178
|
+
[175, [215, 135, 175]],
|
179
|
+
[176, [215, 135, 215]],
|
180
|
+
[177, [215, 135, 255]],
|
181
|
+
[178, [215, 175, 0]],
|
182
|
+
[179, [215, 175, 95]],
|
183
|
+
[180, [215, 175, 135]],
|
184
|
+
[181, [215, 175, 175]],
|
185
|
+
[182, [215, 175, 215]],
|
186
|
+
[183, [215, 175, 255]],
|
187
|
+
[184, [215, 215, 0]],
|
188
|
+
[185, [215, 215, 95]],
|
189
|
+
[186, [215, 215, 135]],
|
190
|
+
[187, [215, 215, 175]],
|
191
|
+
[188, [215, 215, 215]],
|
192
|
+
[189, [215, 215, 255]],
|
193
|
+
[190, [215, 255, 0]],
|
194
|
+
[191, [215, 255, 95]],
|
195
|
+
[192, [215, 255, 135]],
|
196
|
+
[193, [215, 255, 175]],
|
197
|
+
[194, [215, 255, 215]],
|
198
|
+
[195, [215, 255, 255]],
|
199
|
+
[196, [255, 0, 0]],
|
200
|
+
[197, [255, 0, 95]],
|
201
|
+
[198, [255, 0, 135]],
|
202
|
+
[199, [255, 0, 175]],
|
203
|
+
[200, [255, 0, 215]],
|
204
|
+
[201, [255, 0, 255]],
|
205
|
+
[202, [255, 95, 0]],
|
206
|
+
[203, [255, 95, 95]],
|
207
|
+
[204, [255, 95, 135]],
|
208
|
+
[205, [255, 95, 175]],
|
209
|
+
[206, [255, 95, 215]],
|
210
|
+
[207, [255, 95, 255]],
|
211
|
+
[208, [255, 135, 0]],
|
212
|
+
[209, [255, 135, 95]],
|
213
|
+
[210, [255, 135, 135]],
|
214
|
+
[211, [255, 135, 175]],
|
215
|
+
[212, [255, 135, 215]],
|
216
|
+
[213, [255, 135, 255]],
|
217
|
+
[214, [255, 175, 0]],
|
218
|
+
[215, [255, 175, 95]],
|
219
|
+
[216, [255, 175, 135]],
|
220
|
+
[217, [255, 175, 175]],
|
221
|
+
[218, [255, 175, 215]],
|
222
|
+
[219, [255, 175, 255]],
|
223
|
+
[220, [255, 215, 0]],
|
224
|
+
[221, [255, 215, 95]],
|
225
|
+
[222, [255, 215, 135]],
|
226
|
+
[223, [255, 215, 175]],
|
227
|
+
[224, [255, 215, 215]],
|
228
|
+
[225, [255, 215, 255]],
|
229
|
+
[226, [255, 255, 0]],
|
230
|
+
[227, [255, 255, 95]],
|
231
|
+
[228, [255, 255, 135]],
|
232
|
+
[229, [255, 255, 175]],
|
233
|
+
[230, [255, 255, 215]],
|
234
|
+
[231, [255, 255, 255]],
|
235
|
+
[232, [ 8, 8, 8]],
|
236
|
+
[233, [ 18, 18, 18]],
|
237
|
+
[234, [ 28, 28, 28]],
|
238
|
+
[235, [ 38, 38, 38]],
|
239
|
+
[236, [ 48, 48, 48]],
|
240
|
+
[237, [ 58, 58, 58]],
|
241
|
+
[238, [ 68, 68, 68]],
|
242
|
+
[239, [ 78, 78, 78]],
|
243
|
+
[240, [ 88, 88, 88]],
|
244
|
+
[241, [ 98, 98, 98]],
|
245
|
+
[242, [108, 108, 108]],
|
246
|
+
[243, [118, 118, 118]],
|
247
|
+
[244, [128, 128, 128]],
|
248
|
+
[245, [138, 138, 138]],
|
249
|
+
[246, [148, 148, 148]],
|
250
|
+
[247, [158, 158, 158]],
|
251
|
+
[248, [168, 168, 168]],
|
252
|
+
[249, [178, 178, 178]],
|
253
|
+
[250, [188, 188, 188]],
|
254
|
+
[251, [198, 198, 198]],
|
255
|
+
[252, [208, 208, 208]],
|
256
|
+
[253, [218, 218, 218]],
|
257
|
+
[254, [228, 228, 228]],
|
258
|
+
[255, [238, 238, 238]],
|
259
|
+
]
|
260
|
+
end
|
data/lib/aaq/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aaq
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- yskoht
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-07-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.58'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.58'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rmagick
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.16'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.16'
|
83
|
+
description:
|
84
|
+
email:
|
85
|
+
- ysk.oht@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- ".rubocop.yml"
|
93
|
+
- ".rubocop_todo.yml"
|
94
|
+
- ".travis.yml"
|
95
|
+
- Gemfile
|
96
|
+
- LICENSE.txt
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
99
|
+
- aaq.gemspec
|
100
|
+
- bin/aaq
|
101
|
+
- bin/console
|
102
|
+
- bin/setup
|
103
|
+
- lib/aaq.rb
|
104
|
+
- lib/aaq/colors.rb
|
105
|
+
- lib/aaq/version.rb
|
106
|
+
homepage: https://github.com/yskoht/aaq
|
107
|
+
licenses:
|
108
|
+
- MIT
|
109
|
+
metadata: {}
|
110
|
+
post_install_message:
|
111
|
+
rdoc_options: []
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
requirements: []
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 2.7.6
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: Create ascii art quine from image file
|
130
|
+
test_files: []
|