recls-ruby 2.11.0.1 → 2.11.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -16
- data/lib/recls/api.rb +16 -15
- data/lib/recls/combine_paths_1.rb +3 -2
- data/lib/recls/combine_paths_2plus.rb +7 -6
- data/lib/recls/entry.rb +17 -16
- data/lib/recls/file_search.rb +14 -15
- data/lib/recls/flags.rb +1 -0
- data/lib/recls/foreach.rb +8 -6
- data/lib/recls/stat.rb +11 -10
- data/lib/recls/util.rb +12 -11
- data/lib/recls/version.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23a8a51073ad4754f1650733f045648043d0839409858c5cef95bc107459487b
|
4
|
+
data.tar.gz: 5b0de6244a150cfcd0cb14c6895ce54a88367a56fad266b7c688abf33b4fa276
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e835ffb4519c33d3c767f006f4743bba0131ab84c654573556f7a20d88755bae97c884dc854092528862d31ecdaa57f878d9c319d9b8608bdb08f0d365181044
|
7
|
+
data.tar.gz: 69dab90ab454d1d3377aed781533ed7d19c5d43c65492b910f84bec2dd1e8a1ff11e9cfc646fb40e8130fa52d82a2a897ba7581a4108fc8d61bd557a7d2cdd50
|
data/README.md
CHANGED
@@ -57,43 +57,43 @@ module Recls
|
|
57
57
|
# ##########################
|
58
58
|
# Name-related attributes
|
59
59
|
|
60
|
-
# (String) A normalised form of #path that can be used in comparisons
|
60
|
+
# (+String+) A normalised form of #path that can be used in comparisons
|
61
61
|
attr_reader :compare_path
|
62
62
|
|
63
|
-
# (String) The full-path of the instance
|
63
|
+
# (+String+) The full-path of the instance
|
64
64
|
attr_reader :path
|
65
|
-
# (String) The (Windows) short-form of #path, or +nil+ if not on Windows
|
65
|
+
# (+String+) The (Windows) short-form of #path, or +nil+ if not on Windows
|
66
66
|
attr_reader :short_path
|
67
|
-
# (String) The (Windows) drive. +nil+ if does not exist
|
67
|
+
# (+String+) The (Windows) drive. +nil+ if does not exist
|
68
68
|
attr_reader :drive
|
69
|
-
# (String) The full path of the entry's directory (taking into account the
|
69
|
+
# (+String+) The full path of the entry's directory (taking into account the
|
70
70
|
# #drive if on Windows)
|
71
71
|
attr_reader :directory_path
|
72
72
|
alias_method :dirname, :directory_path
|
73
|
-
# (String) The entry's directory (excluding the #drive if on Windows)
|
73
|
+
# (+String+) The entry's directory (excluding the #drive if on Windows)
|
74
74
|
attr_reader :directory
|
75
|
-
# ([String]) An array of directory parts, where each part ends in Recls::PATH_NAME_SEPARATOR
|
75
|
+
# (+[ String ]+) An array of directory parts, where each part ends in Recls::PATH_NAME_SEPARATOR
|
76
76
|
attr_reader :directory_parts
|
77
|
-
# (String) The entry's file name (combination of #stem + #extension)
|
77
|
+
# (+String+) The entry's file name (combination of #stem + #extension)
|
78
78
|
attr_reader :file_full_name
|
79
|
-
# (String) The (Windows) short-form of #basename, or +nil+ if not on Windows
|
79
|
+
# (+String+) The (Windows) short-form of #basename, or +nil+ if not on Windows
|
80
80
|
attr_reader :file_short_name
|
81
81
|
alias_method :basename, :file_full_name
|
82
|
-
# (String) The entry's file stem
|
82
|
+
# (+String+) The entry's file stem
|
83
83
|
attr_reader :file_name_only
|
84
84
|
alias_method :stem, :file_name_only
|
85
|
-
# (String) The entry's file extension
|
85
|
+
# (+String+) The entry's file extension
|
86
86
|
attr_reader :file_extension
|
87
87
|
alias_method :extension, :file_extension
|
88
|
-
# (String) The search directory if specified; +nil+ otherwise
|
88
|
+
# (+String+) The search directory if specified; +nil+ otherwise
|
89
89
|
attr_reader :search_directory
|
90
|
-
# (String) The #path relative to #search_directory; +nil+ if no search directory specified
|
90
|
+
# (+String+) The #path relative to #search_directory; +nil+ if no search directory specified
|
91
91
|
attr_reader :search_relative_path
|
92
|
-
# (String) The #directory relative to #search_directory; +nil+ if no search directory specified
|
92
|
+
# (+String+) The #directory relative to #search_directory; +nil+ if no search directory specified
|
93
93
|
attr_reader :search_relative_directory
|
94
|
-
# (String) The #directory_path relative to #search_directory; +nil+ if no search directory specified
|
94
|
+
# (+String+) The #directory_path relative to #search_directory; +nil+ if no search directory specified
|
95
95
|
attr_reader :search_relative_directory_path
|
96
|
-
# ([String]) The #directory_parts relative to #search_directory; +nil+ if no search directory specified
|
96
|
+
# (+[ String ]+) The #directory_parts relative to #search_directory; +nil+ if no search directory specified
|
97
97
|
attr_reader :search_relative_directory_parts
|
98
98
|
|
99
99
|
# ##########################
|
data/lib/recls/api.rb
CHANGED
@@ -44,32 +44,33 @@ require 'recls/flags'
|
|
44
44
|
=begin
|
45
45
|
=end
|
46
46
|
|
47
|
+
# @!visibility private
|
47
48
|
class Object; end # :nodoc:
|
48
49
|
|
49
50
|
module Recls
|
50
51
|
|
51
|
-
# [DEPRECATED] Use Recls::file_search()
|
52
|
+
# [DEPRECATED] Use +Recls::file_search()+
|
52
53
|
def self.FileSearch(search_root, patterns, options = {})
|
53
54
|
|
54
55
|
Recls::FileSearch.new(search_root, patterns, options)
|
55
56
|
end
|
56
57
|
|
57
58
|
# Initialises a +FileSearch+ instance, which acts recursively, as an
|
58
|
-
# +Enumerable+ of Recls::Entry
|
59
|
+
# +Enumerable+ of +Recls::Entry+
|
59
60
|
#
|
60
61
|
# === Signature
|
61
62
|
#
|
62
63
|
# * *Parameters:*
|
63
|
-
# - +search_root+ (String
|
64
|
-
# - +patterns+ (String
|
65
|
-
# - +options+ (Hash
|
64
|
+
# - +search_root+ (+String+, +Recls::Entry+) The root directory of the search. May be +nil+, in which case the current directory is assumed;
|
65
|
+
# - +patterns+ (+String+, +Array+) The pattern(s) for which to search. May be +nil+, in which case +Recls::WILDCARDS_ALL+ is assumed;
|
66
|
+
# - +options+ (+Hash+, +Integer+) Combination of flags (with behaviour as described below for the +flags+ option), or an options hash;
|
66
67
|
#
|
67
68
|
# * *Options:*
|
68
|
-
# - +flags+ (Integer) Combination of flags - FILES
|
69
|
+
# - +flags+ (+Integer+) Combination of flags - +Recls::FILES+, +Recls::DIRECTORIES+, etc. If the value modulo +Recls::TYPEMASK+ is 0, then +Recls::FILES+ is assumed. The value +Recls::RECURSIVE+ is added by the function, and so need not be added by the caller; it cannot be removed
|
69
70
|
#
|
70
71
|
# === Return
|
71
|
-
# An instance of a class implementing
|
72
|
-
# Recls::Entry
|
72
|
+
# An instance of a class implementing +Enumerable+ whose value type is
|
73
|
+
# +Recls::Entry+.
|
73
74
|
def self.file_rsearch(search_root, patterns, options = {})
|
74
75
|
|
75
76
|
case options
|
@@ -94,21 +95,21 @@ module Recls
|
|
94
95
|
end
|
95
96
|
|
96
97
|
# Initialises a +FileSearch+ instance, which acts as an +Enumerable+
|
97
|
-
# of Recls::Entry
|
98
|
+
# of +Recls::Entry+
|
98
99
|
#
|
99
100
|
# === Signature
|
100
101
|
#
|
101
102
|
# * *Parameters:*
|
102
|
-
# - +search_root+ (String
|
103
|
-
# - +patterns+ (String
|
104
|
-
# - +options+ (Hash
|
103
|
+
# - +search_root+ (+String+, +Recls::Entry+) The root directory of the search. May be +nil+, in which case the current directory is assumed;
|
104
|
+
# - +patterns+ (+String+, +Array+) The pattern(s) for which to search. May be +nil+, in which case +Recls::WILDCARDS_ALL+ is assumed;
|
105
|
+
# - +options+ (+Hash+, +Integer+) Combination of flags (with behaviour as described below for the +flags+ option), or an options hash;
|
105
106
|
#
|
106
107
|
# * *Options:*
|
107
|
-
# - +flags+ (Integer) Combination of flags - FILES
|
108
|
+
# - +flags+ (+Integer+) Combination of flags - +Recls::FILES+, +Recls::DIRECTORIES+, +Recls::RECURSIVE+, etc. If the value modulo +Recls::TYPEMASK+ is 0, then +Recls::FILES+ is assumed
|
108
109
|
#
|
109
110
|
# === Return
|
110
|
-
# An instance of a class implementing
|
111
|
-
# Recls::Entry
|
111
|
+
# An instance of a class implementing +Enumerable+ whose value type is
|
112
|
+
# +Recls::Entry+.
|
112
113
|
def self.file_search(search_root, patterns, options = {})
|
113
114
|
|
114
115
|
Recls::FileSearch.new(search_root, patterns, options)
|
@@ -43,6 +43,7 @@ require 'recls/ximpl/util'
|
|
43
43
|
=begin
|
44
44
|
=end
|
45
45
|
|
46
|
+
# @!visibility private
|
46
47
|
class Object; end # :nodoc:
|
47
48
|
|
48
49
|
module Recls
|
@@ -52,10 +53,10 @@ module Recls
|
|
52
53
|
# === Signature
|
53
54
|
#
|
54
55
|
# * *Parameters:*
|
55
|
-
# - +paths+ ([
|
56
|
+
# - +paths+ (+[ String, Recls::Entry ]+) Array of 1 or more path elements to be combined;
|
56
57
|
#
|
57
58
|
# === Return
|
58
|
-
# (String) The combined path
|
59
|
+
# (+String+) The combined path.
|
59
60
|
def self.combine_paths(*paths)
|
60
61
|
|
61
62
|
paths = paths.reject { |p| p.nil? }
|
@@ -43,6 +43,7 @@ require 'recls/ximpl/util'
|
|
43
43
|
=begin
|
44
44
|
=end
|
45
45
|
|
46
|
+
# @!visibility private
|
46
47
|
class Object; end # :nodoc:
|
47
48
|
|
48
49
|
module Recls
|
@@ -52,16 +53,16 @@ module Recls
|
|
52
53
|
# === Signature
|
53
54
|
#
|
54
55
|
# * *Parameters:*
|
55
|
-
# - +paths+ ([
|
56
|
-
# - +options+ (
|
56
|
+
# - +paths+ (+[ String, Recls::Entry ]+) Array of 1 or more path elements to be combined;
|
57
|
+
# - +options+ (+Hash+) Options that moderate the combination;
|
57
58
|
#
|
58
59
|
# * *Options:*
|
59
|
-
# - +:canonicalise+ (boolean) Causes the evaluated path to be canonicalised - with +Recls.canonicalise_path+ - before it is returned
|
60
|
-
# - +:clean+ (boolean) Causes the evaluated path to be cleaned (i.e. sent to +cleanpath+) before it is returned. Ignored if +:canonicalise+ is specified
|
61
|
-
# - +:clean_path+ (boolean) Equivalent to +:clean+, but deprecated and may be removed in a future version
|
60
|
+
# - +:canonicalise+ (boolean) Causes the evaluated path to be canonicalised - with +Recls.canonicalise_path+ - before it is returned;
|
61
|
+
# - +:clean+ (boolean) Causes the evaluated path to be cleaned (i.e. sent to +cleanpath+) before it is returned. Ignored if +:canonicalise+ is specified;
|
62
|
+
# - +:clean_path+ (boolean) Equivalent to +:clean+, but deprecated and may be removed in a future version;
|
62
63
|
#
|
63
64
|
# === Return
|
64
|
-
# (String) The combined path
|
65
|
+
# (+String+) The combined path.
|
65
66
|
def self.combine_paths(*paths, **options)
|
66
67
|
|
67
68
|
paths = paths.reject { |p| p.nil? }
|
data/lib/recls/entry.rb
CHANGED
@@ -46,6 +46,7 @@ require 'recls/flags'
|
|
46
46
|
=begin
|
47
47
|
=end
|
48
48
|
|
49
|
+
# @!visibility private
|
49
50
|
class Object; end # :nodoc:
|
50
51
|
|
51
52
|
module Recls
|
@@ -112,43 +113,43 @@ module Recls
|
|
112
113
|
# ##########################
|
113
114
|
# Name-related attributes
|
114
115
|
|
115
|
-
# (String) A normalised form of #path that can be used in comparisons
|
116
|
+
# (+String+) A normalised form of #path that can be used in comparisons
|
116
117
|
attr_reader :compare_path
|
117
118
|
|
118
|
-
# (String) The full-path of the instance
|
119
|
+
# (+String+) The full-path of the instance
|
119
120
|
attr_reader :path
|
120
|
-
# (String) The (Windows) short-form of #path, or +nil+ if not on Windows
|
121
|
+
# (+String+) The (Windows) short-form of #path, or +nil+ if not on Windows
|
121
122
|
attr_reader :short_path
|
122
|
-
# (String) The (Windows) drive. +nil+ if does not exist
|
123
|
+
# (+String+) The (Windows) drive. +nil+ if does not exist
|
123
124
|
attr_reader :drive
|
124
|
-
# (String) The full path of the entry's directory (taking into account the
|
125
|
+
# (+String+) The full path of the entry's directory (taking into account the
|
125
126
|
# #drive if on Windows)
|
126
127
|
attr_reader :directory_path
|
127
128
|
alias_method :dirname, :directory_path
|
128
|
-
# (String) The entry's directory (excluding the #drive if on Windows)
|
129
|
+
# (+String+) The entry's directory (excluding the #drive if on Windows)
|
129
130
|
attr_reader :directory
|
130
|
-
# ([String]) An array of directory parts, where each part ends in Recls::PATH_NAME_SEPARATOR
|
131
|
+
# (+[ String ]+) An array of directory parts, where each part ends in Recls::PATH_NAME_SEPARATOR
|
131
132
|
attr_reader :directory_parts
|
132
|
-
# (String) The entry's file name (combination of #stem + #extension)
|
133
|
+
# (+String+) The entry's file name (combination of #stem + #extension)
|
133
134
|
attr_reader :file_full_name
|
134
|
-
# (String) The (Windows) short-form of #basename, or +nil+ if not on Windows
|
135
|
+
# (+String+) The (Windows) short-form of #basename, or +nil+ if not on Windows
|
135
136
|
attr_reader :file_short_name
|
136
137
|
alias_method :basename, :file_full_name
|
137
|
-
# (String) The entry's file stem
|
138
|
+
# (+String+) The entry's file stem
|
138
139
|
attr_reader :file_name_only
|
139
140
|
alias_method :stem, :file_name_only
|
140
|
-
# (String) The entry's file extension
|
141
|
+
# (+String+) The entry's file extension
|
141
142
|
attr_reader :file_extension
|
142
143
|
alias_method :extension, :file_extension
|
143
|
-
# (String) The search directory if specified; +nil+ otherwise
|
144
|
+
# (+String+) The search directory if specified; +nil+ otherwise
|
144
145
|
attr_reader :search_directory
|
145
|
-
# (String) The #path relative to #search_directory; +nil+ if no search directory specified
|
146
|
+
# (+String+) The #path relative to #search_directory; +nil+ if no search directory specified
|
146
147
|
attr_reader :search_relative_path
|
147
|
-
# (String) The #directory relative to #search_directory; +nil+ if no search directory specified
|
148
|
+
# (+String+) The #directory relative to #search_directory; +nil+ if no search directory specified
|
148
149
|
attr_reader :search_relative_directory
|
149
|
-
# (String) The #directory_path relative to #search_directory; +nil+ if no search directory specified
|
150
|
+
# (+String+) The #directory_path relative to #search_directory; +nil+ if no search directory specified
|
150
151
|
attr_reader :search_relative_directory_path
|
151
|
-
# ([String]) The #directory_parts relative to #search_directory; +nil+ if no search directory specified
|
152
|
+
# (+[ String ]+) The #directory_parts relative to #search_directory; +nil+ if no search directory specified
|
152
153
|
attr_reader :search_relative_directory_parts
|
153
154
|
|
154
155
|
# ##########################
|
data/lib/recls/file_search.rb
CHANGED
@@ -45,6 +45,7 @@ require 'recls/ximpl/os'
|
|
45
45
|
=begin
|
46
46
|
=end
|
47
47
|
|
48
|
+
# @!visibility private
|
48
49
|
class Object; end # :nodoc:
|
49
50
|
|
50
51
|
module Recls
|
@@ -59,16 +60,15 @@ module Recls
|
|
59
60
|
# === Signature
|
60
61
|
#
|
61
62
|
# * *Parameters:*
|
62
|
-
# - +search_root+ (String
|
63
|
-
# - +patterns+ (String
|
64
|
-
# - +options+ (Hash
|
63
|
+
# - +search_root+ (+String+, +Recls::Entry+) The root directory of the search. May be +nil+, in which case the current directory is assumed;
|
64
|
+
# - +patterns+ (+String+, +Array+) The pattern(s) for which to search. May be +nil+, in which case +Recls::WILDCARDS_ALL+ is assumed;
|
65
|
+
# - +options+ (+Hash+, +Integer+) Combination of flags (with behaviour as described below for the +flags+ option), or an options hash;
|
65
66
|
#
|
66
67
|
# * *Options:*
|
67
|
-
# - +flags+ (Integer) Combination of flags - FILES
|
68
|
+
# - +flags+ (+Integer+) Combination of flags - +Recls::FILES+, +Recls::DIRECTORIES+, +Recls::RECURSIVE+, etc. If the value modulo +Recls::TYPEMASK+ is 0, then +Recls::FILES+ is assumed;
|
68
69
|
#
|
69
70
|
# === Return
|
70
|
-
#
|
71
|
-
#
|
71
|
+
# An instance of the class.
|
72
72
|
def initialize(search_root, patterns, options={})
|
73
73
|
|
74
74
|
# for backwards compatibility, we allow for options to
|
@@ -132,11 +132,11 @@ module Recls
|
|
132
132
|
@flags = flags
|
133
133
|
end
|
134
134
|
|
135
|
-
# (String) The search root
|
135
|
+
# (+String+) The search root
|
136
136
|
attr_reader :search_root
|
137
|
-
# (String) The search patterns
|
137
|
+
# (+String+) The search patterns
|
138
138
|
attr_reader :patterns
|
139
|
-
# (Integer) The search flags
|
139
|
+
# (+Integer+) The search flags
|
140
140
|
attr_reader :flags
|
141
141
|
|
142
142
|
# Calls the block once for each found file, passing a single
|
@@ -218,12 +218,11 @@ module Recls
|
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
221
|
-
# searches all entries - files, directories, links, devices
|
222
|
-
#
|
223
|
-
#
|
224
|
-
#
|
225
|
-
#
|
226
|
-
# entry.
|
221
|
+
# searches all entries - files, directories, links, devices - that match
|
222
|
+
# the given +patterns+ in the given directory (+dir+) according to the
|
223
|
+
# given +flags+, invoking the given block (+blk+). The search directory
|
224
|
+
# (+search_root+) is passed in order to allow calculation of
|
225
|
+
# +#search_relative_path+ in the entry.
|
227
226
|
|
228
227
|
# @!visibility private
|
229
228
|
def FileSearch.search_directory_(search_root, dir, patterns, flags, &blk) # :nodoc:
|
data/lib/recls/flags.rb
CHANGED
data/lib/recls/foreach.rb
CHANGED
@@ -39,9 +39,11 @@
|
|
39
39
|
|
40
40
|
require 'recls/file_search'
|
41
41
|
|
42
|
+
|
42
43
|
=begin
|
43
44
|
=end
|
44
45
|
|
46
|
+
# @!visibility private
|
45
47
|
class Object; end # :nodoc:
|
46
48
|
|
47
49
|
module Recls
|
@@ -91,11 +93,11 @@ module Recls
|
|
91
93
|
# === Signature
|
92
94
|
#
|
93
95
|
# * *Parameters:*
|
94
|
-
# - +searchable+ A searchable instance obtained from Recls::file_search() or Recls::file_rsearch()
|
95
|
-
# - +search_root+ (String
|
96
|
-
# - +patterns+ (String
|
97
|
-
# - +options+ (Hash) An options hash
|
98
|
-
# - +flags+ (Integer) Combination of flags (with behaviour as described below for the +flags+ option)
|
96
|
+
# - +searchable+ A searchable instance obtained from +Recls::file_search()+ or +Recls::file_rsearch()+;
|
97
|
+
# - +search_root+ (+String+, +Recls::Entry+) The root directory of the search. May be +nil+, in which case the current directory is assumed;
|
98
|
+
# - +patterns+ (+String+, +Array+) The pattern(s) for which to search. May be +nil+, in which case +Recls::WILDCARDS_ALL+ is assumed;
|
99
|
+
# - +options+ (+Hash+) An options hash;
|
100
|
+
# - +flags+ (+Integer+) Combination of flags (with behaviour as described below for the +flags+ option);
|
99
101
|
#
|
100
102
|
# * *Block:*
|
101
103
|
# An optional block that will be executed once for each line in each file
|
@@ -111,7 +113,7 @@ module Recls
|
|
111
113
|
# - +search_root+, +patterns+, +options+
|
112
114
|
#
|
113
115
|
# === Return
|
114
|
-
#
|
116
|
+
# +nil+ if a block is given; otherwise, an instance of the +FileSearchLineEnumerator+.
|
115
117
|
def self.foreach(*args, &block)
|
116
118
|
|
117
119
|
fs = nil
|
data/lib/recls/stat.rb
CHANGED
@@ -44,6 +44,7 @@ require 'recls/flags'
|
|
44
44
|
=begin
|
45
45
|
=end
|
46
46
|
|
47
|
+
# @!visibility private
|
47
48
|
class Object; end # :nodoc:
|
48
49
|
|
49
50
|
module Recls
|
@@ -58,10 +59,10 @@ module Recls
|
|
58
59
|
# === Signature
|
59
60
|
#
|
60
61
|
# * *Parameters:*
|
61
|
-
# - +path+ (String
|
62
|
+
# - +path+ (+String+, +Recls::Entry+) The path;
|
62
63
|
#
|
63
64
|
# === Return
|
64
|
-
# (Recls::Entry
|
65
|
+
# (+Recls::Entry+, +nil+) The entry if +path+ exists and is a directory; +nil+ otherwise.
|
65
66
|
def self.directory?(path, *args)
|
66
67
|
|
67
68
|
fe = self.stat(path, *args)
|
@@ -84,10 +85,10 @@ module Recls
|
|
84
85
|
# === Signature
|
85
86
|
#
|
86
87
|
# * *Parameters:*
|
87
|
-
# - +path+ (String
|
88
|
+
# - +path+ (+String+, +Recls::Entry+) The path;
|
88
89
|
#
|
89
90
|
# === Return
|
90
|
-
# (Recls::Entry
|
91
|
+
# (+Recls::Entry+, +nil+) The entry if +path+ exists and is a file; +nil+ otherwise.
|
91
92
|
def self.file?(path, *args)
|
92
93
|
|
93
94
|
fe = self.stat(path, *args)
|
@@ -107,9 +108,9 @@ module Recls
|
|
107
108
|
# === Signature
|
108
109
|
#
|
109
110
|
# * *Parameters:*
|
110
|
-
# - +path+ (String) A path to evaluate. May not be +nil
|
111
|
-
# - +search_root+ (String
|
112
|
-
# - +flags+ (Integer) A bit-combined set of flags (such as Recls::DIRECTORIES
|
111
|
+
# - +path+ (+String+) A path to evaluate. May not be +nil+;
|
112
|
+
# - +search_root+ (+String+, +Recls::Entry+) A directory from which the returned Entry instance's search-relative attributes are evaluated;
|
113
|
+
# - +flags+ (+Integer+) A bit-combined set of flags (such as +Recls::DIRECTORIES+, +Recls::FILES+, +Recls::RECURSIVE+, +Recls::DETAILS_LATER+, and so on);
|
113
114
|
#
|
114
115
|
# ==== Parameter Ordering
|
115
116
|
#
|
@@ -121,10 +122,10 @@ module Recls
|
|
121
122
|
# - +path+, +search_root+, +flags+
|
122
123
|
#
|
123
124
|
# === Return
|
124
|
-
# (Recls::Entry) An entry representing the path on the file-system, or
|
125
|
+
# (+Recls::Entry+) An entry representing the path on the file-system, or
|
125
126
|
# +nil+ if the path does not refer to an existing entity. If the
|
126
|
-
# Recls::DETAILS_LATER flag is included, then an entry is returned
|
127
|
-
# regardless of its existence
|
127
|
+
# +Recls::DETAILS_LATER+ flag is included, then an entry is returned
|
128
|
+
# regardless of its existence.
|
128
129
|
def self.stat(path, *args)
|
129
130
|
|
130
131
|
flags = 0
|
data/lib/recls/util.rb
CHANGED
@@ -45,6 +45,7 @@ require 'recls/ximpl/os'
|
|
45
45
|
=begin
|
46
46
|
=end
|
47
47
|
|
48
|
+
# @!visibility private
|
48
49
|
class Object; end # :nodoc:
|
49
50
|
|
50
51
|
module Recls
|
@@ -54,10 +55,10 @@ module Recls
|
|
54
55
|
# === Signature
|
55
56
|
#
|
56
57
|
# * *Parameters:*
|
57
|
-
# - +path+ (String
|
58
|
+
# - +path+ (+String+, +Recls::Entry+) The path;
|
58
59
|
#
|
59
60
|
# === Return
|
60
|
-
# (String) The absolute form of the path
|
61
|
+
# (+String+) The absolute form of the path.
|
61
62
|
def self.absolute_path(path)
|
62
63
|
|
63
64
|
return path.path if 'Recls::Entry' === path.class.to_s
|
@@ -71,10 +72,10 @@ module Recls
|
|
71
72
|
# === Signature
|
72
73
|
#
|
73
74
|
# * *Parameters:*
|
74
|
-
# - +path+ (String
|
75
|
+
# - +path+ (+String+, +Recls::Entry+) The path;
|
75
76
|
#
|
76
77
|
# === Return
|
77
|
-
# (String) The canonical form of the path
|
78
|
+
# (+String+) The canonical form of the path.
|
78
79
|
def self.canonicalise_path(path)
|
79
80
|
|
80
81
|
path = path.path if 'Recls::Entry' === path.class.to_s
|
@@ -88,11 +89,11 @@ module Recls
|
|
88
89
|
# === Signature
|
89
90
|
#
|
90
91
|
# * *Parameters:*
|
91
|
-
# - +origin+ (String
|
92
|
-
# - +path+ (String
|
92
|
+
# - +origin+ (+String+, +Recls::Entry+) The path against which +path+ will be evaluated;
|
93
|
+
# - +path+ (+String+, +Recls::Entry+) The path to evaluate;
|
93
94
|
#
|
94
95
|
# === Return
|
95
|
-
# (String) The relative form of the path
|
96
|
+
# (+String+) The relative form of the path.
|
96
97
|
def self.derive_relative_path(origin, path)
|
97
98
|
|
98
99
|
Recls::Ximpl.derive_relative_path origin, path
|
@@ -115,10 +116,10 @@ module Recls
|
|
115
116
|
# === Signature
|
116
117
|
#
|
117
118
|
# * *Parameters:*
|
118
|
-
# - +path+ (String
|
119
|
+
# - +path+ (+String+, +Recls::Entry+) The path;
|
119
120
|
#
|
120
121
|
# === Return
|
121
|
-
# (Recls::Entry
|
122
|
+
# (+Recls::Entry+, +nil+) The entry if +path+ exists; +nil+ otherwise.
|
122
123
|
def self.exist?(path)
|
123
124
|
|
124
125
|
return nil if path.nil?
|
@@ -131,10 +132,10 @@ module Recls
|
|
131
132
|
# === Signature
|
132
133
|
#
|
133
134
|
# * *Parameters:*
|
134
|
-
# - +path+ (String
|
135
|
+
# - +path+ (+String+, +Recls::Entry+) The path;
|
135
136
|
#
|
136
137
|
# === Return
|
137
|
-
# (boolean) +true+ if +path+ is absolute; +false+ otherwise
|
138
|
+
# (boolean) +true+ if +path+ is absolute; +false+ otherwise.
|
138
139
|
def self.absolute_path?(path)
|
139
140
|
|
140
141
|
return nil if path.nil?
|
data/lib/recls/version.rb
CHANGED
@@ -40,12 +40,13 @@
|
|
40
40
|
=begin
|
41
41
|
=end
|
42
42
|
|
43
|
+
# @!visibility private
|
43
44
|
class Object; end # :nodoc:
|
44
45
|
|
45
46
|
module Recls
|
46
47
|
|
47
48
|
# Current version of the recls.Ruby library
|
48
|
-
VERSION = '2.11.0.
|
49
|
+
VERSION = '2.11.0.2'
|
49
50
|
|
50
51
|
private
|
51
52
|
VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
|