Class: Findler::Path
- Inherits:
-
Object
- Object
- Findler::Path
- Defined in:
- lib/findler/path.rb
Class Method Summary collapse
- .base(path) ⇒ Object
- .base_array(array) ⇒ Object
- .clean(path) ⇒ Object
- .clean_array(array) ⇒ Object
- .hidden?(path) ⇒ Boolean
Class Method Details
.base(path) ⇒ Object
11 12 13 |
# File 'lib/findler/path.rb', line 11 def self.base(path) path.basename.to_s end |
.base_array(array) ⇒ Object
19 20 21 |
# File 'lib/findler/path.rb', line 19 def self.base_array(array) array.map { |ea| base(ea) } end |
.clean(path) ⇒ Object
5 6 7 8 9 |
# File 'lib/findler/path.rb', line 5 def self.clean(path) path = Pathname.new(path) unless path.is_a? Pathname path = path. unless path.absolute? path end |
.clean_array(array) ⇒ Object
15 16 17 |
# File 'lib/findler/path.rb', line 15 def self.clean_array(array) array.map { |ea| clean(ea) } end |
.hidden?(path) ⇒ Boolean
23 24 25 |
# File 'lib/findler/path.rb', line 23 def self.hidden?(path) base(path).start_with?('.') end |