recls-ruby 2.11.0.3 → 2.12.0
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/LICENSE +24 -27
- data/README.md +1 -242
- data/examples/find_files_and_directories.md +30 -33
- data/examples/find_files_and_directories.recursive.md +254 -255
- data/examples/show_hidden_files.md +1 -4
- data/examples/show_hidden_files.rb +1 -1
- data/examples/show_readonly_files.md +1 -4
- data/examples/show_readonly_files.rb +1 -1
- data/lib/recls/api.rb +73 -76
- data/lib/recls/combine_paths_1.rb +23 -26
- data/lib/recls/combine_paths_2plus.rb +29 -32
- data/lib/recls/entry.rb +273 -277
- data/lib/recls/file_search.rb +193 -194
- data/lib/recls/flags.rb +45 -48
- data/lib/recls/foreach.rb +98 -105
- data/lib/recls/obsolete.rb +79 -80
- data/lib/recls/recls.rb +22 -16
- data/lib/recls/stat.rb +134 -137
- data/lib/recls/util.rb +92 -95
- data/lib/recls/version.rb +17 -22
- data/lib/recls/ximpl/os.rb +44 -46
- data/lib/recls/ximpl/unix.rb +35 -39
- data/lib/recls/ximpl/util.rb +596 -598
- data/lib/recls/ximpl/windows.rb +137 -141
- data/lib/recls.rb +9 -10
- data/test/scratch/test_display_parts.rb +33 -33
- data/test/scratch/test_entry.rb +6 -6
- data/test/scratch/test_files_and_directories.rb +8 -8
- data/test/scratch/test_foreach.rb +10 -10
- data/test/scratch/test_module_function.rb +33 -33
- data/test/scratch/test_pattern_arrays.rb +5 -5
- data/test/scratch/test_show_dev_and_ino.rb +1 -1
- data/test/scratch/test_show_hidden.rb +3 -3
- data/test/unit/tc_recls_entries.rb +31 -31
- data/test/unit/tc_recls_entry.rb +19 -19
- data/test/unit/tc_recls_file_search.rb +32 -32
- data/test/unit/tc_recls_module.rb +25 -25
- data/test/unit/tc_recls_util.rb +161 -161
- data/test/unit/tc_recls_ximpl_util.rb +676 -676
- data/test/unit/test_all_separately.sh +1 -1
- data/test/unit/ts_all.rb +4 -4
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adf1c9d879c34d01328e9426fb4232a9ca54bdcbbf97b95fa4bf08a91281b1fe
|
4
|
+
data.tar.gz: 7447488d2bdb53b2df2b7d387ff82a4091220a0553cb001a868a86321dfd49aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33695196ec35f93cbfd5937d6997a461bb1485e2ad4ef5b8728ad002fd30048d4dd804ba13217f9a60e78df986708edb3db66e17b087d6d023e7923f71aa350f
|
7
|
+
data.tar.gz: 471f1adcba4b1c8171ab2781dc4c57f7fac86b59954dc82292d545fb5ae2e4f2123d568a18fbb2f56559a7028fe40740a8288f4f5c49a1c1fe802c654a9304b6
|
data/LICENSE
CHANGED
@@ -1,34 +1,31 @@
|
|
1
|
-
recls.Ruby
|
2
|
-
|
3
|
-
Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
|
4
|
-
Copyright (c) 2003-2019, Matthew Wilson and Synesis Software
|
1
|
+
recls.Ruby
|
5
2
|
|
3
|
+
Copyright (c) 2003-2016, Matthew Wilson and Synesis Software
|
6
4
|
All rights reserved.
|
7
5
|
|
8
6
|
Redistribution and use in source and binary forms, with or without
|
9
7
|
modification, are permitted provided that the following conditions are met:
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
POSSIBILITY OF SUCH DAMAGE.
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
10
|
+
list of conditions and the following disclaimer.
|
11
|
+
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
14
|
+
and/or other materials provided with the distribution.
|
15
|
+
|
16
|
+
* Neither the names of recls or recls.Ruby nor the names of the copyright
|
17
|
+
holder nor the names of its contributors may be used to endorse or promote
|
18
|
+
products derived from this software without specific prior written
|
19
|
+
permission.
|
20
|
+
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
22
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
23
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
24
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
25
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
26
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
27
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
28
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
29
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
31
|
|
data/README.md
CHANGED
@@ -1,17 +1,14 @@
|
|
1
1
|
# recls.Ruby
|
2
|
-
|
3
2
|
**rec**ursive **ls**, for Ruby
|
4
3
|
|
5
4
|
[](https://badge.fury.io/rb/recls-ruby)
|
6
5
|
|
7
|
-
|
8
6
|
## Introduction
|
9
7
|
|
10
8
|
**recls** stands for **rec**ursive **ls**. The first recls library was a C
|
11
9
|
library with a C++ wrapper. There have been several implementations in other
|
12
10
|
languages. **recls.Ruby** is the Ruby version.
|
13
11
|
|
14
|
-
|
15
12
|
## Table of Contents
|
16
13
|
|
17
14
|
1. [Introduction](#introduction)
|
@@ -20,17 +17,14 @@ languages. **recls.Ruby** is the Ruby version.
|
|
20
17
|
4. [Examples](#examples)
|
21
18
|
5. [Project Information](#project-information)
|
22
19
|
|
23
|
-
|
24
20
|
## Introduction
|
25
21
|
|
26
22
|
T.B.C.
|
27
23
|
|
28
|
-
|
29
24
|
## Installation & usage
|
30
25
|
|
31
26
|
Install using `gem install recls-ruby` or add it to your `Gemfile`.
|
32
27
|
|
33
|
-
|
34
28
|
## Components
|
35
29
|
|
36
30
|
The main components of **recls.Ruby** are:
|
@@ -38,267 +32,36 @@ The main components of **recls.Ruby** are:
|
|
38
32
|
* the ``Recls`` module; and
|
39
33
|
* the ``Recls::Entry`` class
|
40
34
|
|
41
|
-
|
42
35
|
### The ``Recls`` module
|
43
36
|
|
44
37
|
T.B.C.
|
45
38
|
|
46
|
-
|
47
39
|
### The ``Recls::Entry`` class
|
48
40
|
|
49
|
-
|
50
|
-
|
51
|
-
```Ruby
|
52
|
-
module Recls
|
53
|
-
|
54
|
-
# A file-system entry
|
55
|
-
class Entry
|
56
|
-
|
57
|
-
# ##########################
|
58
|
-
# Name-related attributes
|
59
|
-
|
60
|
-
# (+String+) A normalised form of #path that can be used in comparisons
|
61
|
-
attr_reader :compare_path
|
62
|
-
|
63
|
-
# (+String+) The full-path of the instance
|
64
|
-
attr_reader :path
|
65
|
-
# (+String+) The (Windows) short-form of #path, or +nil+ if not on Windows
|
66
|
-
attr_reader :short_path
|
67
|
-
# (+String+) The (Windows) drive. +nil+ if does not exist
|
68
|
-
attr_reader :drive
|
69
|
-
# (+String+) The full path of the entry's directory (taking into account the
|
70
|
-
# #drive if on Windows)
|
71
|
-
attr_reader :directory_path
|
72
|
-
alias_method :dirname, :directory_path
|
73
|
-
# (+String+) The entry's directory (excluding the #drive if on Windows)
|
74
|
-
attr_reader :directory
|
75
|
-
# (+[ String ]+) An array of directory parts, where each part ends in Recls::PATH_NAME_SEPARATOR
|
76
|
-
attr_reader :directory_parts
|
77
|
-
# (+String+) The entry's file name (combination of #stem + #extension)
|
78
|
-
attr_reader :file_full_name
|
79
|
-
# (+String+) The (Windows) short-form of #basename, or +nil+ if not on Windows
|
80
|
-
attr_reader :file_short_name
|
81
|
-
alias_method :basename, :file_full_name
|
82
|
-
# (+String+) The entry's file stem
|
83
|
-
attr_reader :file_name_only
|
84
|
-
alias_method :stem, :file_name_only
|
85
|
-
# (+String+) The entry's file extension
|
86
|
-
attr_reader :file_extension
|
87
|
-
alias_method :extension, :file_extension
|
88
|
-
# (+String+) The search directory if specified; +nil+ otherwise
|
89
|
-
attr_reader :search_directory
|
90
|
-
# (+String+) The #path relative to #search_directory; +nil+ if no search directory specified
|
91
|
-
attr_reader :search_relative_path
|
92
|
-
# (+String+) The #directory relative to #search_directory; +nil+ if no search directory specified
|
93
|
-
attr_reader :search_relative_directory
|
94
|
-
# (+String+) The #directory_path relative to #search_directory; +nil+ if no search directory specified
|
95
|
-
attr_reader :search_relative_directory_path
|
96
|
-
# (+[ String ]+) The #directory_parts relative to #search_directory; +nil+ if no search directory specified
|
97
|
-
attr_reader :search_relative_directory_parts
|
98
|
-
|
99
|
-
# ##########################
|
100
|
-
# Nature attributes
|
101
|
-
|
102
|
-
# indicates whether the given entry existed at the time the entry
|
103
|
-
# instance was created
|
104
|
-
def exist?
|
105
|
-
. . .
|
106
|
-
end
|
107
|
-
|
108
|
-
# indicates whether the given entry is hidden
|
109
|
-
def hidden?
|
110
|
-
. . .
|
111
|
-
end
|
112
|
-
|
113
|
-
# indicates whether the given entry is readonly
|
114
|
-
def readonly?
|
115
|
-
. . .
|
116
|
-
end
|
117
|
-
|
118
|
-
if Recls::Ximpl::OS::OS_IS_WINDOWS
|
119
|
-
|
120
|
-
# [WINDOWS-ONLY] Indicates whether the entry has the *system* bit
|
121
|
-
def system?
|
122
|
-
. . .
|
123
|
-
end
|
124
|
-
|
125
|
-
# [WINDOWS-ONLY] Indicates whether the entry has the *archive* bit
|
126
|
-
def archive?
|
127
|
-
. . .
|
128
|
-
end
|
129
|
-
|
130
|
-
# [WINDOWS-ONLY] Indicates whether the entry is a device
|
131
|
-
def device?
|
132
|
-
. . .
|
133
|
-
end
|
134
|
-
|
135
|
-
# [WINDOWS-ONLY] Indicates whether the entry is *normal*
|
136
|
-
def normal?
|
137
|
-
. . .
|
138
|
-
end
|
139
|
-
|
140
|
-
# [WINDOWS-ONLY] Indicates whether the entry has the *temporary* bit
|
141
|
-
def temporary?
|
142
|
-
. . .
|
143
|
-
end
|
144
|
-
|
145
|
-
# [WINDOWS-ONLY] Indicates whether the entry has the *compressed* bit
|
146
|
-
def compressed?
|
147
|
-
. . .
|
148
|
-
end
|
149
|
-
|
150
|
-
# [WINDOWS-ONLY] Indicates whether the entry has the *encrypted* bit
|
151
|
-
def encrypted?
|
152
|
-
. . .
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
|
-
# indicates whether the given entry represents a directory
|
157
|
-
def directory?
|
158
|
-
. . .
|
159
|
-
end
|
160
|
-
|
161
|
-
alias_method :dir?, :directory?
|
162
|
-
|
163
|
-
# indicates whether the given entry represents a file
|
164
|
-
def file?
|
165
|
-
. . .
|
166
|
-
end
|
167
|
-
|
168
|
-
# indicates whether the given entry represents a link
|
169
|
-
def link?
|
170
|
-
. . .
|
171
|
-
end
|
172
|
-
|
173
|
-
# indicates whether the given entry represents a socket
|
174
|
-
def socket?
|
175
|
-
. . .
|
176
|
-
end
|
177
|
-
|
178
|
-
# ##########################
|
179
|
-
# Size attributes
|
180
|
-
|
181
|
-
# indicates the size of the given entry
|
182
|
-
def size
|
183
|
-
. . .
|
184
|
-
end
|
185
|
-
|
186
|
-
# ##########################
|
187
|
-
# File-system entry attributes
|
188
|
-
|
189
|
-
# indicates the device of the given entry
|
190
|
-
#
|
191
|
-
# On Windows, this will be 0 if the entry cannot be
|
192
|
-
# opened
|
193
|
-
def dev
|
194
|
-
. . .
|
195
|
-
end
|
196
|
-
|
197
|
-
# indicates the ino of the given entry
|
198
|
-
#
|
199
|
-
# On Windows, this will be 0 if the entry cannot be
|
200
|
-
# opened
|
201
|
-
def ino
|
202
|
-
. . .
|
203
|
-
end
|
204
|
-
|
205
|
-
# number of links to the given entry
|
206
|
-
#
|
207
|
-
# On Windows, this will be 0 if the entry cannot be
|
208
|
-
# opened
|
209
|
-
def nlink
|
210
|
-
. . .
|
211
|
-
end
|
212
|
-
|
213
|
-
# ##########################
|
214
|
-
# Time attributes
|
215
|
-
|
216
|
-
# indicates the last access time of the entry
|
217
|
-
def last_access_time
|
218
|
-
. . .
|
219
|
-
end
|
220
|
-
|
221
|
-
# indicates the modification time of the entry
|
222
|
-
def modification_time
|
223
|
-
. . .
|
224
|
-
end
|
225
|
-
|
226
|
-
# ##########################
|
227
|
-
# Comparison
|
228
|
-
|
229
|
-
# determines whether rhs is an instance of Entry and
|
230
|
-
# refers to the same path
|
231
|
-
def eql?(rhs)
|
232
|
-
. . .
|
233
|
-
end
|
234
|
-
|
235
|
-
# determines whether rhs refers to the same path
|
236
|
-
def ==(rhs)
|
237
|
-
. . .
|
238
|
-
end
|
239
|
-
|
240
|
-
# compares this instance with rhs
|
241
|
-
def <=>(rhs)
|
242
|
-
. . .
|
243
|
-
end
|
244
|
-
|
245
|
-
# the hash
|
246
|
-
def hash
|
247
|
-
. . .
|
248
|
-
end
|
249
|
-
|
250
|
-
# ##########################
|
251
|
-
# Conversion
|
252
|
-
|
253
|
-
# represents the entry as a string (in the form of
|
254
|
-
# the full path)
|
255
|
-
def to_s
|
256
|
-
. . .
|
257
|
-
end
|
258
|
-
|
259
|
-
# represents the entry as a string (in the form of
|
260
|
-
# the full path)
|
261
|
-
def to_str
|
262
|
-
. . .
|
263
|
-
end
|
264
|
-
end # class Entry
|
265
|
-
end # module Recls
|
266
|
-
|
267
|
-
|
268
|
-
# ############################## end of file ############################# #
|
269
|
-
|
270
|
-
|
271
|
-
```
|
272
|
-
|
41
|
+
T.B.C.
|
273
42
|
|
274
43
|
## Examples
|
275
44
|
|
276
45
|
Examples are provided in the ```examples``` directory, along with a markdown description for each. A detailed list TOC of them is provided in [EXAMPLES.md](./EXAMPLES.md).
|
277
46
|
|
278
|
-
|
279
47
|
## Project Information
|
280
48
|
|
281
|
-
|
282
49
|
### Where to get help
|
283
50
|
|
284
51
|
[GitHub Page](https://github.com/synesissoftware/recls.Ruby "GitHub Page")
|
285
52
|
|
286
|
-
|
287
53
|
### Contribution guidelines
|
288
54
|
|
289
55
|
Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/recls.Ruby.
|
290
56
|
|
291
|
-
|
292
57
|
### Dependencies
|
293
58
|
|
294
59
|
None
|
295
60
|
|
296
|
-
|
297
61
|
### Dependents
|
298
62
|
|
299
63
|
**recls.Ruby** is used in the **[libCLImate.Ruby](https://github.com/synesissoftware/libCLImate.Ruby)** library.
|
300
64
|
|
301
|
-
|
302
65
|
### Related projects
|
303
66
|
|
304
67
|
* [**recls**](https://github.com/synesissoftware/recls/)
|
@@ -306,17 +69,13 @@ None
|
|
306
69
|
* [**recls.NET**](https://github.com/synesissoftware/recls.NET/)
|
307
70
|
* [**recls.Python**](https://github.com/synesissoftware/recls.Python/)
|
308
71
|
|
309
|
-
|
310
72
|
### License
|
311
73
|
|
312
74
|
**recls.Ruby** is released under the 3-clause BSD license. See [LICENSE](./LICENSE) for details.
|
313
75
|
|
314
|
-
|
315
76
|
### Compatibility
|
316
77
|
|
317
78
|
For v2.8.x onwards, recls.Ruby is compatible only with Ruby 2.0+; all other
|
318
79
|
past and current versions work with Ruby 1.9.3+.
|
319
80
|
|
320
81
|
|
321
|
-
<!-- ########################### end of file ########################### -->
|
322
|
-
|
@@ -39,42 +39,39 @@ attribute is used to display the relative path.
|
|
39
39
|
|
40
40
|
```
|
41
41
|
files in current directory:
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
42
|
+
build_gem.cmd
|
43
|
+
build_gem.sh
|
44
|
+
CHANGES.md
|
45
|
+
EXAMPLES.md
|
46
|
+
generate_rdoc.sh
|
47
|
+
LICENSE
|
48
|
+
Rakefile
|
49
|
+
README.md
|
50
|
+
recls.gemspec
|
51
|
+
run_all_unit_tests.sh
|
52
52
|
|
53
53
|
directories in current directory:
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
doc
|
55
|
+
examples
|
56
|
+
lib
|
57
|
+
old-gems
|
58
|
+
test
|
59
59
|
|
60
60
|
files and directories in current directory:
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
61
|
+
build_gem.cmd
|
62
|
+
build_gem.sh
|
63
|
+
CHANGES.md
|
64
|
+
doc
|
65
|
+
examples
|
66
|
+
EXAMPLES.md
|
67
|
+
generate_rdoc.sh
|
68
|
+
lib
|
69
|
+
LICENSE
|
70
|
+
old-gems
|
71
|
+
Rakefile
|
72
|
+
README.md
|
73
|
+
recls.gemspec
|
74
|
+
run_all_unit_tests.sh
|
75
|
+
test
|
76
76
|
```
|
77
77
|
|
78
|
-
|
79
|
-
<!-- ########################### end of file ########################### -->
|
80
|
-
|