dev_metrics 0.1.0 → 0.1.1
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 +4 -4
- data/lib/dev_metrics/client.rb +2 -2
- data/lib/dev_metrics.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 18955085e7be6c6a43726926c4b77a93039d26ffb1433dc9d7487d30c0a345ff
|
|
4
|
+
data.tar.gz: 5e9b1bbe91561e5643399645f24f438f447ef060d85a5499e1a068c51e05d577
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fa1b4fd17cf2720ce19b49026e4f726252ae386cf153b6d9140c41f24da2efd56108eed7d8905b7d4b47891d111f8e2c28f768426d3b6a75ddeafdb37ad37668
|
|
7
|
+
data.tar.gz: 30c988f1a026536d4eff28d9365aa9e3d335fe3d70b7033a2b6101d40a8091aaa2816c9c30667cc050f98c2201befbcbeb4ddabbdee3d5189239eec9a75e53bf
|
data/lib/dev_metrics/client.rb
CHANGED
|
@@ -3,7 +3,6 @@ require 'uri'
|
|
|
3
3
|
require 'date'
|
|
4
4
|
require 'json'
|
|
5
5
|
require 'time'
|
|
6
|
-
require 'pry'
|
|
7
6
|
|
|
8
7
|
module DevMetrics
|
|
9
8
|
class Client
|
|
@@ -14,6 +13,7 @@ module DevMetrics
|
|
|
14
13
|
@repo_name = config.repo_name
|
|
15
14
|
@bot_accounts = config.bot_accounts || []
|
|
16
15
|
@access_token = config.access_token || ENV.fetch('GITHUB_ACCESS_TOKEN', nil)
|
|
16
|
+
@fix_branch_names = config.fix_branch_names || %w(hotfix fix rollback)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def process(period: Date.today)
|
|
@@ -58,7 +58,7 @@ module DevMetrics
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def count_correction_prs(prs)
|
|
61
|
-
prs.count { |pr| pr.dig('node', 'headRefName')&.match?(
|
|
61
|
+
prs.count { |pr| pr.dig('node', 'headRefName')&.match?(/^#{@fix_branch_names}/) }
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
def calculate_lead_time(prs)
|
data/lib/dev_metrics.rb
CHANGED
|
@@ -2,12 +2,13 @@ require_relative 'dev_metrics/markdown'
|
|
|
2
2
|
|
|
3
3
|
module DevMetrics
|
|
4
4
|
class Config
|
|
5
|
-
attr_accessor :access_token, :repo_name, :bot_accounts
|
|
5
|
+
attr_accessor :access_token, :repo_name, :bot_accounts, :fix_branch_names
|
|
6
6
|
|
|
7
7
|
def initialize
|
|
8
8
|
@access_token = nil
|
|
9
9
|
@repo_name = nil
|
|
10
10
|
@bot_accounts = nil
|
|
11
|
+
@fix_branch_names = nil
|
|
11
12
|
end
|
|
12
13
|
end
|
|
13
14
|
|
|
@@ -21,9 +22,8 @@ module DevMetrics
|
|
|
21
22
|
yield(configuration)
|
|
22
23
|
end
|
|
23
24
|
|
|
24
|
-
def self.run(format
|
|
25
|
-
# 設定を使用してMarkdownクラスを呼び出す
|
|
25
|
+
def self.run(period:, format:)
|
|
26
26
|
markdown_processor = format.new(@configuration)
|
|
27
|
-
markdown_processor.process(period:
|
|
27
|
+
markdown_processor.process(period: period)
|
|
28
28
|
end
|
|
29
29
|
end
|