module FFaker::Filesystem

Public Instance Methods

directory(directory_separator = File::SEPARATOR) click to toggle source
# File lib/ffaker/filesystem.rb, line 16
def directory(directory_separator = File::SEPARATOR)
  Lorem.words.join(directory_separator)
end
extension() click to toggle source
# File lib/ffaker/filesystem.rb, line 8
def extension
  fetch_sample(EXTENSION)
end
file_name( *args, dir: directory, name: Lorem.word.downcase, ext: extension, directory_separator: File::SEPARATOR ) click to toggle source
# File lib/ffaker/filesystem.rb, line 20
def file_name(
  *args,
  dir: directory, name: Lorem.word.downcase, ext: extension, directory_separator: File::SEPARATOR
)
  if args.any?
    warn "Positional arguments for Filesystem##{__method__} are deprecated. Please use keyword arguments."
    dir = args[0]
    name = args[1] if args.size > 1
    ext = args[2] if args.size > 2
    directory_separator = args[3] if args.size > 3
  end

  "#{dir}#{directory_separator}#{name}.#{ext}"
end
mime_type() click to toggle source
# File lib/ffaker/filesystem.rb, line 12
def mime_type
  fetch_sample(MIME_TYPE)
end