rubatar 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rubatar +19 -5
- data/lib/rubatar/version.rb +1 -1
- 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: cdf2123145a3cf6ae5028925ca76c4e68cbcdd53
|
4
|
+
data.tar.gz: 115c264e1fda6f4901ba2010b033d33a4ce35c78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e12e106aedf8a019d34d0c36259ac0e038222ea68305e1f4ad47d8ede56c76c798aca65b49c4b8ed769d5b3d40f4b6559914cb6010aa6bffcea341c918ff520
|
7
|
+
data.tar.gz: 36fe6942c8867a17a3454914fd591d26c40c0feb4ee2e75d984ec386b4cfc99556e5ecba4c7ccb015583477595d735b0181892571001a325b4321ae11469902c
|
data/bin/rubatar
CHANGED
@@ -6,14 +6,28 @@ $:.unshift(File.dirname(File.realpath(__FILE__)) + '/../lib')
|
|
6
6
|
require 'rubatar'
|
7
7
|
require 'optparse'
|
8
8
|
|
9
|
+
options = {}
|
10
|
+
|
9
11
|
OptionParser.new do |o|
|
10
|
-
o.on('-
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
o.on('-s', '--size size', "the avatar\'s size in \033[33mwidth\033[0mx\033[33mheight\033[0m") { |s|
|
13
|
+
width, height = s.split('x').map(&:to_i)
|
14
|
+
options[:width] = width
|
15
|
+
options[:height] = height
|
16
|
+
}
|
17
|
+
o.on('-o', '--output file', 'where to save the avatar') { |output|
|
18
|
+
options[:output] = output
|
19
|
+
}
|
20
|
+
o.on('-h', '--help', 'show this message') { puts o; exit }
|
14
21
|
o.parse!
|
22
|
+
|
23
|
+
if options[:width].nil? or options[:height].nil? or options[:output].nil?
|
24
|
+
puts o
|
25
|
+
exit
|
26
|
+
end
|
15
27
|
end
|
16
28
|
|
17
|
-
|
29
|
+
|
30
|
+
|
31
|
+
avatar = Rubatar::Avatar.new(options[:width], options[:height], options[:output])
|
18
32
|
avatar.generate
|
19
33
|
avatar.save
|
data/lib/rubatar/version.rb
CHANGED