Module: AlacrittyThemes::FileHelper

Included in:
CLI
Defined in:
lib/alacritty_themes/file_helper.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#create_backup_fileObject



15
16
17
# File 'lib/alacritty_themes/file_helper.rb', line 15

def create_backup_file
  FileUtils.mv(file_path, "#{file_path}.bak")
end

#create_directory_pathObject



11
12
13
# File 'lib/alacritty_themes/file_helper.rb', line 11

def create_directory_path
  FileUtils.mkdir_p(directory_path)
end

#create_fileObject



7
8
9
# File 'lib/alacritty_themes/file_helper.rb', line 7

def create_file
  FileUtils.touch(file_path)
end

#directory_pathObject



31
32
33
# File 'lib/alacritty_themes/file_helper.rb', line 31

def directory_path
  File.dirname(file_path)
end

#does_file_exist?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/alacritty_themes/file_helper.rb', line 19

def does_file_exist?
  File.exist?(file_path)
end

#does_path_exist?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/alacritty_themes/file_helper.rb', line 23

def does_path_exist?
  File.directory?(directory_path)
end

#file_pathObject



27
28
29
# File 'lib/alacritty_themes/file_helper.rb', line 27

def file_path
  File.join(Dir.home, ".config/alacritty/alacritty.yml")
end