recls-ruby 2.11.0 → 2.11.0.1

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 (43) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE +27 -24
  3. data/README.md +242 -1
  4. data/examples/find_files_and_directories.md +33 -30
  5. data/examples/find_files_and_directories.recursive.md +255 -254
  6. data/examples/show_hidden_files.md +4 -1
  7. data/examples/show_hidden_files.rb +1 -1
  8. data/examples/show_readonly_files.md +4 -1
  9. data/examples/show_readonly_files.rb +1 -1
  10. data/lib/recls/api.rb +75 -73
  11. data/lib/recls/combine_paths_1.rb +25 -23
  12. data/lib/recls/combine_paths_2plus.rb +31 -29
  13. data/lib/recls/entry.rb +276 -273
  14. data/lib/recls/file_search.rb +195 -193
  15. data/lib/recls/flags.rb +46 -45
  16. data/lib/recls/foreach.rb +103 -98
  17. data/lib/recls/obsolete.rb +80 -79
  18. data/lib/recls/recls.rb +16 -15
  19. data/lib/recls/stat.rb +136 -134
  20. data/lib/recls/util.rb +94 -92
  21. data/lib/recls/version.rb +17 -17
  22. data/lib/recls/ximpl/os.rb +45 -43
  23. data/lib/recls/ximpl/unix.rb +38 -35
  24. data/lib/recls/ximpl/util.rb +597 -596
  25. data/lib/recls/ximpl/windows.rb +139 -136
  26. data/lib/recls.rb +10 -9
  27. data/test/scratch/test_display_parts.rb +33 -33
  28. data/test/scratch/test_entry.rb +6 -6
  29. data/test/scratch/test_files_and_directories.rb +8 -8
  30. data/test/scratch/test_foreach.rb +10 -10
  31. data/test/scratch/test_module_function.rb +33 -33
  32. data/test/scratch/test_pattern_arrays.rb +5 -5
  33. data/test/scratch/test_show_dev_and_ino.rb +1 -1
  34. data/test/scratch/test_show_hidden.rb +3 -3
  35. data/test/unit/tc_recls_entries.rb +31 -31
  36. data/test/unit/tc_recls_entry.rb +19 -19
  37. data/test/unit/tc_recls_file_search.rb +32 -32
  38. data/test/unit/tc_recls_module.rb +25 -25
  39. data/test/unit/tc_recls_util.rb +161 -161
  40. data/test/unit/tc_recls_ximpl_util.rb +676 -676
  41. data/test/unit/test_all_separately.sh +1 -1
  42. data/test/unit/ts_all.rb +4 -4
  43. metadata +6 -6
@@ -1,14 +1,15 @@
1
- # ######################################################################### #
2
- # File: recls/ximpl/os.rb
1
+ # ######################################################################## #
2
+ # File: recls/ximpl/os.rb
3
3
  #
4
- # Purpose: Operating system internal implementation constructs for the
5
- # recls library.
4
+ # Purpose: Operating system internal implementation constructs for the
5
+ # recls library.
6
6
  #
7
- # Created: 16th February 2014
8
- # Updated: 14th April 2019
7
+ # Created: 16th February 2014
8
+ # Updated: 20th April 2024
9
9
  #
10
- # Author: Matthew Wilson
10
+ # Author: Matthew Wilson
11
11
  #
12
+ # Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
12
13
  # Copyright (c) 2012-2019, Matthew Wilson and Synesis Software
13
14
  # All rights reserved.
14
15
  #
@@ -34,7 +35,7 @@
34
35
  # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35
36
  # POSSIBILITY OF SUCH DAMAGE.
36
37
  #
37
- # ######################################################################### #
38
+ # ######################################################################## #
38
39
 
39
40
 
40
41
  =begin
@@ -44,56 +45,57 @@ module Recls # :nodoc:
44
45
 
45
46
  # :stopdoc:
46
47
 
47
- module Ximpl # :nodoc: all
48
+ module Ximpl # :nodoc: all
48
49
 
49
- module OS # :nodoc: all
50
+ module OS # :nodoc: all
50
51
 
51
- # @!visibility private
52
- OS_IS_WINDOWS = (RUBY_PLATFORM =~ /(mswin|mingw|bccwin|wince)/i) ? true : false
52
+ # @!visibility private
53
+ OS_IS_WINDOWS = (RUBY_PLATFORM =~ /(mswin|mingw|bccwin|wince)/i) ? true : false
53
54
 
54
- # @!visibility private
55
- PATH_NAME_SEPARATOR = OS_IS_WINDOWS ? '\\' : '/'
55
+ # @!visibility private
56
+ PATH_NAME_SEPARATOR = OS_IS_WINDOWS ? '\\' : '/'
56
57
 
57
- # @!visibility private
58
- PATH_SEPARATOR = OS_IS_WINDOWS ? ';' : ':'
58
+ # @!visibility private
59
+ PATH_SEPARATOR = OS_IS_WINDOWS ? ';' : ':'
59
60
 
60
- # @!visibility private
61
- WILDCARDS_ALL = OS_IS_WINDOWS ? '*' : '*'
61
+ # @!visibility private
62
+ WILDCARDS_ALL = OS_IS_WINDOWS ? '*' : '*'
62
63
 
63
- # @!visibility private
64
- def OS.get_number_of_dots_dir_(p) # :nodoc:
64
+ # @!visibility private
65
+ def OS.get_number_of_dots_dir_(p) # :nodoc:
65
66
 
66
- if p
67
- if ?. == p[0]
68
- return 1 if 1 == p.size
69
- return 1 if ?/ == p[1]
70
- return 1 if OS_IS_WINDOWS and ?\\ == p[1]
71
- if ?. == p[1]
72
- return 2 if 2 == p.size
73
- return 2 if ?/ == p[2]
74
- return 2 if OS_IS_WINDOWS and ?\\ == p[2]
75
- end
76
- end
77
- end
67
+ if p
68
+ if ?. == p[0]
69
+ return 1 if 1 == p.size
70
+ return 1 if ?/ == p[1]
71
+ return 1 if OS_IS_WINDOWS and ?\\ == p[1]
72
+ if ?. == p[1]
73
+ return 2 if 2 == p.size
74
+ return 2 if ?/ == p[2]
75
+ return 2 if OS_IS_WINDOWS and ?\\ == p[2]
76
+ end
77
+ end
78
+ end
78
79
 
79
- return 0
80
- end
80
+ return 0
81
+ end
81
82
 
82
- # @!visibility private
83
- def OS.is_root_dir_(p) # :nodoc:
83
+ # @!visibility private
84
+ def OS.is_root_dir_(p) # :nodoc:
84
85
 
85
- return nil if not p
86
- return true if '/' == p
87
- return true if OS_IS_WINDOWS and '\\' == p
86
+ return nil if not p
87
+ return true if '/' == p
88
+ return true if OS_IS_WINDOWS and '\\' == p
88
89
 
89
- return false
90
- end
91
- end # module OS
92
- end # module Ximpl
90
+ return false
91
+ end
92
+ end # module OS
93
+ end # module Ximpl
93
94
 
94
95
  # :startdoc:
95
96
 
96
97
  end # module Recls
97
98
 
99
+
98
100
  # ############################## end of file ############################# #
99
101
 
@@ -1,13 +1,14 @@
1
- # ######################################################################### #
2
- # File: recls/ximpl/unix.rb
1
+ # ######################################################################## #
2
+ # File: recls/ximpl/unix.rb
3
3
  #
4
- # Purpose: UNIX-specific constructs for the recls library.
4
+ # Purpose: UNIX-specific constructs for the recls library.
5
5
  #
6
- # Created: 19th February 2014
7
- # Updated: 14th April 2019
6
+ # Created: 19th February 2014
7
+ # Updated: 20th April 2024
8
8
  #
9
- # Author: Matthew Wilson
9
+ # Author: Matthew Wilson
10
10
  #
11
+ # Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
11
12
  # Copyright (c) 2012-2019, Matthew Wilson and Synesis Software
12
13
  # All rights reserved.
13
14
  #
@@ -33,11 +34,12 @@
33
34
  # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
35
  # POSSIBILITY OF SUCH DAMAGE.
35
36
  #
36
- # ######################################################################### #
37
+ # ######################################################################## #
37
38
 
38
39
 
39
40
  require 'recls/ximpl/util'
40
41
 
42
+
41
43
  =begin
42
44
  =end
43
45
 
@@ -45,50 +47,51 @@ module Recls # :nodoc:
45
47
 
46
48
  # :stopdoc:
47
49
 
48
- module Ximpl # :nodoc: all
50
+ module Ximpl # :nodoc: all
49
51
 
50
- # @!visibility private
51
- class FileStat < File::Stat # :nodoc:
52
+ # @!visibility private
53
+ class FileStat < File::Stat # :nodoc:
52
54
 
53
- private
54
- # @!visibility private
55
- def initialize(path) # :nodoc:
55
+ private
56
+ # @!visibility private
57
+ def initialize(path) # :nodoc:
56
58
 
57
- @path = path
59
+ @path = path
58
60
 
59
- super(path)
60
- end
61
+ super(path)
62
+ end
61
63
 
62
- public
63
- # @!visibility private
64
- attr_reader :path # :nodoc:
64
+ public
65
+ # @!visibility private
66
+ attr_reader :path # :nodoc:
65
67
 
66
- # @!visibility private
67
- def hidden? # :nodoc:
68
+ # @!visibility private
69
+ def hidden? # :nodoc:
68
70
 
69
- basename = File.basename @path
71
+ basename = File.basename @path
70
72
 
71
- return false if basename.empty?
72
- return false if '.' == basename
73
- return false if '..' == basename
74
- return false if ?. != basename[0]
73
+ return false if basename.empty?
74
+ return false if '.' == basename
75
+ return false if '..' == basename
76
+ return false if ?. != basename[0]
75
77
 
76
- return true
77
- end
78
+ return true
79
+ end
78
80
 
79
- public
80
- # @!visibility private
81
- def FileStat.stat(path) # :nodoc:
81
+ public
82
+ # @!visibility private
83
+ def FileStat.stat(path) # :nodoc:
82
84
 
83
- Recls::Ximpl::FileStat.new(path)
85
+ Recls::Ximpl::FileStat.new(path)
84
86
 
85
- end
86
- end # class FileStat
87
- end # module Ximpl
87
+ end
88
+ end # class FileStat
89
+ end # module Ximpl
88
90
 
89
91
  # :startdoc:
90
92
 
91
93
  end # module Recls
92
94
 
95
+
93
96
  # ############################## end of file ############################# #
94
97