recls-ruby 2.8.2 → 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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +57 -10
  3. data/examples/find_files_and_directories.md +77 -0
  4. data/examples/find_files_and_directories.rb +19 -0
  5. data/examples/find_files_and_directories.recursive.md +304 -0
  6. data/examples/find_files_and_directories.recursive.rb +19 -0
  7. data/examples/show_hidden_files.md +39 -0
  8. data/examples/show_hidden_files.rb +2 -2
  9. data/examples/show_readonly_files.md +35 -0
  10. data/examples/show_readonly_files.rb +2 -2
  11. data/lib/recls.rb +2 -0
  12. data/lib/recls/api.rb +70 -3
  13. data/lib/recls/combine_paths_1.rb +70 -0
  14. data/lib/recls/combine_paths_2plus.rb +76 -0
  15. data/lib/recls/entry.rb +40 -4
  16. data/lib/recls/file_search.rb +48 -14
  17. data/lib/recls/flags.rb +21 -4
  18. data/lib/recls/foreach.rb +45 -6
  19. data/lib/recls/obsolete.rb +119 -0
  20. data/lib/recls/recls.rb +27 -56
  21. data/lib/recls/stat.rb +96 -24
  22. data/lib/recls/util.rb +74 -23
  23. data/lib/recls/version.rb +10 -4
  24. data/lib/recls/ximpl/os.rb +29 -15
  25. data/lib/recls/ximpl/unix.rb +29 -16
  26. data/lib/recls/ximpl/util.rb +141 -39
  27. data/lib/recls/ximpl/windows.rb +56 -25
  28. data/test/fixtures/readonly/file-1 +0 -0
  29. data/test/fixtures/readonly/file-2 +0 -0
  30. data/test/scratch/test_display_parts.rb +9 -9
  31. data/test/scratch/test_entry.rb +11 -9
  32. data/test/scratch/test_files_and_directories.rb +17 -14
  33. data/test/scratch/test_foreach.rb +0 -3
  34. data/test/scratch/test_module_function.rb +10 -10
  35. data/test/scratch/test_pattern_arrays.rb +32 -0
  36. data/test/scratch/test_show_dev_and_ino.rb +1 -1
  37. data/test/scratch/test_show_hidden.rb +3 -3
  38. data/test/unit/tc_recls_util.rb +6 -0
  39. data/test/unit/tc_recls_ximpl_util.rb +156 -101
  40. data/test/unit/ts_all.rb +11 -9
  41. metadata +36 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd3873b6ab2b854777d003cfefd78240322da3ec
4
- data.tar.gz: 35234197d743227278a98b4bb6d645f5c895a452
3
+ metadata.gz: a1b0ed5f508ef5e3a29ac1f5de51d5d6cee84ba1
4
+ data.tar.gz: 0deb1a1f4551f35cc8c25acba091e30eaa630109
5
5
  SHA512:
6
- metadata.gz: 62d7e2ee09b3b4ed8f8908a4ecbc5fb4c82b3c0cc6c553310913384c4573bebca95a8dd6c960f57c7555511fc954541c6542ef11a5d328cd4abed411ccae2689
7
- data.tar.gz: a7609496ada38d41d30b054603fbf28300961eae8f3b18012ab3ff68ac41d294b378a32c2d3093e50065bd1ee783b9287dac4f70cb5d5d709d7ad8ee0ebc3136
6
+ metadata.gz: 6852f4c312ef0dc49c6d8027df2655217cfe1587ea2cf95b8030f5986b2e1ecfbc84c6a325c565718fffc8161231d3415a3a1c292dfae2744fd986a89fe546e5
7
+ data.tar.gz: 9cba60e7075ffb6d3da1ceefc597c54953e23f8fe41d4d5cea4a20840dd9b037c60471d3ddbbf188d9045018cfede80a7d88fd56ba758814814abfae0e26cc1e
data/README.md CHANGED
@@ -1,34 +1,81 @@
1
1
  # recls.Ruby
2
- recls for Ruby
2
+ **rec**ursive **ls**, for Ruby
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/recls-ruby.svg)](https://badge.fury.io/rb/recls-ruby)
5
5
 
6
+ ## Introduction
7
+
8
+ **recls** stands for **rec**ursive **ls**. The first recls library was a C
9
+ library with a C++ wrapper. There have been several implementations in other
10
+ languages. **recls.Ruby** is the Ruby version.
11
+
12
+ ## Table of Contents
13
+
14
+ 1. [Introduction](#introduction)
15
+ 2. [Installation](#installation)
16
+ 3. [Components](#components)
17
+ 4. [Examples](#examples)
18
+ 5. [Project Information](#project-information)
19
+
20
+ ## Introduction
21
+
22
+ T.B.C.
23
+
6
24
  ## Installation & usage
7
25
 
8
26
  Install using `gem install recls-ruby` or add it to your `Gemfile`.
9
27
 
10
- ## Description
28
+ ## Components
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
11
36
 
12
- TODO
37
+ T.B.C.
13
38
 
14
- ## Where to get help
39
+ ### The ``Recls::Entry`` class
40
+
41
+ T.B.C.
42
+
43
+ ## Examples
44
+
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).
46
+
47
+ ## Project Information
48
+
49
+ ### Where to get help
15
50
 
16
51
  [GitHub Page](https://github.com/synesissoftware/recls.Ruby "GitHub Page")
17
52
 
18
- ## Contribution guidelines
53
+ ### Contribution guidelines
19
54
 
20
55
  Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/recls.Ruby.
21
56
 
22
- ## Related projects
57
+ ### Dependencies
58
+
59
+ None
60
+
61
+ ### Dependents
23
62
 
24
63
  **recls.Ruby** is used in the **[libCLImate.Ruby](https://github.com/synesissoftware/libCLImate.Ruby)** library.
25
64
 
26
- ## License
65
+ ### Related projects
66
+
67
+ * [**recls**](https://github.com/synesissoftware/recls/)
68
+ * [**recls.Go**](https://github.com/synesissoftware/recls.Go/)
69
+ * [**recls.NET**](https://github.com/synesissoftware/recls.NET/)
70
+ * [**recls.Python**](https://github.com/synesissoftware/recls.Python/)
71
+
72
+ ### License
27
73
 
28
- **recls.Ruby** is released under the 3-clause BSD license. See LICENSE for details.
74
+ **recls.Ruby** is released under the 3-clause BSD license. See [LICENSE](./LICENSE) for details.
29
75
 
30
- ## Compatibility
76
+ ### Compatibility
31
77
 
32
- From v2.8 onwards, recls.Ruby is compatible only with Ruby 2.0+
78
+ For v2.8.x onwards, recls.Ruby is compatible only with Ruby 2.0+; all other
79
+ past and current versions work with Ruby 1.9.3+.
33
80
 
34
81
 
@@ -0,0 +1,77 @@
1
+ # recls.Ruby Example - **find_files_and_directories**
2
+
3
+ ## Summary
4
+
5
+ Illustrates finding of FILES, then DIRECTORIES, then both
6
+
7
+ ## Source
8
+
9
+ ```ruby
10
+ #! /usr/bin/env ruby
11
+
12
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
13
+
14
+ require 'recls'
15
+
16
+ puts "files in current directory:"
17
+ Recls.file_search(nil, nil, Recls::FILES).each { |fe| puts "\t#{fe.search_relative_path}" }
18
+ puts
19
+
20
+ puts "directories in current directory:"
21
+ Recls.file_search(nil, nil, Recls::DIRECTORIES).each { |fe| puts "\t#{fe.search_relative_path}" }
22
+ puts
23
+
24
+ puts "files and directories in current directory:"
25
+ Recls.file_search(nil, nil, Recls::DIRECTORIES | Recls::FILES).each { |fe| puts "\t#{fe.search_relative_path}" }
26
+ puts
27
+ ```
28
+
29
+ ## Discussion
30
+
31
+ The code is pretty self-explanatory, in that there are three searches using
32
+ the ```Recls.file_search()``` module method, passing FILES, DIRECTORIES, and
33
+ FILES|DIRECTORIES, respectively. For each search, a simple block is
34
+ presented, which takes a single-parameter of the file-entry (of type
35
+ ``Recls::Entry``) from which the ``#search_relative_path`` instance
36
+ attribute is used to display the relative path.
37
+
38
+ ## Example results
39
+
40
+ ```
41
+ files in current directory:
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
+
53
+ directories in current directory:
54
+ doc
55
+ examples
56
+ lib
57
+ old-gems
58
+ test
59
+
60
+ files and directories in current directory:
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
+ ```
77
+
@@ -0,0 +1,19 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
+
5
+ require 'recls'
6
+
7
+ puts "files in current directory:"
8
+ Recls.file_search(nil, nil, Recls::FILES).each { |fe| puts "\t#{fe.search_relative_path}" }
9
+ puts
10
+
11
+ puts "directories in current directory:"
12
+ Recls.file_search(nil, nil, Recls::DIRECTORIES).each { |fe| puts "\t#{fe.search_relative_path}" }
13
+ puts
14
+
15
+ puts "files and directories in current directory:"
16
+ Recls.file_search(nil, nil, Recls::DIRECTORIES | Recls::FILES).each { |fe| puts "\t#{fe.search_relative_path}" }
17
+ puts
18
+
19
+
@@ -0,0 +1,304 @@
1
+ # recls.Ruby Example - **find_files_and_directories.recursive**
2
+
3
+ ## Summary
4
+
5
+ Illustrates recursive finding of FILES, then DIRECTORIES, then both
6
+
7
+ ## Source
8
+
9
+ ```ruby
10
+ #! /usr/bin/env ruby
11
+
12
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
13
+
14
+ require 'recls'
15
+
16
+ puts "files under current directory:"
17
+ Recls.file_rsearch(nil, nil, Recls::FILES).each { |fe| puts "\t#{fe.search_relative_path}" }
18
+ puts
19
+
20
+ puts "directories under current directory:"
21
+ Recls.file_rsearch(nil, nil, Recls::DIRECTORIES | Recls::MARK_DIRECTORIES).each { |fe| puts "\t#{fe.search_relative_path}" }
22
+ puts
23
+
24
+ puts "files and directories under current directory:"
25
+ Recls.file_rsearch(nil, nil, Recls::DIRECTORIES | Recls::FILES | Recls::MARK_DIRECTORIES).each { |fe| puts "\t#{fe.search_relative_path}" }
26
+ puts
27
+ ```
28
+
29
+ ## Discussion
30
+
31
+ The code is pretty self-explanatory, in that there are three searches using
32
+ the ```Recls.file_rsearch()``` module method, passing FILES, DIRECTORIES, and
33
+ FILES|DIRECTORIES, respectively. For each search, a simple block is
34
+ presented, which takes a single-parameter of the file-entry (of type
35
+ ``Recls::Entry``) from which the ``#search_relative_path`` instance
36
+ attribute is used to display the relative path. For clarity, directories are
37
+ marked with trailing slashes.
38
+
39
+ ## Example results
40
+
41
+ ```
42
+ files under current directory:
43
+ build_gem.cmd
44
+ build_gem.sh
45
+ CHANGES.md
46
+ EXAMPLES.md
47
+ generate_rdoc.sh
48
+ LICENSE
49
+ Rakefile
50
+ README.md
51
+ recls-ruby-2.10.1.gem
52
+ recls.gemspec
53
+ run_all_unit_tests.sh
54
+ doc/CHANGES_md.html
55
+ doc/created.rid
56
+ doc/EXAMPLES_md.html
57
+ doc/index.html
58
+ doc/LICENSE.html
59
+ doc/README_md.html
60
+ doc/Recls.html
61
+ doc/table_of_contents.html
62
+ doc/css/fonts.css
63
+ doc/css/rdoc.css
64
+ doc/examples/show_hidden_files_md.html
65
+ doc/examples/show_readonly_files_md.html
66
+ doc/fonts/Lato-Light.ttf
67
+ doc/fonts/Lato-LightItalic.ttf
68
+ doc/fonts/Lato-Regular.ttf
69
+ doc/fonts/Lato-RegularItalic.ttf
70
+ doc/fonts/SourceCodePro-Bold.ttf
71
+ doc/fonts/SourceCodePro-Regular.ttf
72
+ doc/images/add.png
73
+ doc/images/arrow_up.png
74
+ doc/images/brick.png
75
+ doc/images/brick_link.png
76
+ doc/images/bug.png
77
+ doc/images/bullet_black.png
78
+ doc/images/bullet_toggle_minus.png
79
+ doc/images/bullet_toggle_plus.png
80
+ doc/images/date.png
81
+ doc/images/delete.png
82
+ doc/images/find.png
83
+ doc/images/loadingAnimation.gif
84
+ doc/images/macFFBgHack.png
85
+ doc/images/package.png
86
+ doc/images/page_green.png
87
+ doc/images/page_white_text.png
88
+ doc/images/page_white_width.png
89
+ doc/images/plugin.png
90
+ doc/images/ruby.png
91
+ doc/images/tag_blue.png
92
+ doc/images/tag_green.png
93
+ doc/images/transparent.png
94
+ doc/images/wrench.png
95
+ doc/images/wrench_orange.png
96
+ doc/images/zoom.png
97
+ doc/js/darkfish.js
98
+ doc/js/jquery.js
99
+ doc/js/navigation.js
100
+ doc/js/navigation.js.gz
101
+ doc/js/search.js
102
+ doc/js/search_index.js
103
+ doc/js/search_index.js.gz
104
+ doc/js/searcher.js
105
+ doc/js/searcher.js.gz
106
+ doc/Recls/Entry.html
107
+ examples/find_files_and_directories.md
108
+ examples/find_files_and_directories.rb
109
+ examples/find_files_and_directories.recursive.md
110
+ examples/find_files_and_directories.recursive.rb
111
+ examples/show_hidden_files.md
112
+ examples/show_hidden_files.rb
113
+ examples/show_readonly_files.md
114
+ examples/show_readonly_files.rb
115
+ lib/recls.rb
116
+ lib/recls/api.rb
117
+ lib/recls/combine_paths_1.rb
118
+ lib/recls/combine_paths_2plus.rb
119
+ lib/recls/entry.rb
120
+ lib/recls/file_search.rb
121
+ lib/recls/flags.rb
122
+ lib/recls/foreach.rb
123
+ lib/recls/obsolete.rb
124
+ lib/recls/recls.rb
125
+ lib/recls/stat.rb
126
+ lib/recls/util.rb
127
+ lib/recls/version.rb
128
+ lib/recls/ximpl/os.rb
129
+ lib/recls/ximpl/unix.rb
130
+ lib/recls/ximpl/util.rb
131
+ lib/recls/ximpl/windows.rb
132
+ old-gems/recls-2.6.3.gem
133
+ old-gems/recls-ruby-2.10.0.gem
134
+ test/fixtures/readonly/file-1
135
+ test/fixtures/readonly/file-2
136
+ test/scratch/test_display_parts.rb
137
+ test/scratch/test_entry.rb
138
+ test/scratch/test_files_and_directories.rb
139
+ test/scratch/test_foreach.rb
140
+ test/scratch/test_module_function.rb
141
+ test/scratch/test_show_dev_and_ino.rb
142
+ test/scratch/test_show_hidden.rb
143
+ test/unit/tc_recls_entries.rb
144
+ test/unit/tc_recls_entry.rb
145
+ test/unit/tc_recls_file_search.rb
146
+ test/unit/tc_recls_module.rb
147
+ test/unit/tc_recls_util.rb
148
+ test/unit/tc_recls_ximpl_util.rb
149
+ test/unit/test_all_separately.cmd
150
+ test/unit/test_all_separately.sh
151
+ test/unit/ts_all.rb
152
+
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/
172
+
173
+ files and directories under current directory:
174
+ build_gem.cmd
175
+ build_gem.sh
176
+ CHANGES.md
177
+ doc/
178
+ examples/
179
+ EXAMPLES.md
180
+ generate_rdoc.sh
181
+ lib/
182
+ LICENSE
183
+ old-gems/
184
+ Rakefile
185
+ README.md
186
+ recls-ruby-2.10.1.gem
187
+ recls.gemspec
188
+ run_all_unit_tests.sh
189
+ test/
190
+ doc/CHANGES_md.html
191
+ doc/created.rid
192
+ doc/css/
193
+ doc/examples/
194
+ doc/EXAMPLES_md.html
195
+ doc/fonts/
196
+ doc/images/
197
+ doc/index.html
198
+ doc/js/
199
+ doc/LICENSE.html
200
+ doc/README_md.html
201
+ doc/Recls/
202
+ doc/Recls.html
203
+ doc/table_of_contents.html
204
+ doc/css/fonts.css
205
+ doc/css/rdoc.css
206
+ doc/examples/show_hidden_files_md.html
207
+ doc/examples/show_readonly_files_md.html
208
+ doc/fonts/Lato-Light.ttf
209
+ doc/fonts/Lato-LightItalic.ttf
210
+ doc/fonts/Lato-Regular.ttf
211
+ doc/fonts/Lato-RegularItalic.ttf
212
+ doc/fonts/SourceCodePro-Bold.ttf
213
+ doc/fonts/SourceCodePro-Regular.ttf
214
+ doc/images/add.png
215
+ doc/images/arrow_up.png
216
+ doc/images/brick.png
217
+ doc/images/brick_link.png
218
+ doc/images/bug.png
219
+ doc/images/bullet_black.png
220
+ doc/images/bullet_toggle_minus.png
221
+ doc/images/bullet_toggle_plus.png
222
+ doc/images/date.png
223
+ doc/images/delete.png
224
+ doc/images/find.png
225
+ doc/images/loadingAnimation.gif
226
+ doc/images/macFFBgHack.png
227
+ doc/images/package.png
228
+ doc/images/page_green.png
229
+ doc/images/page_white_text.png
230
+ doc/images/page_white_width.png
231
+ doc/images/plugin.png
232
+ doc/images/ruby.png
233
+ doc/images/tag_blue.png
234
+ doc/images/tag_green.png
235
+ doc/images/transparent.png
236
+ doc/images/wrench.png
237
+ doc/images/wrench_orange.png
238
+ doc/images/zoom.png
239
+ doc/js/darkfish.js
240
+ doc/js/jquery.js
241
+ doc/js/navigation.js
242
+ doc/js/navigation.js.gz
243
+ doc/js/search.js
244
+ doc/js/search_index.js
245
+ doc/js/search_index.js.gz
246
+ doc/js/searcher.js
247
+ doc/js/searcher.js.gz
248
+ doc/Recls/Entry.html
249
+ examples/find_files_and_directories.md
250
+ examples/find_files_and_directories.rb
251
+ examples/find_files_and_directories.recursive.md
252
+ examples/find_files_and_directories.recursive.rb
253
+ examples/show_hidden_files.md
254
+ examples/show_hidden_files.rb
255
+ examples/show_readonly_files.md
256
+ examples/show_readonly_files.rb
257
+ lib/recls/
258
+ lib/recls.rb
259
+ lib/recls/api.rb
260
+ lib/recls/combine_paths_1.rb
261
+ lib/recls/combine_paths_2plus.rb
262
+ lib/recls/entry.rb
263
+ lib/recls/file_search.rb
264
+ lib/recls/flags.rb
265
+ lib/recls/foreach.rb
266
+ lib/recls/obsolete.rb
267
+ lib/recls/recls.rb
268
+ lib/recls/stat.rb
269
+ lib/recls/util.rb
270
+ lib/recls/version.rb
271
+ lib/recls/ximpl/
272
+ lib/recls/ximpl/os.rb
273
+ lib/recls/ximpl/unix.rb
274
+ lib/recls/ximpl/util.rb
275
+ lib/recls/ximpl/windows.rb
276
+ old-gems/recls-2.6.3.gem
277
+ old-gems/recls-ruby-2.10.0.gem
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
285
+ test/scratch/test_display_parts.rb
286
+ test/scratch/test_entry.rb
287
+ test/scratch/test_files_and_directories.rb
288
+ test/scratch/test_foreach.rb
289
+ test/scratch/test_module_function.rb
290
+ test/scratch/test_show_dev_and_ino.rb
291
+ test/scratch/test_show_hidden.rb
292
+ test/unit/tc_recls_entries.rb
293
+ test/unit/tc_recls_entry.rb
294
+ test/unit/tc_recls_file_search.rb
295
+ test/unit/tc_recls_module.rb
296
+ test/unit/tc_recls_util.rb
297
+ test/unit/tc_recls_ximpl_util.rb
298
+ test/unit/test_all_separately.cmd
299
+ test/unit/test_all_separately.sh
300
+ test/unit/ts_all.rb
301
+ ```
302
+
303
+
304
+