my_gems_summary 1.5 → 1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -0
- data/Gemfile.lock +19 -0
- data/bin/setup +8 -0
- data/lib/my_gems.rb +22 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be5f3c6b9f4e1fa41daff660ab3745c0562c75eb8002d2f4b8c6ef1e8fa7052e
|
4
|
+
data.tar.gz: d23db1d6b4f3c0129bc5e33d9787dcf43167696e64f13bff31497ca0d6bc214e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95f72df671836e3292bf1cdda5c55e1159bdc98da72ed7af685e812df9a4400a52e818ed21a33c387b194aef5f3cca02ef34afaec2b92d46bed024d8f77fd356
|
7
|
+
data.tar.gz: a3d4ced8d02f3343e5d42e7ce2659ff14833bd9574e088dedbbed3d0c8b400352ec700293086b72a899997d0b6e35a3c0df024f0233e2415f27bfb2cf96a6b79
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/bin/setup
ADDED
data/lib/my_gems.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'gems'
|
2
|
+
|
3
|
+
GemDTO = Struct.new(:name, :downloads)
|
4
|
+
|
5
|
+
module MyGems
|
6
|
+
def self.show
|
7
|
+
puts "⭐ Let's see if you're a star!⭐ "
|
8
|
+
puts "📚 Here's your summary:"
|
9
|
+
puts "\n"
|
10
|
+
|
11
|
+
my_gems = Gems.gems.map { |gem| GemDTO.new(gem['name'], gem['downloads']) }
|
12
|
+
gem_with_longest_name = my_gems.max_by { |gem| gem.name.length }
|
13
|
+
|
14
|
+
my_gems.each do |gem|
|
15
|
+
name_output = gem.name.ljust(gem_with_longest_name.first.length)
|
16
|
+
puts "🛑 #{name_output} 🔝 #{gem.downloads} downloads"
|
17
|
+
end
|
18
|
+
|
19
|
+
puts "\n"
|
20
|
+
puts "Bye! See you soon 👋👋👋"
|
21
|
+
end
|
22
|
+
end
|
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.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vinicius Kammradt
|
@@ -32,7 +32,11 @@ executables:
|
|
32
32
|
extensions: []
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
|
+
- Gemfile
|
36
|
+
- Gemfile.lock
|
35
37
|
- bin/mygems
|
38
|
+
- bin/setup
|
39
|
+
- lib/my_gems.rb
|
36
40
|
homepage: https://github.com/kammradt/my-gems-summary-cli
|
37
41
|
licenses:
|
38
42
|
- MIT
|