Module: AlacrittyThemes::FileHelper
- Included in:
- CLI
- Defined in:
- lib/alacritty_themes/file_helper.rb
Overview
:nodoc:
Instance Method Summary collapse
- #create_backup_file ⇒ Object
- #create_directory_path ⇒ Object
- #create_file ⇒ Object
- #directory_path ⇒ Object
- #does_file_exist? ⇒ Boolean
- #does_path_exist? ⇒ Boolean
- #file_path ⇒ Object
Instance Method Details
#create_backup_file ⇒ Object
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_path ⇒ Object
11 12 13 |
# File 'lib/alacritty_themes/file_helper.rb', line 11 def create_directory_path FileUtils.mkdir_p(directory_path) end |
#create_file ⇒ Object
7 8 9 |
# File 'lib/alacritty_themes/file_helper.rb', line 7 def create_file FileUtils.touch(file_path) end |
#directory_path ⇒ Object
31 32 33 |
# File 'lib/alacritty_themes/file_helper.rb', line 31 def directory_path File.dirname(file_path) end |
#does_file_exist? ⇒ 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
23 24 25 |
# File 'lib/alacritty_themes/file_helper.rb', line 23 def does_path_exist? File.directory?(directory_path) end |
#file_path ⇒ Object
27 28 29 |
# File 'lib/alacritty_themes/file_helper.rb', line 27 def file_path File.join(Dir.home, ".config/alacritty/alacritty.yml") end |