Module: Lono::Utils::Item::FileMethods
- Included in:
- AppFile::Registry::Item, Configset::S3File::Item
- Defined in:
- lib/lono/utils/item/file_methods.rb
Instance Method Summary collapse
- #directory? ⇒ Boolean
- #exist? ⇒ Boolean
- #file? ⇒ Boolean
- #s3_path ⇒ Object
- #zip_file_name ⇒ Object
-
#zip_file_path ⇒ Object
full path.
Instance Method Details
#directory? ⇒ Boolean
7 8 9 |
# File 'lib/lono/utils/item/file_methods.rb', line 7 def directory? File.directory?(output_path) end |
#exist? ⇒ Boolean
3 4 5 |
# File 'lib/lono/utils/item/file_methods.rb', line 3 def exist? File.exist?(output_path) end |
#file? ⇒ Boolean
11 12 13 |
# File 'lib/lono/utils/item/file_methods.rb', line 11 def file? File.file?(output_path) end |
#s3_path ⇒ Object
15 16 17 18 |
# File 'lib/lono/utils/item/file_methods.rb', line 15 def s3_path path = zip_file_path.gsub("#{Lono.root}/",'') # remove Lono.root "#{Lono.env}/#{path}" end |
#zip_file_name ⇒ Object
25 26 27 |
# File 'lib/lono/utils/item/file_methods.rb', line 25 def zip_file_name "#{File.basename(output_path)}-#{@type}-#{Lono::Md5.sum(output_path)}.zip" end |
#zip_file_path ⇒ Object
full path
21 22 23 |
# File 'lib/lono/utils/item/file_methods.rb', line 21 def zip_file_path "#{File.dirname(output_path)}/#{zip_file_name}" end |