class FileHelper

Public Class Methods

directory(path) click to toggle source
# File lib/helpers/file_helper.rb, line 2
def self.directory(path)
  File.dirname(path).split('/').last
end
ingore_file?(path) click to toggle source
# File lib/helpers/file_helper.rb, line 6
def self.ingore_file?(path)
  IGNORE_FOLDERS.include? directory(path).downcase
end
is_jpeg?(path) click to toggle source
# File lib/helpers/file_helper.rb, line 10
def self.is_jpeg?(path)
  # remove . from the beginning
  extension = File.extname(path)[1..-1]
  return false if extension.nil?
  JPEG_EXTENSIONS.include? extension.downcase
end