git_ownership_insights 1.0.9 → 1.1.0

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: f7975c52466ff8152129983834939960192795ed43b63dc99e930d687cc8913f
4
- data.tar.gz: b7ab381e8916c57a5d942a9efbeea6a58563bc811bc868fb548b79dcd1a9889d
3
+ metadata.gz: 6b4e4cc30ba7171927e4abab4be4b0193352393d3690f0f687c4ac87518bc72c
4
+ data.tar.gz: 55ea9d63840f6d95bb5d4f071f712ca76f79b666d50f21b162a05b97a9adb47a
5
5
  SHA512:
6
- metadata.gz: 8cff237852117440dfead023b6e403cce0b0b78c83713fa73318d7c5c695ccd1d83aabe7310bd0534c9a79d8c827635cb31f4845a502d0a155837821a5ed7926
7
- data.tar.gz: 99185e95efb4e6d7316cdacd30270306be94caf3a2afa58af864acf4b6ccc95634c9b73937053a7747f77559915a26213c15829629e7a83ffc4f27677cbe9afe
6
+ metadata.gz: 220d887e9bda7878504ad5f8ae78247a0e8ad445b9bdfbd277334d7fb6505c9ff228232db65cd0009546789c11ea793b39aad53e64d6c6e6eed1980831485bc3
7
+ data.tar.gz: 11fc632f24d489cce44c3bf224fc787ef0ddfba4527c4017ec1553535571743ae071d901e153a0da870b9215b1b3db2de6bb48be04507bec5ea88a65d3e52ca2
@@ -49,7 +49,7 @@ module GitOwnershipInsights
49
49
 
50
50
  code_files = files.select do |f|
51
51
  extension = File.extname(f)
52
- valid_extensions = ['.swift', '.kt']
52
+ valid_extensions = CODE_EXTENSIONS
53
53
  valid_extensions.include?(extension)
54
54
  end
55
55
 
@@ -68,14 +68,12 @@ module GitOwnershipInsights
68
68
  def self.count_hotspot_lines(files)
69
69
  code_files = files.select do |f|
70
70
  extension = File.extname(f)
71
- valid_extensions = ['.swift', '.kt']
71
+ valid_extensions = CODE_EXTENSIONS
72
72
  valid_extensions.include?(extension)
73
73
  end
74
74
 
75
- # Initialize a counter for files that meet the criteria
76
75
  count = 0
77
76
 
78
- # Iterate through each file and check the line count
79
77
  code_files.each do |file|
80
78
  lines_count = File.foreach(file).reject { |line| line.match(%r{^\s*(//|/\*.*\*/|\s*$)}) }.count
81
79
 
@@ -85,6 +83,14 @@ module GitOwnershipInsights
85
83
  puts " *Total lines of hotspot code:* #{count}"
86
84
  end
87
85
 
86
+ def self.filter_code_files(files)
87
+ files.select do |f|
88
+ extension = File.extname(f)
89
+ valid_extensions = CODE_EXTENSIONS
90
+ valid_extensions.include?(extension)
91
+ end
92
+ end
93
+
88
94
  def self.contribution_message(directory_path:, duration_in_days:, begin_time:, debug: nil, steps: nil)
89
95
  duration_in_days = duration_in_days.to_i
90
96
  all_teams = []
@@ -98,11 +104,7 @@ module GitOwnershipInsights
98
104
  all_files_with_changes = `git log --name-only --pretty=format:"" --since="#{start_date}" --until="#{end_date}" "#{directory_path}"`.split.sort
99
105
  excluded_patterns = EXCLUDED_FILES.split(',') if EXCLUDED_FILES
100
106
 
101
- code_files_with_changes = all_files_with_changes.select do |f|
102
- extension = File.extname(f)
103
- valid_extensions = CODE_EXTENSIONS
104
- valid_extensions.include?(extension)
105
- end
107
+ code_files_with_changes = filter_code_files(all_files_with_changes)
106
108
 
107
109
  if EXCLUDED_FILES
108
110
  code_files_with_changes = code_files_with_changes.reject do |file|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitOwnershipInsights
4
- VERSION = '1.0.9'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_ownership_insights
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.1.0
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-01-26 00:00:00.000000000 Z
11
+ date: 2024-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: date