recls-ruby 2.13.2 → 2.13.5
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/AUTHORS.md +21 -0
- data/CHANGES.md +222 -0
- data/CONTRIBUTING.md +36 -0
- data/EXAMPLES.md +11 -0
- data/FAQ.md +28 -0
- data/INSTALL.md +41 -0
- data/LICENSE +3 -5
- data/NEWS.md +43 -0
- data/README.md +79 -35
- data/Rakefile +21 -1
- data/SECURITY.md +23 -0
- data/TODO.md +24 -0
- data/examples/find_files_and_directories.md +3 -2
- data/examples/find_files_and_directories.recursive.md +3 -2
- data/examples/show_hidden_files.md +9 -4
- data/examples/show_readonly_files.md +8 -4
- data/lib/recls/api.rb +2 -1
- data/lib/recls/combine_paths_1.rb +3 -2
- data/lib/recls/combine_paths_2plus.rb +3 -2
- data/lib/recls/entry.rb +2 -1
- data/lib/recls/file_search.rb +3 -2
- data/lib/recls/flags.rb +2 -1
- data/lib/recls/foreach.rb +2 -1
- data/lib/recls/obsolete.rb +2 -1
- data/lib/recls/recls.rb +2 -1
- data/lib/recls/stat.rb +2 -1
- data/lib/recls/util.rb +2 -1
- data/lib/recls/version.rb +4 -3
- data/lib/recls/ximpl/os.rb +2 -1
- data/lib/recls/ximpl/unix.rb +19 -4
- data/lib/recls/ximpl/util.rb +9 -3
- data/lib/recls/ximpl/windows.rb +29 -6
- data/lib/recls.rb +2 -1
- data/test/unit/test_all_separately.cmd +5 -5
- data/test/unit/util/tc_combine_paths.rb +0 -1
- metadata +41 -14
data/TODO.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# recls.Ruby - TODO <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Functional improvements
|
|
5
|
+
|
|
6
|
+
* \<none>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Performance improvements
|
|
10
|
+
|
|
11
|
+
* \<none>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Packaging improvements
|
|
15
|
+
|
|
16
|
+
* [x] ~~~complete **.github/workflows/ruby.yml** (matrix, gem smoke, warnings job) to match **xqsr3**~~~;
|
|
17
|
+
* [x] ~~~implement **Rakefile** `test` / `default` tasks for `bundle exec rake test`~~~;
|
|
18
|
+
* [x] ~~~fix **recls.gemspec** metadata URIs and homepage to **recls.Ruby** (HTTPS)~~~;
|
|
19
|
+
* [x] ~~~rename gemspec so the filename stem matches `spec.name` (`recls.gemspec` → **recls-ruby.gemspec**)~~~;
|
|
20
|
+
* [x] ~~~obtain a **run_all_unit_tests.sh** (from **misc-dev-scripts**) that skips `tput` when `$TERM` is unset or stdout is not a TTY (CI: `tput: No value for $TERM and no -T specified`)~~~;
|
|
21
|
+
* [x] ~~~after this packaging/boilerplate/CI lift: bump **VERSION** to **2.13.4** and align the gem~~~;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<!-- ########################### end of file ########################### -->
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
# recls.Ruby Example - **find_files_and_directories**
|
|
1
|
+
# recls.Ruby - Example - **find_files_and_directories**
|
|
2
2
|
|
|
3
3
|
## Summary
|
|
4
4
|
|
|
5
|
-
Illustrates finding of FILES, then DIRECTORIES, then both
|
|
5
|
+
Illustrates non-recursive finding of FILES, then DIRECTORIES, then both.
|
|
6
|
+
|
|
6
7
|
|
|
7
8
|
## Source
|
|
8
9
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
# recls.Ruby Example - **find_files_and_directories.recursive**
|
|
1
|
+
# recls.Ruby - Example - **find_files_and_directories.recursive**
|
|
2
2
|
|
|
3
3
|
## Summary
|
|
4
4
|
|
|
5
|
-
Illustrates recursive finding of FILES, then DIRECTORIES, then both
|
|
5
|
+
Illustrates recursive finding of FILES, then DIRECTORIES, then both.
|
|
6
|
+
|
|
6
7
|
|
|
7
8
|
## Source
|
|
8
9
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
# recls.Ruby Example - **show_hidden_files**
|
|
1
|
+
# recls.Ruby - Example - **show_hidden_files**
|
|
2
2
|
|
|
3
3
|
## Summary
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Illustrates recursive searching for hidden files via `Recls::SHOW_HIDDEN` and filtering with `Recls::Entry#hidden?`.
|
|
6
|
+
|
|
6
7
|
|
|
7
8
|
## Source
|
|
8
9
|
|
|
@@ -23,9 +24,14 @@ Recls.file_rsearch('.', Recls::WILDCARDS_ALL, Recls::FILES | Recls::SHOW_HIDDEN)
|
|
|
23
24
|
end
|
|
24
25
|
```
|
|
25
26
|
|
|
27
|
+
|
|
26
28
|
## Discussion
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
By default, searches omit hidden entries. Including `Recls::SHOW_HIDDEN` causes
|
|
31
|
+
them to be returned; the example then keeps only those for which `#hidden?` is
|
|
32
|
+
true. (The older `Recls.file_rsearch` name is retained for compatibility;
|
|
33
|
+
`Recls.rsearch` is preferred.)
|
|
34
|
+
|
|
29
35
|
|
|
30
36
|
## Example results
|
|
31
37
|
|
|
@@ -39,4 +45,3 @@ TBC
|
|
|
39
45
|
|
|
40
46
|
|
|
41
47
|
<!-- ########################### end of file ########################### -->
|
|
42
|
-
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
# recls.Ruby Example - **show_hidden_files**
|
|
1
|
+
# recls.Ruby - Example - **show_hidden_files**
|
|
2
2
|
|
|
3
3
|
## Summary
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Illustrates recursive searching for read-only files by filtering with `Recls::Entry#readonly?`.
|
|
6
|
+
|
|
6
7
|
|
|
7
8
|
## Source
|
|
8
9
|
|
|
@@ -22,9 +23,13 @@ Recls.file_rsearch('.', Recls::WILDCARDS_ALL, Recls::FILES).each do |fe|
|
|
|
22
23
|
end
|
|
23
24
|
```
|
|
24
25
|
|
|
26
|
+
|
|
25
27
|
## Discussion
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
Unlike hidden entries, read-only files are returned by a normal files search;
|
|
30
|
+
filtering is done solely via `#readonly?`. (The older `Recls.file_rsearch` name
|
|
31
|
+
is retained for compatibility; `Recls.rsearch` is preferred.)
|
|
32
|
+
|
|
28
33
|
|
|
29
34
|
## Example results
|
|
30
35
|
|
|
@@ -35,4 +40,3 @@ TBC
|
|
|
35
40
|
|
|
36
41
|
|
|
37
42
|
<!-- ########################### end of file ########################### -->
|
|
38
|
-
|
data/lib/recls/api.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/api.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Defines Recls module search functions
|
|
5
6
|
#
|
|
6
7
|
# Created: 9th June 2016
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/compare_paths_1.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Definition of Recls::compare_paths() for Ruby 1.x
|
|
5
6
|
#
|
|
6
7
|
# Created: 17th February 2014
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
|
@@ -77,7 +78,7 @@ module Recls
|
|
|
77
78
|
|
|
78
79
|
if fe.directory?
|
|
79
80
|
|
|
80
|
-
paths = paths[ix_last_entry
|
|
81
|
+
paths = paths[ix_last_entry..-1]
|
|
81
82
|
else
|
|
82
83
|
|
|
83
84
|
return fe
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/compare_paths_2plus.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Definition of Recls::compare_paths() for Ruby 2+
|
|
5
6
|
#
|
|
6
7
|
# Created: 17th February 2014
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
|
@@ -83,7 +84,7 @@ module Recls
|
|
|
83
84
|
|
|
84
85
|
if fe.directory?
|
|
85
86
|
|
|
86
|
-
paths = paths[ix_last_entry
|
|
87
|
+
paths = paths[ix_last_entry..-1]
|
|
87
88
|
else
|
|
88
89
|
|
|
89
90
|
return fe
|
data/lib/recls/entry.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/entry.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Defines the Recls::Entry class for the recls.Ruby library.
|
|
5
6
|
#
|
|
6
7
|
# Created: 24th July 2012
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
data/lib/recls/file_search.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/file_search.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Defines the Recls::FileSearch class for the recls.Ruby library.
|
|
5
6
|
#
|
|
6
7
|
# Created: 24th July 2012
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
|
@@ -203,7 +204,7 @@ module Recls
|
|
|
203
204
|
rescue Errno::ENOENT, Errno::ENXIO
|
|
204
205
|
|
|
205
206
|
nil
|
|
206
|
-
rescue SystemCallError
|
|
207
|
+
rescue SystemCallError
|
|
207
208
|
|
|
208
209
|
# TODO this should be filtered up and/or logged
|
|
209
210
|
|
data/lib/recls/flags.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/flags.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Defines the Recls::Flags module for the recls.Ruby library.
|
|
5
6
|
#
|
|
6
7
|
# Created: 24th July 2012
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
data/lib/recls/foreach.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/foreach.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Definition of Recls::foreach() utility function
|
|
5
6
|
#
|
|
6
7
|
# Created: 22nd October 2014
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
data/lib/recls/obsolete.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/obsolete.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Obsolete elements
|
|
5
6
|
#
|
|
6
7
|
# Created: 19th July 2012
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
data/lib/recls/recls.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/recls.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Main source file for recls library
|
|
5
6
|
#
|
|
6
7
|
# Created: 19th July 2012
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
data/lib/recls/stat.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/stat.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Defines the Recls.stat() method for the recls.Ruby library.
|
|
5
6
|
#
|
|
6
7
|
# Created: 24th July 2012
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
data/lib/recls/util.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/util.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Utility module functions for recls library
|
|
5
6
|
#
|
|
6
7
|
# Created: 17th February 2014
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
data/lib/recls/version.rb
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/version.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Version for recls library
|
|
5
6
|
#
|
|
6
7
|
# Created: 14th February 2014
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 30th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
|
11
|
-
# Copyright (c) 2019-
|
|
12
|
+
# Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems
|
|
12
13
|
# Copyright (c) 2012-2019, Matthew Wilson and Synesis Software
|
|
13
14
|
# All rights reserved.
|
|
14
15
|
#
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
module Recls
|
|
44
45
|
|
|
45
46
|
# Current version of the recls.Ruby library
|
|
46
|
-
VERSION = '2.13.
|
|
47
|
+
VERSION = '2.13.5'
|
|
47
48
|
|
|
48
49
|
private
|
|
49
50
|
# @!visibility private
|
data/lib/recls/ximpl/os.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/ximpl/os.rb
|
|
3
4
|
#
|
|
@@ -5,7 +6,7 @@
|
|
|
5
6
|
# recls library.
|
|
6
7
|
#
|
|
7
8
|
# Created: 16th February 2014
|
|
8
|
-
# Updated:
|
|
9
|
+
# Updated: 15th August 2026
|
|
9
10
|
#
|
|
10
11
|
# Author: Matthew Wilson
|
|
11
12
|
#
|
data/lib/recls/ximpl/unix.rb
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/ximpl/unix.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: UNIX-specific constructs for the recls library.
|
|
5
6
|
#
|
|
6
7
|
# Created: 19th February 2014
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
|
11
|
-
# Copyright (c) 2019-
|
|
12
|
+
# Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
|
|
12
13
|
# Copyright (c) 2012-2019, Matthew Wilson and Synesis Software
|
|
13
14
|
# All rights reserved.
|
|
14
15
|
#
|
|
@@ -48,15 +49,19 @@ module Recls
|
|
|
48
49
|
# @!visibility private
|
|
49
50
|
module Ximpl # :nodoc: all
|
|
50
51
|
|
|
52
|
+
# File::Stat cannot reliably be subclassed on all Rubies (notably some
|
|
53
|
+
# Ruby 4 / MinGW builds raise TypeError: wrong instance allocation).
|
|
54
|
+
# Compose instead and forward File::Stat APIs via method_missing.
|
|
55
|
+
#
|
|
51
56
|
# @!visibility private
|
|
52
|
-
class FileStat
|
|
57
|
+
class FileStat # :nodoc:
|
|
53
58
|
|
|
54
59
|
private
|
|
55
60
|
def initialize(path)
|
|
56
61
|
|
|
57
62
|
@path = path
|
|
58
63
|
|
|
59
|
-
|
|
64
|
+
@stat = ::File::Stat.new(path)
|
|
60
65
|
end
|
|
61
66
|
|
|
62
67
|
public
|
|
@@ -74,6 +79,16 @@ module Recls
|
|
|
74
79
|
return true
|
|
75
80
|
end
|
|
76
81
|
|
|
82
|
+
def method_missing(name, *args, &block)
|
|
83
|
+
|
|
84
|
+
@stat.__send__(name, *args, &block)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def respond_to_missing?(name, include_all = false)
|
|
88
|
+
|
|
89
|
+
@stat.respond_to?(name, include_all) || super
|
|
90
|
+
end
|
|
91
|
+
|
|
77
92
|
public
|
|
78
93
|
def FileStat.stat(path)
|
|
79
94
|
|
data/lib/recls/ximpl/util.rb
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/ximpl/util.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Internal implementation constructs for the recls library.
|
|
5
6
|
#
|
|
6
7
|
# Created: 24th July 2012
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
|
11
|
-
# Copyright (c) 2019-
|
|
12
|
+
# Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
|
|
12
13
|
# Copyright (c) 2012-2019, Matthew Wilson and Synesis Software
|
|
13
14
|
# All rights reserved.
|
|
14
15
|
#
|
|
@@ -501,7 +502,12 @@ module Recls
|
|
|
501
502
|
|
|
502
503
|
f1_windows_root, f2_directory, dummy1, dummy2, dummy3, dummy4, dummy5 = Util.split_path(path)
|
|
503
504
|
|
|
504
|
-
|
|
505
|
+
# suppress unused warnings
|
|
506
|
+
dummy1 = dummy1
|
|
507
|
+
dummy2 = dummy2
|
|
508
|
+
dummy3 = dummy3
|
|
509
|
+
dummy4 = dummy4
|
|
510
|
+
dummy5 = dummy5
|
|
505
511
|
|
|
506
512
|
unless f1_windows_root
|
|
507
513
|
|
data/lib/recls/ximpl/windows.rb
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls/ximpl/windows.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Windows-specific constructs for the recls library.
|
|
5
6
|
#
|
|
6
7
|
# Created: 19th February 2014
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
|
11
|
-
# Copyright (c) 2019-
|
|
12
|
+
# Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
|
|
12
13
|
# Copyright (c) 2012-2019, Matthew Wilson and Synesis Software
|
|
13
14
|
# All rights reserved.
|
|
14
15
|
#
|
|
@@ -39,8 +40,15 @@
|
|
|
39
40
|
|
|
40
41
|
if RUBY_VERSION >= '2'
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
begin
|
|
44
|
+
|
|
45
|
+
require 'fiddle'
|
|
46
|
+
require 'fiddle/import'
|
|
47
|
+
rescue LoadError => e
|
|
48
|
+
|
|
49
|
+
# Ruby 4+ no longer ships fiddle as a default gem.
|
|
50
|
+
raise LoadError, "#{e.message}; on Ruby 4+ Windows, add the 'fiddle' gem (see the project Gemfile)"
|
|
51
|
+
end
|
|
44
52
|
else
|
|
45
53
|
|
|
46
54
|
require 'Win32API'
|
|
@@ -211,8 +219,12 @@ module Recls
|
|
|
211
219
|
end # module Kernel32
|
|
212
220
|
end
|
|
213
221
|
|
|
222
|
+
# File::Stat cannot reliably be subclassed on all Rubies (notably some
|
|
223
|
+
# Ruby 4 / MinGW builds raise TypeError: wrong instance allocation).
|
|
224
|
+
# Compose instead and forward File::Stat APIs via method_missing.
|
|
225
|
+
#
|
|
214
226
|
# @!visibility private
|
|
215
|
-
class FileStat
|
|
227
|
+
class FileStat # :nodoc:
|
|
216
228
|
|
|
217
229
|
private
|
|
218
230
|
FILE_ATTRIBUTE_READONLY = 0x00000001
|
|
@@ -260,7 +272,7 @@ module Recls
|
|
|
260
272
|
|
|
261
273
|
@attributes = Kernel32.get_file_attributes(path)
|
|
262
274
|
|
|
263
|
-
|
|
275
|
+
@stat = ::File::Stat.new(path)
|
|
264
276
|
|
|
265
277
|
@by_handle_information = ByHandleInformation.new(path)
|
|
266
278
|
|
|
@@ -328,6 +340,17 @@ module Recls
|
|
|
328
340
|
has_attribute_? FILE_ATTRIBUTE_ENCRYPTED
|
|
329
341
|
end
|
|
330
342
|
|
|
343
|
+
# @!visibility private
|
|
344
|
+
def method_missing(name, *args, &block) # :nodoc:
|
|
345
|
+
|
|
346
|
+
@stat.__send__(name, *args, &block)
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
# @!visibility private
|
|
350
|
+
def respond_to_missing?(name, include_all = false) # :nodoc:
|
|
351
|
+
|
|
352
|
+
@stat.respond_to?(name, include_all) || super
|
|
353
|
+
end
|
|
331
354
|
|
|
332
355
|
public
|
|
333
356
|
# @!visibility private
|
data/lib/recls.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: recls.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Top-level include for recls.Ruby library
|
|
5
6
|
#
|
|
6
7
|
# Created: 13th January 2012
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
|
|
3
|
-
echo Executing all ruby tests, each in a separate process:
|
|
4
|
-
for %i in (*.rb) do @ruby "%i"
|
|
5
|
-
|
|
1
|
+
@echo off
|
|
2
|
+
|
|
3
|
+
echo Executing all ruby tests, each in a separate process:
|
|
4
|
+
for %i in (*.rb) do @ruby "%i"
|
|
5
|
+
|
|
@@ -113,7 +113,6 @@ class Test_combine_paths < Test::Unit::TestCase
|
|
|
113
113
|
|
|
114
114
|
f_g = Recls.stat('/f/g', Recls::DETAILS_LATER | Recls::DIRECTORIES)
|
|
115
115
|
b = Recls.stat('b', Recls::DETAILS_LATER | Recls::DIRECTORIES)
|
|
116
|
-
root_b = Recls.stat('/b', Recls::DETAILS_LATER | Recls::DIRECTORIES)
|
|
117
116
|
|
|
118
117
|
assert_equal '/a/b/c/d/e/f/g', Recls.combine_paths('/', 'a', 'b', 'c', 'd/e', 'f/g')
|
|
119
118
|
assert_equal '/f/g', Recls.combine_paths('/', 'a', 'b', 'c', 'd/e', '/f/g')
|
metadata
CHANGED
|
@@ -1,40 +1,62 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: recls-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.13.
|
|
4
|
+
version: 2.13.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Wilson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-08-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: xqsr3
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 0.39.5
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '1.0'
|
|
20
23
|
type: :development
|
|
21
24
|
prerelease: false
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
26
|
requirements:
|
|
24
|
-
- - "
|
|
27
|
+
- - ">="
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: 0.39.5
|
|
30
|
+
- - "<"
|
|
25
31
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0
|
|
27
|
-
description:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
version: '1.0'
|
|
33
|
+
description: |
|
|
34
|
+
recls.Ruby is a platform-independent recursive file-system search library
|
|
35
|
+
for Ruby. It enumerates files and directories (recursively or not),
|
|
36
|
+
optionally filtered by wildcards and type flags, and returns each hit as a
|
|
37
|
+
rich entry object with path components, type, size, and timestamps
|
|
38
|
+
(including Windows-specific attributes where they exist). Path-combination
|
|
39
|
+
and existence helpers are included so client code can stay on one API.
|
|
40
|
+
The name stands for rec-ursive ls; this gem is the Ruby implementation of
|
|
41
|
+
the recls family (also available for C/C++, Go, .NET, Python, and Rust).
|
|
42
|
+
email:
|
|
43
|
+
- matthew@synesis.com.au
|
|
31
44
|
executables: []
|
|
32
45
|
extensions: []
|
|
33
46
|
extra_rdoc_files: []
|
|
34
47
|
files:
|
|
48
|
+
- AUTHORS.md
|
|
49
|
+
- CHANGES.md
|
|
50
|
+
- CONTRIBUTING.md
|
|
51
|
+
- EXAMPLES.md
|
|
52
|
+
- FAQ.md
|
|
53
|
+
- INSTALL.md
|
|
35
54
|
- LICENSE
|
|
55
|
+
- NEWS.md
|
|
36
56
|
- README.md
|
|
37
57
|
- Rakefile
|
|
58
|
+
- SECURITY.md
|
|
59
|
+
- TODO.md
|
|
38
60
|
- examples/find_files_and_directories.md
|
|
39
61
|
- examples/find_files_and_directories.rb
|
|
40
62
|
- examples/find_files_and_directories.recursive.md
|
|
@@ -81,10 +103,14 @@ files:
|
|
|
81
103
|
- test/unit/ts_all.rb
|
|
82
104
|
- test/unit/util/tc_combine_paths.rb
|
|
83
105
|
- test/unit/util/ts_all.rb
|
|
84
|
-
homepage:
|
|
106
|
+
homepage: https://github.com/synesissoftware/recls.Ruby
|
|
85
107
|
licenses:
|
|
86
108
|
- BSD-3-Clause
|
|
87
|
-
metadata:
|
|
109
|
+
metadata:
|
|
110
|
+
bug_tracker_uri: https://github.com/synesissoftware/recls.Ruby/issues
|
|
111
|
+
changelog_uri: https://github.com/synesissoftware/recls.Ruby/blob/master/CHANGES.md
|
|
112
|
+
homepage_uri: https://github.com/synesissoftware/recls.Ruby
|
|
113
|
+
source_code_uri: https://github.com/synesissoftware/recls.Ruby
|
|
88
114
|
post_install_message:
|
|
89
115
|
rdoc_options: []
|
|
90
116
|
require_paths:
|
|
@@ -100,8 +126,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
100
126
|
- !ruby/object:Gem::Version
|
|
101
127
|
version: '0'
|
|
102
128
|
requirements: []
|
|
103
|
-
|
|
129
|
+
rubyforge_project:
|
|
130
|
+
rubygems_version: 2.7.6.3
|
|
104
131
|
signing_key:
|
|
105
132
|
specification_version: 4
|
|
106
|
-
summary:
|
|
133
|
+
summary: The platform-independent recursive file-system search library, for Ruby
|
|
107
134
|
test_files: []
|