rubatar 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rubatar +19 -5
  3. data/lib/rubatar/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00be07b048a722189ce2b6765f5feb3870f685cb
4
- data.tar.gz: cbdad968fcadfd4e3e6c0faac147c1b0102d1db3
3
+ metadata.gz: cdf2123145a3cf6ae5028925ca76c4e68cbcdd53
4
+ data.tar.gz: 115c264e1fda6f4901ba2010b033d33a4ce35c78
5
5
  SHA512:
6
- metadata.gz: 4b76d3384ee0cfae03ea2b3e2e0a8b7eded9cd8d93b3dc265b52c26448f992cb1cf840f917c00c509408d4be484e7d51fb72ccbe9ac5c87cadd7c65115afa4dd
7
- data.tar.gz: 5d9dfa4545e8442a966f880b0bcce60b5f9a3ff260fa3a8b595acf0d2e5945f369f8e79010c5ebb9e2a5bc28578214aa05bc353a511fee1d146df79ae25fa5be
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('-w WIDTH') { |w| $width = w.to_i }
11
- o.on('-h HEIGHT') { |h| $height = h.to_i }
12
- o.on('-o OUTPUT') { |output| $output = output }
13
- o.on('--help') { puts o; exit }
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
- avatar = Rubatar::Avatar.new($width, $height, $output)
29
+
30
+
31
+ avatar = Rubatar::Avatar.new(options[:width], options[:height], options[:output])
18
32
  avatar.generate
19
33
  avatar.save
@@ -1,3 +1,3 @@
1
1
  module Rubatar
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubatar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Kaaman