2016-10-13 11:11:28 -04:00
|
|
|
module Gitlab
|
|
|
|
module CycleAnalytics
|
|
|
|
class Events
|
2016-10-17 12:03:17 -04:00
|
|
|
include ActionView::Helpers::DateHelper
|
|
|
|
|
2016-10-13 11:11:28 -04:00
|
|
|
def initialize(project:, from:)
|
|
|
|
@project = project
|
|
|
|
@from = from
|
|
|
|
@fetcher = EventsFetcher.new(project: project, from: from)
|
|
|
|
end
|
|
|
|
|
|
|
|
def issue_events
|
2016-10-17 12:03:17 -04:00
|
|
|
@fetcher.fetch_issues.each do |event|
|
|
|
|
event['issue_diff'] = distance_of_time_in_words(event['issue_diff'].to_f)
|
|
|
|
end
|
2016-10-13 11:11:28 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|