jirametrics 1.0.1 → 1.0.2

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: 5e2bde3ef589f8b2ef51657edc5e4be9cbcfba35e05b969618f25f24b1682406
4
- data.tar.gz: ad4a4e2455d8af13f269ff241ace54716342106240ba1c6ae6b4f8a705fe69bf
3
+ metadata.gz: 393873fc1b78ea5456593282aab074b81e0b0f8a20451c40723de472da572223
4
+ data.tar.gz: 4bf51e683292de85dbf4ccc171817586f136a15f301814de38f6c4a9d1521f5c
5
5
  SHA512:
6
- metadata.gz: 0fe631431700ead7f918d81c7a7e7d0e304d7816edf73bf291eff5eb1cc88cc08b6fd1068cca9effc6b723093951e9cc905de9fdac409044537d752d6fc8e083
7
- data.tar.gz: dd16bb69f892e2aa47a42048c36200adf1880a4084e298c41811194b42666693411d849ef5f90088b64163debe7c3b00c7ba4c1af3208cbaf449c2e32263ea59
6
+ metadata.gz: 030ff4ea4a037b825eee453a8df5be4c5b10e6395e2c75788bc81bcdc08618e3f663b1befa25631761c9a5c62aed97527bdc0896139496237d2f96719b35cfdb
7
+ data.tar.gz: 6475e126ad0f632af902e480725c4cfac8aec0a6f756e202241c806939e60b879cca209bd1b29fe2b73af53fee3935210135aecd4a744ef58cb0e5d91ef330b4
@@ -52,7 +52,16 @@ class AggregateConfig
52
52
  end
53
53
 
54
54
  @included_projects << project
55
- @project_config.add_issues project.issues
55
+ if project.file_configs.empty?
56
+ issues = project.issues
57
+ else
58
+ issues = project.file_configs.first.issues
59
+ if project.file_configs.size > 1
60
+ puts 'More than one file section is defined. For the aggregated view, we always use ' \
61
+ 'the first file section'
62
+ end
63
+ end
64
+ @project_config.add_issues issues
56
65
  end
57
66
 
58
67
  def date_range range
@@ -51,18 +51,18 @@ class Exporter
51
51
  @downloading = false
52
52
  end
53
53
 
54
- def export
55
- @project_configs.each do |project|
54
+ def export name_filter:
55
+ each_project_config(name_filter: name_filter) do |project|
56
56
  project.evaluate_next_level
57
57
  project.run
58
58
  end
59
59
  end
60
60
 
61
- def download
61
+ def download name_filter:
62
62
  @downloading = true
63
63
  logfile_name = 'downloader.log'
64
64
  File.open logfile_name, 'w' do |logfile|
65
- @project_configs.each do |project|
65
+ each_project_config(name_filter: name_filter) do |project|
66
66
  project.evaluate_next_level
67
67
  next if project.aggregated_project?
68
68
 
@@ -76,6 +76,12 @@ class Exporter
76
76
  puts "Full output from downloader in #{logfile_name}"
77
77
  end
78
78
 
79
+ def each_project_config name_filter:
80
+ @project_configs.each do |project|
81
+ yield project if project.name.nil? || File.fnmatch(name_filter, project.name)
82
+ end
83
+ end
84
+
79
85
  def downloading?
80
86
  @downloading
81
87
  end
data/lib/jirametrics.rb CHANGED
@@ -4,17 +4,19 @@ require 'thor'
4
4
 
5
5
  class JiraMetrics < Thor
6
6
  option :config
7
+ option :name
7
8
  desc 'export', "Export data into either reports or CSV's as per the configuration"
8
9
  def export
9
10
  load_config options[:config]
10
- Exporter.instance.export
11
+ Exporter.instance.export(name_filter: options[:name] || '*')
11
12
  end
12
13
 
13
14
  option :config
15
+ option :name
14
16
  desc 'download', 'Download data from Jira'
15
17
  def download
16
18
  load_config options[:config]
17
- Exporter.instance.download
19
+ Exporter.instance.download(name_filter: options[:name] || '*')
18
20
  end
19
21
 
20
22
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jirametrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Bowler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-03 00:00:00.000000000 Z
11
+ date: 2023-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: random-word