Module: Ki::Middleware::Helpers::PublicFile

Defined in:
lib/ki/middleware/helpers/public_file_helper.rb

Instance Method Summary collapse

Instance Method Details

#public_file_exists?(path) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/ki/middleware/helpers/public_file_helper.rb', line 7

def public_file_exists?(path)
  path = path.path if path.class == BaseRequest
  File.file?(public_file_path(path))
end

#public_file_path(path) ⇒ Object



12
13
14
15
# File 'lib/ki/middleware/helpers/public_file_helper.rb', line 12

def public_file_path(path)
  path = path.path if path.class == BaseRequest
  File.join(Ki::PUBLIC_PATH, path)
end