Module: FileSystem

Included in:
Core, Install
Defined in:
lib/dotfiles/utils/fs.rb

Overview

File: fs.rb Project: dotfiles-cli Author: exstnce ([email protected]) Created on Monday, 9th July 2018 9:47:06 pm

Class Method Summary collapse

Class Method Details

.contents(path) ⇒ Object



26
27
28
# File 'lib/dotfiles/utils/fs.rb', line 26

def self.contents(path)
  path+'*'
end

.dot(path) ⇒ Object



22
23
24
# File 'lib/dotfiles/utils/fs.rb', line 22

def self.dot(path)
 path+'.' 
end

.mkdir(path) ⇒ Object



30
31
32
33
# File 'lib/dotfiles/utils/fs.rb', line 30

def self.mkdir(path)
  Dir.mkdir(path) unless File.exists?(path)
  path
end

.rglob(root) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'lib/dotfiles/utils/fs.rb', line 35

def self.rglob(root)
  files = Dir.glob(root+'.*')

  files.delete(root+'.dotfiles/')
  files.delete(root+'.')
  files.delete(root+'..')

  files
end