diff options
author | James Lopez <james@jameslopez.es> | 2016-11-23 13:28:28 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-01-17 13:32:55 +0300 |
commit | a67311cb4c9f54af43d300fde5240f9a370193d1 (patch) | |
tree | 14b82a6181b6cd7a148eeda9d2e50002c798dd8e /lib/gitlab/cycle_analytics | |
parent | 02e1e4819234662faddd7d8eb5c54d9bfdf9e7e6 (diff) |
Fix other spec failures
Diffstat (limited to 'lib/gitlab/cycle_analytics')
-rw-r--r-- | lib/gitlab/cycle_analytics/base_event.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/cycle_analytics/base_stage.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/cycle_analytics/events.rb | 38 | ||||
-rw-r--r-- | lib/gitlab/cycle_analytics/stage_summary.rb (renamed from lib/gitlab/cycle_analytics/summary.rb) | 4 | ||||
-rw-r--r-- | lib/gitlab/cycle_analytics/summary/base.rb | 2 |
5 files changed, 5 insertions, 44 deletions
diff --git a/lib/gitlab/cycle_analytics/base_event.rb b/lib/gitlab/cycle_analytics/base_event.rb index c87841c119a..d540cb6549c 100644 --- a/lib/gitlab/cycle_analytics/base_event.rb +++ b/lib/gitlab/cycle_analytics/base_event.rb @@ -5,10 +5,11 @@ module Gitlab attr_reader :stage, :start_time_attrs, :end_time_attrs, :projections, :query - def initialize(fetcher:, stage:) + def initialize(fetcher:, stage:, options:) @query = EventsQuery.new(fetcher: fetcher) @project = fetcher.project @stage = stage + @options = options end def fetch diff --git a/lib/gitlab/cycle_analytics/base_stage.rb b/lib/gitlab/cycle_analytics/base_stage.rb index 27971bfc093..162ebf18c77 100644 --- a/lib/gitlab/cycle_analytics/base_stage.rb +++ b/lib/gitlab/cycle_analytics/base_stage.rb @@ -13,7 +13,7 @@ module Gitlab end def events - event_class.new(fetcher: @fetcher, stage: @stage).fetch + event_class.new(fetcher: @fetcher, stage: @stage, options: @options).fetch end def median_data diff --git a/lib/gitlab/cycle_analytics/events.rb b/lib/gitlab/cycle_analytics/events.rb deleted file mode 100644 index 2d703d76cbb..00000000000 --- a/lib/gitlab/cycle_analytics/events.rb +++ /dev/null @@ -1,38 +0,0 @@ -module Gitlab - module CycleAnalytics - class Events - def initialize(project:, options:) - @project = project - @options = options - end - - def issue_events - IssueEvent.new(project: @project, options: @options).fetch - end - - def plan_events - PlanEvent.new(project: @project, options: @options).fetch - end - - def code_events - CodeEvent.new(project: @project, options: @options).fetch - end - - def test_events - TestEvent.new(project: @project, options: @options).fetch - end - - def review_events - ReviewEvent.new(project: @project, options: @options).fetch - end - - def staging_events - StagingEvent.new(project: @project, options: @options).fetch - end - - def production_events - ProductionEvent.new(project: @project, options: @options).fetch - end - end - end -end diff --git a/lib/gitlab/cycle_analytics/summary.rb b/lib/gitlab/cycle_analytics/stage_summary.rb index 5f0103c9d5a..dd9e4ac2813 100644 --- a/lib/gitlab/cycle_analytics/summary.rb +++ b/lib/gitlab/cycle_analytics/stage_summary.rb @@ -1,8 +1,6 @@ module Gitlab module CycleAnalytics - module Summary - extend self - + class StageSummary def initialize(project, from:) @project = project @from = from diff --git a/lib/gitlab/cycle_analytics/summary/base.rb b/lib/gitlab/cycle_analytics/summary/base.rb index 1bc4ff00b99..43fa3795e5c 100644 --- a/lib/gitlab/cycle_analytics/summary/base.rb +++ b/lib/gitlab/cycle_analytics/summary/base.rb @@ -8,7 +8,7 @@ module Gitlab end def title - self.name + self.class.name.demodulize end def value |