Class: Findler::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/findler/path.rb

Class Method Summary collapse

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.expand_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

Returns:

  • (Boolean)


23
24
25
# File 'lib/findler/path.rb', line 23

def self.hidden?(path)
  base(path).start_with?('.')
end