rg_stats 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/bin/rg_stats +8 -3
- data/lib/rg_stats/statistic.rb +4 -0
- data/lib/rg_stats/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/bin/rg_stats
CHANGED
@@ -63,13 +63,18 @@ ARGV.each do |user_name|
|
|
63
63
|
stat = Statistic.new
|
64
64
|
stat.load data_as_json
|
65
65
|
|
66
|
+
total_downloads = stat.gem_infos.reduce(0) { |sum, gem_info| sum + gem_info[1] }
|
67
|
+
last_total_downloads = stat.gem_infos.reduce(0) { |sum, gem_info| sum + (old_map[gem_info[0]].nil? ? 0 : old_map[gem_info[0]]) }
|
68
|
+
total_diff = total_downloads - last_total_downloads
|
69
|
+
diff_text = total_diff > 0 ? ", \e[32m+#{stat.number_with_delimiter(total_diff)}\e[0m since last check" : ""
|
70
|
+
|
66
71
|
puts ""
|
67
|
-
puts "\e[32m#{user_name}\e[0m"
|
72
|
+
puts "\e[32m#{user_name}\e[0m (Total downloads: #{stat.number_with_delimiter(total_downloads)}#{diff_text})"
|
68
73
|
puts "-" *(stat.max_gem_name_size + 30)
|
69
74
|
stat.gem_infos.each do |gem_info|
|
70
75
|
number_of_changes = gem_info[1] - (old_map[gem_info[0]].nil? ? 0 : old_map[gem_info[0]])
|
71
|
-
diff_from_last_time = number_of_changes == 0 ? "" : " (
|
72
|
-
puts "%-#{stat.max_gem_name_size + 1}s=> %
|
76
|
+
diff_from_last_time = number_of_changes == 0 ? "" : " (\e[32m+#{stat.number_with_delimiter(number_of_changes)}\e[0m)"
|
77
|
+
puts "%-#{stat.max_gem_name_size + 1}s=> %6s %6s" % [ gem_info[0] , stat.number_with_delimiter(gem_info[1]), diff_from_last_time ]
|
73
78
|
puts "-" *(stat.max_gem_name_size + 30)
|
74
79
|
end
|
75
80
|
all_data[user_name] = stat.gem_infos
|
data/lib/rg_stats/statistic.rb
CHANGED
data/lib/rg_stats/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rg_stats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-12 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: Get download statistic of yours gems on RubyGems
|
15
15
|
email:
|