gitingest 0.6.2 → 0.6.3
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/CHANGELOG.md +5 -0
- data/index.html +31 -13
- data/lib/gitingest/generator.rb +51 -13
- data/lib/gitingest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f6ba5c5ad2194b133eba160ccfe3e5a09313174eabe75aa001b8e6504822961
|
4
|
+
data.tar.gz: 72e8160b0cfc168e8503578a611c3592b0f8b7cadd25f1c14d86401e41f768aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c332a1d0c70e8bc5cdf9583830b27568b0bad48bde4579fce40634d139f47d77b1dd68d39313142ecb474d8dcfb36cbb2f1f42d8e51e58a64c7fa994822fe6ea
|
7
|
+
data.tar.gz: 89407c94365c307071e39dd7e598d7e1cc2ea1afc6206fea92bacdc66ae1e85ac8feba6e95d89238cd6444eb9b45251d71dcf2e2ef365fa73472489e376aceb9
|
data/CHANGELOG.md
CHANGED
data/index.html
CHANGED
@@ -716,7 +716,7 @@
|
|
716
716
|
<div class="header-container">
|
717
717
|
<div class="logo">
|
718
718
|
<div class="logo-icon">G</div>
|
719
|
-
<div class="logo-text">Gitingest <span class="version-tag">v0.6.
|
719
|
+
<div class="logo-text">Gitingest <span class="version-tag">v0.6.3</span></div>
|
720
720
|
</div>
|
721
721
|
<nav>
|
722
722
|
<ul>
|
@@ -765,7 +765,7 @@
|
|
765
765
|
<span class="terminal-command">gem install gitingest</span>
|
766
766
|
</div>
|
767
767
|
<div class="terminal-output">
|
768
|
-
Successfully installed gitingest-0.6.
|
768
|
+
Successfully installed gitingest-0.6.3<br />
|
769
769
|
1 gem installed
|
770
770
|
</div>
|
771
771
|
<div class="terminal-line">
|
@@ -902,6 +902,24 @@ gitingest --repository user/repo --show-structure</code></pre>
|
|
902
902
|
<div class="container">
|
903
903
|
<h2>Changelog</h2>
|
904
904
|
<div class="timeline">
|
905
|
+
<div class="timeline-item">
|
906
|
+
<div class="timeline-date">
|
907
|
+
<span class="timeline-month">Apr</span>
|
908
|
+
<span class="timeline-day">15</span>
|
909
|
+
</div>
|
910
|
+
<div class="timeline-content">
|
911
|
+
<h3 class="timeline-version">v0.6.3</h3>
|
912
|
+
<p class="timeline-desc">Fixed directory exclusion pattern to properly handle paths ending with
|
913
|
+
slash.</p>
|
914
|
+
<div class="timeline-list">
|
915
|
+
<ul>
|
916
|
+
<li>Enhanced file exclusion logic to correctly filter directories when patterns end with
|
917
|
+
'/'</li>
|
918
|
+
<li>Improved spec test coverage for directory exclusion patterns</li>
|
919
|
+
</ul>
|
920
|
+
</div>
|
921
|
+
</div>
|
922
|
+
</div>
|
905
923
|
<div class="timeline-item">
|
906
924
|
<div class="timeline-date">
|
907
925
|
<span class="timeline-month">Apr</span>
|
@@ -996,21 +1014,21 @@ gitingest --repository user/repo --show-structure</code></pre>
|
|
996
1014
|
<span class="timeline-month">Mar</span>
|
997
1015
|
<span class="timeline-day">03</span>
|
998
1016
|
</div>
|
999
|
-
<div class="timeline-content">
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
</div>
|
1017
|
+
<div class="timeline-content"></div>
|
1018
|
+
<h3 class="timeline-version">v0.3.1</h3>
|
1019
|
+
<p class="timeline-desc">Optimized threading with configurable options and introduced
|
1020
|
+
exponential backoff for API requests.</p>
|
1021
|
+
<div class="timeline-list">
|
1022
|
+
<ul>
|
1023
|
+
<li>Configurable threading options</li>
|
1024
|
+
<li>Added thread-local buffers</li>
|
1025
|
+
<li>Improved file exclusion performance</li>
|
1026
|
+
</ul>
|
1010
1027
|
</div>
|
1011
1028
|
</div>
|
1012
1029
|
</div>
|
1013
1030
|
</div>
|
1031
|
+
</div>
|
1014
1032
|
</section>
|
1015
1033
|
|
1016
1034
|
<footer class="footer">
|
data/lib/gitingest/generator.rb
CHANGED
@@ -181,21 +181,49 @@ module Gitingest
|
|
181
181
|
end
|
182
182
|
end
|
183
183
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
184
|
+
# Builds a single regex from the combined default and custom exclusion patterns.
|
185
|
+
# Handles glob patterns and directory patterns (ending with /).
|
186
|
+
#
|
187
|
+
# @return [Regexp] The combined exclusion regex.
|
188
|
+
def build_exclusion_regex
|
189
|
+
combined_patterns = DEFAULT_EXCLUDES + @options.fetch(:exclude, [])
|
190
|
+
regex_parts = combined_patterns.map do |pattern|
|
191
|
+
if pattern.end_with?("/")
|
192
|
+
# Directory pattern: Match anything starting with this path
|
193
|
+
"^#{Regexp.escape(pattern)}"
|
194
|
+
else
|
195
|
+
# File or glob pattern: Convert glob to regex
|
196
|
+
glob_to_regex(pattern)
|
196
197
|
end
|
197
198
|
end
|
198
|
-
|
199
|
+
# Combine all parts, ensuring they match the full path or directory prefix
|
200
|
+
Regexp.new(regex_parts.join("|"))
|
201
|
+
end
|
202
|
+
|
203
|
+
# Converts a glob pattern to a Regexp string.
|
204
|
+
# Handles *, **, ?, and character classes.
|
205
|
+
# Ensures the pattern matches the entire string by default.
|
206
|
+
#
|
207
|
+
# @param glob [String] The glob pattern.
|
208
|
+
# @return [String] The regex pattern string.
|
209
|
+
def glob_to_regex(glob)
|
210
|
+
# More robust glob conversion
|
211
|
+
regex = glob.gsub(%r{/\*\*($|/)}, '/.*\\1') # Handle **/ and ** at end
|
212
|
+
.gsub("*", "[^/]*") # Match * within path segments
|
213
|
+
.gsub("?", "[^/]") # Match ? within path segments
|
214
|
+
.gsub(".", '\\.') # Escape dots
|
215
|
+
.gsub("{", "(") # Convert { to ( for grouping
|
216
|
+
.gsub("}", ")") # Convert } to ) for grouping
|
217
|
+
.gsub(",", "|") # Convert , to | for OR within groups
|
218
|
+
|
219
|
+
# Ensure the pattern matches the full path unless it was originally a directory pattern
|
220
|
+
# (which is handled separately now) or contains wildcards suggesting partial match.
|
221
|
+
# If it contains no wildcards, anchor it.
|
222
|
+
if glob.include?("*") || glob.include?("?") || glob.include?("{")
|
223
|
+
regex # Allow partial matching for wildcards
|
224
|
+
else
|
225
|
+
"^#{regex}$" # Anchor exact matches
|
226
|
+
end
|
199
227
|
end
|
200
228
|
|
201
229
|
def fetch_repository_contents
|
@@ -239,6 +267,16 @@ module Gitingest
|
|
239
267
|
|
240
268
|
def excluded_file?(path)
|
241
269
|
return true if path.match?(DOT_FILE_PATTERN)
|
270
|
+
|
271
|
+
# Check for directory exclusion patterns (ending with '/')
|
272
|
+
@options[:exclude].each do |pattern|
|
273
|
+
if pattern.end_with?("/") && path.start_with?(pattern)
|
274
|
+
@logger.debug "Excluding #{path} (matched directory pattern #{pattern})" if @logger.debug?
|
275
|
+
return true
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
# Continue with regular pattern checks
|
242
280
|
return true if @default_patterns.any? { |pattern| path.match?(pattern) }
|
243
281
|
return true if @custom_patterns.any? { |pattern| path.match?(pattern) }
|
244
282
|
|
data/lib/gitingest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitingest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Davide Santangelo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-04-
|
11
|
+
date: 2025-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|