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

Instance Method Details

#directory?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/lono/utils/item/file_methods.rb', line 7

def directory?
  File.directory?(output_path)
end

#exist?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/lono/utils/item/file_methods.rb', line 3

def exist?
  File.exist?(output_path)
end

#file?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/lono/utils/item/file_methods.rb', line 11

def file?
  File.file?(output_path)
end

#s3_pathObject



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_nameObject



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_pathObject

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