my_gems_summary 1.3 → 1.6

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/Gemfile +6 -0
  3. data/Gemfile.lock +19 -0
  4. data/bin/mygems +2 -2
  5. data/bin/setup +8 -0
  6. data/lib/my_gems.rb +22 -0
  7. metadata +5 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35b0e4f7dca60913166548aa37ec82f55c703ea53aa92c931cddb01761977885
4
- data.tar.gz: 70d3f5438ef5444daf30508602292b23f5de2e3dad33f32c36e08be9662a1a2a
3
+ metadata.gz: be5f3c6b9f4e1fa41daff660ab3745c0562c75eb8002d2f4b8c6ef1e8fa7052e
4
+ data.tar.gz: d23db1d6b4f3c0129bc5e33d9787dcf43167696e64f13bff31497ca0d6bc214e
5
5
  SHA512:
6
- metadata.gz: d56a304d426c8642cbb0f1b9670df2a41ff82694ac764605d050b4ee6e00c149d7f597f56030a48bf8c2fa9d570808f2419dbc06808b07ed3f8993fdfd4934ef
7
- data.tar.gz: 4b02436971f4b67ce22c5f4a786f29844906db22678be4b56181140f759515b2c33af487d19f037b21d4647afacd7d439f96b9c1d4ebaf4cd402b2aa2002286f
6
+ metadata.gz: 95f72df671836e3292bf1cdda5c55e1159bdc98da72ed7af685e812df9a4400a52e818ed21a33c387b194aef5f3cca02ef34afaec2b92d46bed024d8f77fd356
7
+ data.tar.gz: a3d4ced8d02f3343e5d42e7ce2659ff14833bd9574e088dedbbed3d0c8b400352ec700293086b72a899997d0b6e35a3c0df024f0233e2415f27bfb2cf96a6b79
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/Gemfile.lock ADDED
@@ -0,0 +1,19 @@
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
data/bin/mygems CHANGED
@@ -2,6 +2,6 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'bundler/setup'
5
- require 'my_gems'
5
+ require_relative '../lib/my_gems'
6
6
 
7
- puts MyGems::show
7
+ puts MyGems.show
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
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.3'
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