Module: Eco::Data::Files::ClassMethods
- Includes:
- Encoding, Folder, RelativePath, Timestamp
- Included in:
- Eco::Data::Files
- Defined in:
- lib/eco/data/files.rb
Constant Summary
Constants included from Timestamp
Constants included from Folder
Constants included from Encoding
Instance Attribute Summary
Attributes included from Language::AuxiliarLogger
Instance Method Summary collapse
- #copy_file(source_file, dest_file, time_stamp: false) ⇒ Object
-
#split(path) ⇒ Object
@todo: change method name to
split_path.
Methods included from RelativePath
Methods included from Timestamp
Methods included from Folder
#archive_file, #clear_folder, #csv_files, #ensure_file_path!, #ensure_folder!, #folder_files
Methods included from Language::AuxiliarLogger
Methods included from Encoding
#bom?, #encoding, #get_file_content_with_encoding, #remove_bom, #scoped_encoding
Instance Method Details
#copy_file(source_file, dest_file, time_stamp: false) ⇒ Object
40 41 42 43 |
# File 'lib/eco/data/files.rb', line 40 def copy_file(source_file, dest_file, time_stamp: false) dest_file = (dest_file) if time_stamp File.write(dest_file, File.read(source_file)) end |
#split(path) ⇒ Object
@todo: change method name to split_path
34 35 36 37 38 |
# File 'lib/eco/data/files.rb', line 34 def split(path) dir_path, file = File.split(path) dir_path = dir_path.gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR) dir_path.split(File::ALT_SEPARATOR || File::SEPARATOR).push(file) end |