my_gems_summary 1.6 → 1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +47 -0
- data/lib/my_gems.rb +16 -1
- data/logo.png +0 -0
- data/mygems.gif +0 -0
- metadata +4 -2
- data/Gemfile.lock +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e4d06cab4aca96fbb1aed48190fa1d263ceeb9579e76606d29977008f9495d7
|
4
|
+
data.tar.gz: f57e77ad2cbb254720498728d771b8167ca33b8163935fe9cc53453382d0437c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb4633be8cfa8ea985fad678c0cb272fc4eafea1bc753e75a42b81dde4e2a689e8dd6b8033079c8b8565cf11b84741a9a2f48be667948f86f6da2364d4d8976c
|
7
|
+
data.tar.gz: cd85c610ac05d9a77f26a2e7340ef9d76d77681a05774dcae470e0c3e89320d65ca8f01ab2d9ca44bc87c3595ba522a9274b1f870457c8bd96a580d595a0171f
|
data/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
<h1 align="center">Welcome to my-gems-summary-cli 👋</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 summary of your gems.
|
16
|
+
|
17
|
+
|
18
|
+
## Install
|
19
|
+
|
20
|
+
```sh
|
21
|
+
gem install my_gems_summary
|
22
|
+
```
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
```sh
|
27
|
+
mygems
|
28
|
+
```
|
29
|
+
|
30
|
+
<div align="center">
|
31
|
+
<img alt="usage" src="mygems.gif" />
|
32
|
+
</div>
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
## Author
|
37
|
+
|
38
|
+
👤 **Vinícius Kammradt**
|
39
|
+
|
40
|
+
* Website: https://kammradt.super.site
|
41
|
+
* Twitter: [@kammzinho](https://twitter.com/kammzinho)
|
42
|
+
* Github: [@kammradt](https://github.com/kammradt)
|
43
|
+
* LinkedIn: [@vinicius-kammradt](https://linkedin.com/in/vinicius-kammradt)
|
44
|
+
|
45
|
+
## Show your support
|
46
|
+
|
47
|
+
Give a ⭐️ if this project helped you!
|
data/lib/my_gems.rb
CHANGED
@@ -3,12 +3,27 @@ require 'gems'
|
|
3
3
|
GemDTO = Struct.new(:name, :downloads)
|
4
4
|
|
5
5
|
module MyGems
|
6
|
+
def self.valid_credentials?
|
7
|
+
begin
|
8
|
+
Gems.gems
|
9
|
+
rescue
|
10
|
+
puts '🥺 Opps, looks like we are missing your rubygems.org credentials 😭'
|
11
|
+
puts "🥺 Let's authenticate 😭"
|
12
|
+
|
13
|
+
puts "💻 Please run 'gem signin' and try again 💻"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
6
17
|
def self.show
|
7
18
|
puts "⭐ Let's see if you're a star!⭐ "
|
19
|
+
return unless valid_credentials?
|
20
|
+
|
8
21
|
puts "📚 Here's your summary:"
|
9
22
|
puts "\n"
|
10
|
-
|
23
|
+
|
11
24
|
my_gems = Gems.gems.map { |gem| GemDTO.new(gem['name'], gem['downloads']) }
|
25
|
+
my_gems = my_gems.sort_by(&:downloads).reverse
|
26
|
+
|
12
27
|
gem_with_longest_name = my_gems.max_by { |gem| gem.name.length }
|
13
28
|
|
14
29
|
my_gems.each do |gem|
|
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: my_gems_summary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.9'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vinicius Kammradt
|
@@ -33,10 +33,12 @@ extensions: []
|
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
35
|
- Gemfile
|
36
|
-
-
|
36
|
+
- README.md
|
37
37
|
- bin/mygems
|
38
38
|
- bin/setup
|
39
39
|
- lib/my_gems.rb
|
40
|
+
- logo.png
|
41
|
+
- mygems.gif
|
40
42
|
homepage: https://github.com/kammradt/my-gems-summary-cli
|
41
43
|
licenses:
|
42
44
|
- MIT
|
data/Gemfile.lock
DELETED