my_gems_summary 1.6 → 1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +47 -0
  3. data/lib/my_gems.rb +16 -1
  4. data/logo.png +0 -0
  5. data/mygems.gif +0 -0
  6. metadata +4 -2
  7. data/Gemfile.lock +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be5f3c6b9f4e1fa41daff660ab3745c0562c75eb8002d2f4b8c6ef1e8fa7052e
4
- data.tar.gz: d23db1d6b4f3c0129bc5e33d9787dcf43167696e64f13bff31497ca0d6bc214e
3
+ metadata.gz: 7e4d06cab4aca96fbb1aed48190fa1d263ceeb9579e76606d29977008f9495d7
4
+ data.tar.gz: f57e77ad2cbb254720498728d771b8167ca33b8163935fe9cc53453382d0437c
5
5
  SHA512:
6
- metadata.gz: 95f72df671836e3292bf1cdda5c55e1159bdc98da72ed7af685e812df9a4400a52e818ed21a33c387b194aef5f3cca02ef34afaec2b92d46bed024d8f77fd356
7
- data.tar.gz: a3d4ced8d02f3343e5d42e7ce2659ff14833bd9574e088dedbbed3d0c8b400352ec700293086b72a899997d0b6e35a3c0df024f0233e2415f27bfb2cf96a6b79
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.6'
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
- - Gemfile.lock
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
@@ -1,19 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- my_gems_summary (1.5)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- gems (1.2.0)
10
-
11
- PLATFORMS
12
- x86_64-linux
13
-
14
- DEPENDENCIES
15
- gems (~> 1.2)
16
- my_gems_summary!
17
-
18
- BUNDLED WITH
19
- 2.2.33