recls-ruby 2.10.1 → 2.11.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 +5 -5
- data/README.md +11 -0
- data/examples/find_files_and_directories.recursive.md +50 -38
- data/examples/find_files_and_directories.recursive.rb +2 -2
- data/lib/recls/entry.rb +4 -1
- data/lib/recls/foreach.rb +4 -1
- data/lib/recls/version.rb +3 -2
- data/test/scratch/test_entry.rb +1 -0
- data/test/scratch/test_pattern_arrays.rb +32 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a1b0ed5f508ef5e3a29ac1f5de51d5d6cee84ba1
|
4
|
+
data.tar.gz: 0deb1a1f4551f35cc8c25acba091e30eaa630109
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6852f4c312ef0dc49c6d8027df2655217cfe1587ea2cf95b8030f5986b2e1ecfbc84c6a325c565718fffc8161231d3415a3a1c292dfae2744fd986a89fe546e5
|
7
|
+
data.tar.gz: 9cba60e7075ffb6d3da1ceefc597c54953e23f8fe41d4d5cea4a20840dd9b037c60471d3ddbbf188d9045018cfede80a7d88fd56ba758814814abfae0e26cc1e
|
data/README.md
CHANGED
@@ -27,6 +27,17 @@ Install using `gem install recls-ruby` or add it to your `Gemfile`.
|
|
27
27
|
|
28
28
|
## Components
|
29
29
|
|
30
|
+
The main components of **recls.Ruby** are:
|
31
|
+
|
32
|
+
* the ``Recls`` module; and
|
33
|
+
* the ``Recls::Entry`` class
|
34
|
+
|
35
|
+
### The ``Recls`` module
|
36
|
+
|
37
|
+
T.B.C.
|
38
|
+
|
39
|
+
### The ``Recls::Entry`` class
|
40
|
+
|
30
41
|
T.B.C.
|
31
42
|
|
32
43
|
## Examples
|
@@ -18,11 +18,11 @@ Recls.file_rsearch(nil, nil, Recls::FILES).each { |fe| puts "\t#{fe.search_relat
|
|
18
18
|
puts
|
19
19
|
|
20
20
|
puts "directories under current directory:"
|
21
|
-
Recls.file_rsearch(nil, nil, Recls::DIRECTORIES).each { |fe| puts "\t#{fe.search_relative_path}" }
|
21
|
+
Recls.file_rsearch(nil, nil, Recls::DIRECTORIES | Recls::MARK_DIRECTORIES).each { |fe| puts "\t#{fe.search_relative_path}" }
|
22
22
|
puts
|
23
23
|
|
24
24
|
puts "files and directories under current directory:"
|
25
|
-
Recls.file_rsearch(nil, nil, Recls::DIRECTORIES | Recls::FILES).each { |fe| puts "\t#{fe.search_relative_path}" }
|
25
|
+
Recls.file_rsearch(nil, nil, Recls::DIRECTORIES | Recls::FILES | Recls::MARK_DIRECTORIES).each { |fe| puts "\t#{fe.search_relative_path}" }
|
26
26
|
puts
|
27
27
|
```
|
28
28
|
|
@@ -33,12 +33,13 @@ the ```Recls.file_rsearch()``` module method, passing FILES, DIRECTORIES, and
|
|
33
33
|
FILES|DIRECTORIES, respectively. For each search, a simple block is
|
34
34
|
presented, which takes a single-parameter of the file-entry (of type
|
35
35
|
``Recls::Entry``) from which the ``#search_relative_path`` instance
|
36
|
-
attribute is used to display the relative path.
|
36
|
+
attribute is used to display the relative path. For clarity, directories are
|
37
|
+
marked with trailing slashes.
|
37
38
|
|
38
39
|
## Example results
|
39
40
|
|
40
41
|
```
|
41
|
-
files
|
42
|
+
files under current directory:
|
42
43
|
build_gem.cmd
|
43
44
|
build_gem.sh
|
44
45
|
CHANGES.md
|
@@ -47,6 +48,7 @@ files in current directory:
|
|
47
48
|
LICENSE
|
48
49
|
Rakefile
|
49
50
|
README.md
|
51
|
+
recls-ruby-2.10.1.gem
|
50
52
|
recls.gemspec
|
51
53
|
run_all_unit_tests.sh
|
52
54
|
doc/CHANGES_md.html
|
@@ -104,7 +106,6 @@ files in current directory:
|
|
104
106
|
doc/Recls/Entry.html
|
105
107
|
examples/find_files_and_directories.md
|
106
108
|
examples/find_files_and_directories.rb
|
107
|
-
examples/find_files_and_directories.recursive.
|
108
109
|
examples/find_files_and_directories.recursive.md
|
109
110
|
examples/find_files_and_directories.recursive.rb
|
110
111
|
examples/show_hidden_files.md
|
@@ -130,6 +131,8 @@ files in current directory:
|
|
130
131
|
lib/recls/ximpl/windows.rb
|
131
132
|
old-gems/recls-2.6.3.gem
|
132
133
|
old-gems/recls-ruby-2.10.0.gem
|
134
|
+
test/fixtures/readonly/file-1
|
135
|
+
test/fixtures/readonly/file-2
|
133
136
|
test/scratch/test_display_parts.rb
|
134
137
|
test/scratch/test_entry.rb
|
135
138
|
test/scratch/test_files_and_directories.rb
|
@@ -147,51 +150,55 @@ files in current directory:
|
|
147
150
|
test/unit/test_all_separately.sh
|
148
151
|
test/unit/ts_all.rb
|
149
152
|
|
150
|
-
directories
|
151
|
-
doc
|
152
|
-
examples
|
153
|
-
lib
|
154
|
-
old-gems
|
155
|
-
test
|
156
|
-
doc/css
|
157
|
-
doc/examples
|
158
|
-
doc/fonts
|
159
|
-
doc/images
|
160
|
-
doc/js
|
161
|
-
doc/Recls
|
162
|
-
lib/recls
|
163
|
-
lib/recls/ximpl
|
164
|
-
test/
|
165
|
-
test/
|
153
|
+
directories under current directory:
|
154
|
+
doc/
|
155
|
+
examples/
|
156
|
+
lib/
|
157
|
+
old-gems/
|
158
|
+
test/
|
159
|
+
doc/css/
|
160
|
+
doc/examples/
|
161
|
+
doc/fonts/
|
162
|
+
doc/images/
|
163
|
+
doc/js/
|
164
|
+
doc/Recls/
|
165
|
+
lib/recls/
|
166
|
+
lib/recls/ximpl/
|
167
|
+
test/fixtures/
|
168
|
+
test/scratch/
|
169
|
+
test/unit/
|
170
|
+
test/fixtures/hidden/
|
171
|
+
test/fixtures/readonly/
|
166
172
|
|
167
|
-
files and directories
|
173
|
+
files and directories under current directory:
|
168
174
|
build_gem.cmd
|
169
175
|
build_gem.sh
|
170
176
|
CHANGES.md
|
171
|
-
doc
|
172
|
-
examples
|
177
|
+
doc/
|
178
|
+
examples/
|
173
179
|
EXAMPLES.md
|
174
180
|
generate_rdoc.sh
|
175
|
-
lib
|
181
|
+
lib/
|
176
182
|
LICENSE
|
177
|
-
old-gems
|
183
|
+
old-gems/
|
178
184
|
Rakefile
|
179
185
|
README.md
|
186
|
+
recls-ruby-2.10.1.gem
|
180
187
|
recls.gemspec
|
181
188
|
run_all_unit_tests.sh
|
182
|
-
test
|
189
|
+
test/
|
183
190
|
doc/CHANGES_md.html
|
184
191
|
doc/created.rid
|
185
|
-
doc/css
|
186
|
-
doc/examples
|
192
|
+
doc/css/
|
193
|
+
doc/examples/
|
187
194
|
doc/EXAMPLES_md.html
|
188
|
-
doc/fonts
|
189
|
-
doc/images
|
195
|
+
doc/fonts/
|
196
|
+
doc/images/
|
190
197
|
doc/index.html
|
191
|
-
doc/js
|
198
|
+
doc/js/
|
192
199
|
doc/LICENSE.html
|
193
200
|
doc/README_md.html
|
194
|
-
doc/Recls
|
201
|
+
doc/Recls/
|
195
202
|
doc/Recls.html
|
196
203
|
doc/table_of_contents.html
|
197
204
|
doc/css/fonts.css
|
@@ -241,14 +248,13 @@ files and directories in current directory:
|
|
241
248
|
doc/Recls/Entry.html
|
242
249
|
examples/find_files_and_directories.md
|
243
250
|
examples/find_files_and_directories.rb
|
244
|
-
examples/find_files_and_directories.recursive.
|
245
251
|
examples/find_files_and_directories.recursive.md
|
246
252
|
examples/find_files_and_directories.recursive.rb
|
247
253
|
examples/show_hidden_files.md
|
248
254
|
examples/show_hidden_files.rb
|
249
255
|
examples/show_readonly_files.md
|
250
256
|
examples/show_readonly_files.rb
|
251
|
-
lib/recls
|
257
|
+
lib/recls/
|
252
258
|
lib/recls.rb
|
253
259
|
lib/recls/api.rb
|
254
260
|
lib/recls/combine_paths_1.rb
|
@@ -262,15 +268,20 @@ files and directories in current directory:
|
|
262
268
|
lib/recls/stat.rb
|
263
269
|
lib/recls/util.rb
|
264
270
|
lib/recls/version.rb
|
265
|
-
lib/recls/ximpl
|
271
|
+
lib/recls/ximpl/
|
266
272
|
lib/recls/ximpl/os.rb
|
267
273
|
lib/recls/ximpl/unix.rb
|
268
274
|
lib/recls/ximpl/util.rb
|
269
275
|
lib/recls/ximpl/windows.rb
|
270
276
|
old-gems/recls-2.6.3.gem
|
271
277
|
old-gems/recls-ruby-2.10.0.gem
|
272
|
-
test/
|
273
|
-
test/
|
278
|
+
test/fixtures/
|
279
|
+
test/scratch/
|
280
|
+
test/unit/
|
281
|
+
test/fixtures/hidden/
|
282
|
+
test/fixtures/readonly/
|
283
|
+
test/fixtures/readonly/file-1
|
284
|
+
test/fixtures/readonly/file-2
|
274
285
|
test/scratch/test_display_parts.rb
|
275
286
|
test/scratch/test_entry.rb
|
276
287
|
test/scratch/test_files_and_directories.rb
|
@@ -290,3 +301,4 @@ files and directories in current directory:
|
|
290
301
|
```
|
291
302
|
|
292
303
|
|
304
|
+
|
@@ -9,11 +9,11 @@ Recls.file_rsearch(nil, nil, Recls::FILES).each { |fe| puts "\t#{fe.search_relat
|
|
9
9
|
puts
|
10
10
|
|
11
11
|
puts "directories under current directory:"
|
12
|
-
Recls.file_rsearch(nil, nil, Recls::DIRECTORIES).each { |fe| puts "\t#{fe.search_relative_path}" }
|
12
|
+
Recls.file_rsearch(nil, nil, Recls::DIRECTORIES | Recls::MARK_DIRECTORIES).each { |fe| puts "\t#{fe.search_relative_path}" }
|
13
13
|
puts
|
14
14
|
|
15
15
|
puts "files and directories under current directory:"
|
16
|
-
Recls.file_rsearch(nil, nil, Recls::DIRECTORIES | Recls::FILES).each { |fe| puts "\t#{fe.search_relative_path}" }
|
16
|
+
Recls.file_rsearch(nil, nil, Recls::DIRECTORIES | Recls::FILES | Recls::MARK_DIRECTORIES).each { |fe| puts "\t#{fe.search_relative_path}" }
|
17
17
|
puts
|
18
18
|
|
19
19
|
|
data/lib/recls/entry.rb
CHANGED
@@ -4,10 +4,11 @@
|
|
4
4
|
# Purpose: Defines the Recls::Entry class for the recls.Ruby library.
|
5
5
|
#
|
6
6
|
# Created: 24th July 2012
|
7
|
-
# Updated:
|
7
|
+
# Updated: 25th May 2020
|
8
8
|
#
|
9
9
|
# Author: Matthew Wilson
|
10
10
|
#
|
11
|
+
# Copyright (c) 2019-2020, Matthew Wilson and Synesis Information Systems
|
11
12
|
# Copyright (c) 2012-2019, Matthew Wilson and Synesis Software
|
12
13
|
# All rights reserved.
|
13
14
|
#
|
@@ -247,6 +248,8 @@ module Recls
|
|
247
248
|
@file_stat.directory?
|
248
249
|
end
|
249
250
|
|
251
|
+
alias_method :dir?, :directory?
|
252
|
+
|
250
253
|
# indicates whether the given entry represents a file
|
251
254
|
def file?
|
252
255
|
|
data/lib/recls/foreach.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# Purpose: Definition of Recls::foreach() utility function
|
5
5
|
#
|
6
6
|
# Created: 22nd October 2014
|
7
|
-
# Updated:
|
7
|
+
# Updated: 26th May 2020
|
8
8
|
#
|
9
9
|
# Author: Matthew Wilson
|
10
10
|
#
|
@@ -113,12 +113,15 @@ module Recls
|
|
113
113
|
|
114
114
|
case args.length
|
115
115
|
when 1
|
116
|
+
|
116
117
|
raise ArgumentError "Single argument must be of type #{Recls::FileSearch}" unless args[0].kind_of? Recls::FileSearch
|
117
118
|
|
118
119
|
fs = args[0]
|
119
120
|
when 3
|
121
|
+
|
120
122
|
fs = Recls::FileSearch.new(args[0], args[1], args[2])
|
121
123
|
else
|
124
|
+
|
122
125
|
raise ArgumentError "Function requires single argument (#{Recls::FileSearch}) or three arguments (directory, patterns, flags)"
|
123
126
|
end
|
124
127
|
|
data/lib/recls/version.rb
CHANGED
@@ -4,10 +4,11 @@
|
|
4
4
|
# Purpose: Version for recls library
|
5
5
|
#
|
6
6
|
# Created: 14th February 2014
|
7
|
-
# Updated:
|
7
|
+
# Updated: 25th May 2020
|
8
8
|
#
|
9
9
|
# Author: Matthew Wilson
|
10
10
|
#
|
11
|
+
# Copyright (c) 2019-2020, Matthew Wilson and Synesis Information Systems
|
11
12
|
# Copyright (c) 2012-2019, Matthew Wilson and Synesis Software
|
12
13
|
# All rights reserved.
|
13
14
|
#
|
@@ -44,7 +45,7 @@ class Object; end # :nodoc:
|
|
44
45
|
module Recls
|
45
46
|
|
46
47
|
# Current version of the recls.Ruby library
|
47
|
-
VERSION = '2.
|
48
|
+
VERSION = '2.11.0'
|
48
49
|
|
49
50
|
private
|
50
51
|
VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
|
data/test/scratch/test_entry.rb
CHANGED
@@ -45,6 +45,7 @@ puts "\t#{'f.exist?'.ljust(20)}\t#{f.exist?}"
|
|
45
45
|
puts "\t#{'f.hidden?'.ljust(20)}\t#{f.hidden?}"
|
46
46
|
puts "\t#{'f.readonly?'.ljust(20)}\t#{f.readonly?}"
|
47
47
|
puts "\t#{'f.directory?'.ljust(20)}\t#{f.directory?}"
|
48
|
+
puts "\t#{'f.dir?'.ljust(20)}\t#{f.dir?}"
|
48
49
|
puts "\t#{'f.file?'.ljust(20)}\t#{f.file?}"
|
49
50
|
puts "\t#{'f.socket?'.ljust(20)}\t#{f.socket?}"
|
50
51
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# test Recls entry methods showing parts
|
4
|
+
|
5
|
+
$:.unshift File.join(File.dirname(__FILE__), '../..', 'lib')
|
6
|
+
|
7
|
+
require 'recls'
|
8
|
+
|
9
|
+
root_dir = File.join(File.dirname(__FILE__), '../..')
|
10
|
+
patterns_a = %w{ *.rb *.md }
|
11
|
+
patterns_s = patterns_a.join('|')
|
12
|
+
|
13
|
+
|
14
|
+
puts
|
15
|
+
puts "Searching for pattern string '#{patterns_s}':"
|
16
|
+
|
17
|
+
Recls::FileSearch.new(root_dir, patterns_s, Recls::FILES | Recls::RECURSIVE).each do |fe|
|
18
|
+
|
19
|
+
puts fe.search_relative_path
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
puts
|
25
|
+
puts "Searching for pattern array '#{patterns_a}':"
|
26
|
+
|
27
|
+
Recls::FileSearch.new(root_dir, patterns_a, Recls::FILES | Recls::RECURSIVE).each do |fe|
|
28
|
+
|
29
|
+
puts fe.search_relative_path
|
30
|
+
end
|
31
|
+
|
32
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recls-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.11.0
|
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: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xqsr3
|
@@ -24,9 +24,8 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.31'
|
27
|
-
description:
|
28
|
-
|
29
|
-
'
|
27
|
+
description: |
|
28
|
+
RECursive LS for Ruby
|
30
29
|
email: matthew@synesis.com.au
|
31
30
|
executables: []
|
32
31
|
extensions: []
|
@@ -67,6 +66,7 @@ files:
|
|
67
66
|
- test/scratch/test_files_and_directories.rb
|
68
67
|
- test/scratch/test_foreach.rb
|
69
68
|
- test/scratch/test_module_function.rb
|
69
|
+
- test/scratch/test_pattern_arrays.rb
|
70
70
|
- test/scratch/test_show_dev_and_ino.rb
|
71
71
|
- test/scratch/test_show_hidden.rb
|
72
72
|
- test/unit/tc_recls_entries.rb
|
@@ -97,7 +97,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
|
-
|
100
|
+
rubyforge_project:
|
101
|
+
rubygems_version: 2.2.5
|
101
102
|
signing_key:
|
102
103
|
specification_version: 4
|
103
104
|
summary: recls.Ruby
|