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)


5
6
7
8
# File 'lib/ki/middleware/helpers/public_file_helper.rb', line 5

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

#public_file_path(path) ⇒ Object



10
11
12
13
# File 'lib/ki/middleware/helpers/public_file_helper.rb', line 10

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