ascuchiii 1.0 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 908448e137c2b62cf8b9feea873362baace5b8989267a35fff8ea1f413a338ca
4
- data.tar.gz: b4c5ffae39816b5628ba95fe1a61321a85652419c890315d60a2ac90b755f40d
3
+ metadata.gz: e63fa67e15958a9f50d016a8e6afc6519750ae26f5be36466463b1db932f1b8e
4
+ data.tar.gz: 986cfcdc8a5e3a21505e586e85da5f07e9588f49b650e861f8646bef4efd4f46
5
5
  SHA512:
6
- metadata.gz: 0f17a8c4013563638f022e1761f03ded8d16586facf66c27c10fc43ffc5bb26215b82e00d7a5cb2b11aeff0b36e74cfdd0854b5fede1bba47e8a9b47cce616d6
7
- data.tar.gz: a99e667235570431c09894c1a66ce6198c2f82864b17fe0527b59fefe80dde83e8286a318b162784b97c2e5f9ed7448d80bd4d50ceac51d98b4587cb5bd798a1
6
+ metadata.gz: 101716034678ace63d5c8bac87c9f8510907257d36e7601a006b924b73cd4da70d967f1b8dbac2461d9d94e9c27b400c15340495c2593fa9769b71d85b312cb8
7
+ data.tar.gz: 47c22db0a3ae40063f3ecef3581a6f4525faa4c4bd1cdf393f0870dde0995511bd4889a0096ce62d178ea33dd42ce761ecd30f54cf8e9509935bbe2fff99363d
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in underscore.gemspec
6
+ gemspec
data/README.md ADDED
@@ -0,0 +1,50 @@
1
+ <h1 align="center">Welcome to ASCUCHIII 👋</h1>
2
+
3
+
4
+ <div align="center">
5
+ <img alt="logo" src="logo.png" />
6
+ </div>
7
+
8
+ <p>
9
+ <img alt="Version" src="https://img.shields.io/badge/version-4-blue.svg?cacheSeconds=2592000" />
10
+ <a href="https://twitter.com/kammzinho" target="_blank">
11
+ <img alt="Twitter: kammzinho" src="https://img.shields.io/twitter/follow/kammzinho.svg?style=social" />
12
+ </a>
13
+ </p>
14
+
15
+ > A gem to get a cute ASCII cuchi easily aka ASCUCHIII.
16
+
17
+
18
+ ## Install
19
+
20
+ ```sh
21
+ gem install ascuchiii
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```sh
27
+ # Default to colorful and width 50
28
+ ascuchiii
29
+
30
+ # If you dont want colors
31
+ ascuchiii -c false
32
+
33
+ # If you dont different widths
34
+ ascuchiii -w 100
35
+ ```
36
+
37
+ <div align="center">
38
+ <img alt="usage" src="ascuchiii.gif" />
39
+ </div>
40
+
41
+
42
+
43
+ ## Author
44
+
45
+ 👤 **Vinícius Kammradt**
46
+
47
+ * Website: https://kammradt.super.site
48
+ * Twitter: [@kammzinho](https://twitter.com/kammzinho)
49
+ * Github: [@kammradt](https://github.com/kammradt)
50
+ * LinkedIn: [@vinicius-kammradt](https://linkedin.com/in/vinicius-kammradt)
data/bin/ascuchiii CHANGED
@@ -4,4 +4,4 @@
4
4
  require 'bundler/setup'
5
5
  require_relative '../lib/ascuchiii'
6
6
 
7
- puts Ascuchiii.show
7
+ Ascuchiii.show
data/lib/ascuchiii.rb ADDED
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'artii'
4
+ require 'asciiart'
5
+ require 'optparse'
6
+
7
+ module Ascuchiii
8
+ def self.words
9
+ [
10
+ 'P A U L O',
11
+ 'C U C H I',
12
+ 'P A U L O C U C H I',
13
+ 'L A G E S'
14
+ ]
15
+ end
16
+
17
+ def self.images
18
+ [
19
+ 'default-cuchi-with-hat.jpeg'
20
+ ]
21
+ end
22
+
23
+ def self.url
24
+ # It will be kinda tricky to make it work with images bundled together with the gem
25
+ # so let's just use a static one hosted at the repo
26
+ 'https://github.com/kammradt/ascuchiii/blob/master/lib/images'
27
+ end
28
+
29
+ def self.parse_img_args
30
+ default_image_args = {
31
+ width: 50,
32
+ color: true
33
+ }
34
+
35
+ OptionParser.new do |parser|
36
+ parser.on('-w [WIDTH]', '--width [WIDTH]', 'Cuchi image WIDTH. Default: 50. Ex ascuchiii -w 200', Integer)
37
+
38
+ parser.on('-c [COLOR]', '--color [COLOR]',
39
+ 'Should render with image with colors. Default: true. Ex: ascuchiii -c (with color/true) | ascuchiii -c false (without color/false)') do |color|
40
+
41
+ # `color.nil?` verifies if the input is just `-X` (considered true).
42
+ # If -X has an argument, convert it to bool
43
+ default_image_args[:color] = color.nil? || color.to_s == 'true'
44
+ end
45
+ end.parse!(into: default_image_args)
46
+
47
+ default_image_args
48
+ end
49
+
50
+ def self.show
51
+ Artii::Base.new.asciify(words.sample)
52
+
53
+ AsciiArt.new("#{url}/#{images.sample}").to_ascii_art(parse_img_args)
54
+ end
55
+ end
data/logo.png ADDED
Binary file
data/mygems.gif ADDED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ascuchiii
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vinicius Kammradt
@@ -46,8 +46,14 @@ executables:
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
+ - Gemfile
50
+ - README.md
49
51
  - bin/ascuchiii
50
52
  - bin/setup
53
+ - lib/ascuchiii.rb
54
+ - lib/images/default-cuchi-with-hat.jpeg
55
+ - logo.png
56
+ - mygems.gif
51
57
  homepage: https://github.com/kammradt/ascuchiii
52
58
  licenses:
53
59
  - MIT