Module: DeepL::Utils::OutputPath Private
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Checks of an output file path before any request is sent.
Instance Method Summary collapse
- #check!(path) ⇒ Object private
Instance Method Details
#check!(path) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 19 20 21 22 |
# File 'lib/deepl/utils/output_path.rb', line 16 def check!(path) raise Errno::EEXIST, path.to_s if File.exist?(path) directory = File.dirname(path) raise Errno::ENOENT, directory unless File.directory?(directory) raise Errno::EACCES, directory unless File.writable?(directory) end |