hiddengems 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/exe/hiddengems.rb +6 -19
- data/lib/hiddengems/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00f25eebd3d13ccf280ea8b5868905c3dec6dfc7033b890f8ad6ece71b88e5b8
|
4
|
+
data.tar.gz: 606dc74c1f9b1372d85bb9690d163ce5bdb8552c750d8ad82918385aeaa910ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adeed64f5fe52b2358127b6f84740fb99deff4a3b6578243fd9bdf4d7f1e266cfc796de44d3faf0be7fd4492b7cc1a48d2ee5ff0ec1a92f6c7aca97c3600e361
|
7
|
+
data.tar.gz: c19a760280479a2624e84420a93cf0193677a1f0b943cb1c4765e782a0119a560880d5e6e96f2e2049d663035f4b306ec6aa2bec9250c816e55881813bcbd0c2
|
data/exe/hiddengems.rb
CHANGED
@@ -87,23 +87,7 @@ until curpage == 0
|
|
87
87
|
end
|
88
88
|
|
89
89
|
|
90
|
-
puts "Search term #{searchTerm} returned #{gems.size} hits"
|
91
|
-
|
92
|
-
# Things we wanna see sorted:
|
93
|
-
# + number of versions
|
94
|
-
# + date of last version
|
95
|
-
# + avg date of all versions
|
96
|
-
# + number of downloads
|
97
|
-
# - downloads per day per version
|
98
|
-
# - average downloads per day
|
99
|
-
# - last downloads per day
|
100
|
-
# - trajectory of downloads per day per version
|
101
|
-
# - peak downloads
|
102
|
-
# - min downloads
|
103
|
-
# - where is it now
|
104
|
-
# - slope of a line from peak to current
|
105
|
-
# - slope of line from nadir to current
|
106
|
-
|
90
|
+
puts "Search term '#{searchTerm}' returned #{gems.size} hits"
|
107
91
|
|
108
92
|
data = Hash.new
|
109
93
|
data[:by_downloads] = gems.sort {|a,b| b.downloads <=> a.downloads}.collect {|each| "#{each.name} (#{each.downloads})"}
|
@@ -112,19 +96,22 @@ data[:by_latest_version_date] = gems.sort {|a,b| b.latestVersionDate <=> a.lates
|
|
112
96
|
data[:by_avg_version_date] = gems.sort {|a,b| b.avgDateOfAllVersions<=> a.avgDateOfAllVersions}.collect {|each| "#{each.name} (#{each.avgDateOfAllVersions.year})"}
|
113
97
|
data[:by_download_slope] = gems.sort {|a,b| b.downloadSlope <=> a.downloadSlope}.collect {|each| "#{each.name} (#{each.downloadSlope.round})"}
|
114
98
|
report = Array.new
|
99
|
+
rank = 0
|
115
100
|
gems.each_index {|index|
|
116
101
|
record = Hash.new
|
102
|
+
record[:rank] = rank
|
117
103
|
[:by_downloads,:by_versions,:by_latest_version_date,:by_avg_version_date,:by_download_slope].each {|column|
|
118
104
|
record[column] = data[column][index]
|
119
105
|
gemdict[data[column][index].split(' (').first][:rank] += index
|
120
106
|
}
|
121
107
|
report.push(record)
|
108
|
+
rank += 1
|
122
109
|
}
|
123
110
|
|
124
111
|
puts "Simple Rankings"
|
125
|
-
puts TTY::Table.new(header: data.keys, rows: report).render(:ascii)
|
112
|
+
puts TTY::Table.new(header: [:rank]+data.keys, rows: report).render(:ascii)
|
126
113
|
|
127
114
|
puts "\nVitality Ranking:"
|
128
|
-
puts TTY::Table.new(header: [:name,:info], rows: gems.sort {|a,b| a.
|
115
|
+
puts TTY::Table.new(header: [:score, :name,:info], rows: gems.sort {|a,b| a.rank<=>b.rank}.collect {|each| [each.rank,each.name,each.info]}).render(:ascii, column_widths: [5,35,100],resize: false)
|
129
116
|
|
130
117
|
puts
|
data/lib/hiddengems/version.rb
CHANGED