gitlab-burndown 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e4d84f160a4747733a96bfb9bb2a6e1f0f23f60e4846106727af58c30d3e459
4
- data.tar.gz: 70ac3b5102113d95cf768e026edc7c90ff92df64e104f55053cac78eea8a2141
3
+ metadata.gz: 540d9d31e242b9d7005e16ef4e04727341804250b3ed39bcd53e3148deb629f4
4
+ data.tar.gz: c80a056ee923672aa1c6a2feb92cdce92786b6bbf1c6960806158e7424fe445c
5
5
  SHA512:
6
- metadata.gz: d8bc99707477f54b09a309945ed2ee4e7acd9a642c16043d55c5838bb6fe35e314eac410072e343c2b025423767e5758fe82d780f26d1a6c8bdb2acfa3b31506
7
- data.tar.gz: '094f88b960120723f902db6fcc1b6c4e3ef656e9f1b0312818ae34cef533e0eb005ac7e9a09cc69a2d2e9b15a08b2262e8e181dbcd89be61ba2ca2c051b29c68'
6
+ metadata.gz: 2767b33f0a0d600542f1ae05cb3ba0dc4d652362bcceea604e4fa34af2d82a5924eca1590509dafde37cad9fb48617e0b58de78d4b1b70c51b8b704875031313
7
+ data.tar.gz: 8228561bea48c3fb4d1de45e71c31273b00bcd55ae9d13568572d929108513af91092723cbc261f7765fb7becaaaf080880a32b89b41d1a46e246356ee6f1818
@@ -0,0 +1,7 @@
1
+ require 'gitlab-burndown/csv_field/field'
2
+
3
+ class IssueLabelsCSVField < CSVField
4
+ def format
5
+ @data_container['labels'].join(' ')
6
+ end
7
+ end
@@ -7,10 +7,17 @@ class ClosedAfterDateFilter < Filter
7
7
  @last_allowed_date = last_allowed_date
8
8
  end
9
9
 
10
- def apply(target)
10
+ def include?(target)
11
11
  return true if @last_allowed_date.nil?
12
12
  return true if target['closed_at'].nil?
13
13
 
14
14
  Date.iso8601(target['closed_at']) > @last_allowed_date
15
15
  end
16
+
17
+ def apply(target)
18
+ return true if include? target
19
+
20
+ warn "Excluding '#{target['title']}' due to closed after date filter (#{target['web_url']})"
21
+ false
22
+ end
16
23
  end
@@ -7,9 +7,10 @@ class FilterList < Filter
7
7
  end
8
8
 
9
9
  def apply(target)
10
+ exclude = false
10
11
  @filters.each do |filter|
11
- return false unless filter.apply target
12
+ exclude = true unless filter.apply target
12
13
  end
13
- true
14
+ !exclude
14
15
  end
15
16
  end
@@ -6,9 +6,14 @@ class NoIncludeLabelsFilter < Filter
6
6
  @labels = labels
7
7
  end
8
8
 
9
+ def include?(target)
10
+ target['labels'].intersection(@labels).empty?
11
+ end
12
+
9
13
  def apply(target)
10
- should_include = target['labels'].intersection(@labels).empty?
11
- warn "Excluding '#{target['title']}' due to label filter" unless should_include
12
- should_include
14
+ return true if include? target
15
+
16
+ warn "Excluding '#{target['title']}' due to label filter (#{target['web_url']})"
17
+ false
13
18
  end
14
19
  end
@@ -6,13 +6,14 @@ require 'gitlab-burndown/csv_field/fields'
6
6
  require 'gitlab-burndown/csv_field/hour_estimate'
7
7
  require 'gitlab-burndown/csv_field/iid'
8
8
  require 'gitlab-burndown/csv_field/in_sprint'
9
+ require 'gitlab-burndown/csv_field/labels'
9
10
  require 'gitlab-burndown/csv_field/milestone'
10
11
  require 'gitlab-burndown/csv_field/title'
11
12
  require 'gitlab-burndown/csv_field/web_url'
12
13
 
13
14
  class IssueCSVGenerator < CSVGenerator
14
15
  def initialize(issues)
15
- super('IID;Title;Category;Milestone;Estimated hours;In current sprint;Is completed;Completed date;URL')
16
+ super('IID;Title;Category;Milestone;Estimated hours;In current sprint;Is completed;Completed date;Labels;URL')
16
17
  @issues = issues
17
18
  end
18
19
 
@@ -34,6 +35,7 @@ class IssueCSVGenerator < CSVGenerator
34
35
  IssueInSprintCSVField,
35
36
  IssueClosedStateCSVField,
36
37
  IssueClosedAtCSVField,
38
+ IssueLabelsCSVField,
37
39
  IssueWebURLCSVField
38
40
  )
39
41
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-burndown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Kruhlmann
@@ -28,6 +28,7 @@ files:
28
28
  - lib/gitlab-burndown/csv_field/hour_estimate.rb
29
29
  - lib/gitlab-burndown/csv_field/iid.rb
30
30
  - lib/gitlab-burndown/csv_field/in_sprint.rb
31
+ - lib/gitlab-burndown/csv_field/labels.rb
31
32
  - lib/gitlab-burndown/csv_field/milestone.rb
32
33
  - lib/gitlab-burndown/csv_field/title.rb
33
34
  - lib/gitlab-burndown/csv_field/web_url.rb