Module: BuildDirectory
- Defined in:
- lib/autosparkle/helpers/build_directory_helpers.rb
Overview
This module is used to create a new path inside the build directory
Class Method Summary collapse
- .build_directory_path ⇒ Object
- .create_build_directory ⇒ Object
- .new_directory(name) ⇒ Object
- .new_file(name) ⇒ Object
- .new_path(name) ⇒ Object
Class Method Details
.build_directory_path ⇒ Object
11 12 13 |
# File 'lib/autosparkle/helpers/build_directory_helpers.rb', line 11 def self.build_directory_path @build_directory_path end |
.create_build_directory ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/autosparkle/helpers/build_directory_helpers.rb', line 15 def self.create_build_directory if File.directory?(build_directory_path) puts_if_verbose 'Cleaning up the build directory...' FileUtils.rm_rf(build_directory_path) end puts_if_verbose "Creating the build directory at #{build_directory_path} ..." FileUtils.mkdir_p(build_directory_path) end |
.new_directory(name) ⇒ Object
33 34 35 36 37 |
# File 'lib/autosparkle/helpers/build_directory_helpers.rb', line 33 def self.new_directory(name) path = new_path(name) FileUtils.mkdir_p(path) path end |
.new_file(name) ⇒ Object
29 30 31 |
# File 'lib/autosparkle/helpers/build_directory_helpers.rb', line 29 def self.new_file(name) File.open(new_path(name), 'w') end |
.new_path(name) ⇒ Object
25 26 27 |
# File 'lib/autosparkle/helpers/build_directory_helpers.rb', line 25 def self.new_path(name) "#{build_directory_path}/#{name}" end |