github_repo_statistics 2.2.29 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8841de37fee015b614072106fd7a7753f081744a54b86de099188127ecf509ab
4
- data.tar.gz: 4193b4ba131d09344cc59918e3972883084ddd5ee3cb04caa01cdc35de966449
3
+ metadata.gz: e27a6a13a4ce688ed3bda40c18cb6eb74ad11f4d0976009a681a21892fdadce5
4
+ data.tar.gz: cbcc63cb44bbfbdd50e4c6f7d5b14efdc6672a0c303d6f0a4226fed64a83b98c
5
5
  SHA512:
6
- metadata.gz: 43143569d88a3d8b666531ef76311c73d3801da1a830ed6c125398ef02c73ddfd54e6d8b90dfedc324eb21d77c6ceed646f20fda59f283be2c6c4e00f087cbc4
7
- data.tar.gz: e57bff89312909805541d04d6c83ce657d06006f16bc7e199cdf51c2dec90183ee1eed5bffe7939d77c4bae24d4a26e797209256b8f594e69dc1660b27c4f966
6
+ metadata.gz: ac54df8ecee12b70d3680668e3aa112ae7b694c3f5da2f56a95a7d87399c8e0a91f9ac3cebf703e427839bf179c81ec005d3f811c25110912b0f8bcd7ee30f97
7
+ data.tar.gz: 33fb0160c53b81602df8eff54904148b9932c6ff461b1cca5caca6a6dd53d1facc1fef036606eb68e8605550f4dd1be0f958cd85c08ab56f54dfd918e26cd358
@@ -181,6 +181,10 @@ class GithubRepoStatistics
181
181
  `git log origin/master --pretty=format:"%s" --since="#{start_date}" --until="#{end_date}" -- "#{file}"`
182
182
  end
183
183
 
184
+ def new_changes?(file:)
185
+ git_commit_info(file:, start_date: DateTime.now - 7, end_date: DateTime.now) == "" ? false : true
186
+ end
187
+
184
188
  def analyze_changed_files(uniq_code_files_with_changes:, start_date:, end_date:)
185
189
  all_teams = []
186
190
  cross_teams_count = 0
@@ -330,15 +334,16 @@ class GithubRepoStatistics
330
334
  commits = line.last.last
331
335
  owner = find_owner(file:)
332
336
  prs = line.last[1]
337
+ new_change = new_changes?(file:)
333
338
 
334
- hotspot_output << [file.gsub(@directory_path, ''), contributors, lines_of_code, commits, owner, prs]
339
+ hotspot_output << [file.gsub(@directory_path, ''), new_change, contributors, lines_of_code, commits, owner, prs]
335
340
  end
336
341
 
337
- hotspot_output.sort_by! { |row| -row[2] }
342
+ hotspot_output.sort_by! { |row| -row[3] }
338
343
 
339
344
  if FILE_OUTPUT
340
345
  CSV.open('hotspot.csv', 'w') do |csv|
341
- csv << ['File', 'Contributors', 'Lines', 'Commits', 'Owner', 'PRs']
346
+ csv << ['File', 'Updated in the past week', 'Contributors', 'Lines', 'Commits', 'Owner', 'PRs']
342
347
  hotspot_output.each do |row|
343
348
  csv << row
344
349
  end
@@ -346,7 +351,7 @@ class GithubRepoStatistics
346
351
  else
347
352
  puts "\n *Hotspot files(#{filtered_top_touched_files.count}):*\n"
348
353
  hotspot_output.each do |row|
349
- puts " #{row[0]} Contributors: #{row[1]} Lines: #{row[2]} Commits: #{row[3]} Owner: #{row[4]} PRs: #{row[5]}"
354
+ puts " #{row[0]} Contributors: #{row[1]} Updated in the past week: #{row[2]} Lines: #{row[3]} Commits: #{row[4]} Owner: #{row[5]} PRs: #{row[6]}"
350
355
  end
351
356
  end
352
357
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GithubRepoStatistics
4
- VERSION = '2.2.29'
4
+ VERSION = '2.3.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_repo_statistics
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.29
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serghei Moret
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-07 00:00:00.000000000 Z
11
+ date: 2024-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: date