Class: Lariat::SabotageStats
- Inherits:
-
Object
- Object
- Lariat::SabotageStats
- Defined in:
- lib/lariat/sabotage_stats.rb
Class Method Summary collapse
Class Method Details
.gather_stats(url, date_offset) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/lariat/sabotage_stats.rb', line 6 def self.gather_stats(url, date_offset) response = RestClient.get(url) stats = JSON.parse(response) verified = 0 closed = 0 date_offset.times do |i| key = (Date.today - i).to_s verified += stats[key]["releases_verified"] closed += stats[key]["prs_closed"] end return { :releases_verified => verified, :prs_closed => closed } end |