gem-check 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gem-check/helpers.rb +8 -11
- data/lib/gem-check/version.rb +1 -1
- data/lib/gem-check.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31e7a891177cd5e3314d2ea3aaad892992746862
|
4
|
+
data.tar.gz: b63f82df5f5124a4362a32bcd8d8ae1fc8095e71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c439a7dfc00e4c8df7f7681da59b13138e578c957db65fac691883257ef001c060e664a5e386d31189d4dc8530b0a3d4f7f400de7df6151214421cb427f611d0
|
7
|
+
data.tar.gz: eea068e867cadd81296b105733fee22972e0cc410afa5ae9cc15579b2edd3c41aeff55890ba6f123c0aa1daa97ebdbb8b8483b298576999d7b2176983e0d3c14
|
data/lib/gem-check/helpers.rb
CHANGED
@@ -16,26 +16,23 @@ module GemCheck
|
|
16
16
|
|
17
17
|
# Gems API
|
18
18
|
def current_gem_info
|
19
|
-
@current_stats = []
|
20
19
|
Gems.gems.map do |x|
|
21
20
|
x = OpenStruct.new(x)
|
22
|
-
|
23
|
-
@current_stats << val
|
24
|
-
val
|
21
|
+
[x.name, x.version, commafy(x.version_downloads), commafy(x.downloads)]
|
25
22
|
end
|
26
23
|
end
|
27
24
|
|
28
25
|
# Features
|
29
26
|
def add_new_download_info(latest_info)
|
30
27
|
return latest_info if @previous_stats.empty?
|
31
|
-
latest_info.
|
28
|
+
latest_info.each do |row|
|
32
29
|
prev_info = search_by_column(@previous_stats, COL_NAME, row[COL_NAME])
|
33
|
-
prev_info = search_by_column(prev_info, COL_VER, row[COL_VER])
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
30
|
+
prev_info = search_by_column(prev_info, COL_VER, row[COL_VER]) unless prev_info.empty?
|
31
|
+
unless prev_info.empty?
|
32
|
+
prev_info = prev_info.first
|
33
|
+
calc_new_downloads(COL_TDL, row, prev_info)
|
34
|
+
calc_new_downloads(COL_VDL, row, prev_info)
|
35
|
+
end
|
39
36
|
end
|
40
37
|
end
|
41
38
|
|
data/lib/gem-check/version.rb
CHANGED
data/lib/gem-check.rb
CHANGED
@@ -48,9 +48,9 @@ module GemCheck
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def build_table
|
51
|
-
|
52
|
-
|
53
|
-
table = Terminal::Table.new(rows:
|
51
|
+
@current_stats = current_gem_info.sort!{|a, b| b[2].to_i <=> a[2].to_i}
|
52
|
+
add_new_download_info(@current_stats)
|
53
|
+
table = Terminal::Table.new(rows: @current_stats)
|
54
54
|
table.title = header_string
|
55
55
|
table.headings = REPORT_HEADINGS
|
56
56
|
[1 ].each{ |col| table.align_column(col, :left) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Meissa Dia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gems
|