Module: HtmlFromPdf::Helpers

Included in:
Converter, Downloader
Defined in:
lib/html_from_pdf/helpers.rb

Instance Method Summary collapse

Instance Method Details

#create_dir(dir_path) ⇒ Object



8
9
10
# File 'lib/html_from_pdf/helpers.rb', line 8

def create_dir(dir_path)
  FileUtils.mkdir_p dir_path
end

#default_file_path(format = :html) ⇒ Object



3
4
5
6
# File 'lib/html_from_pdf/helpers.rb', line 3

def default_file_path(format = :html)
  file_name = "#{Time.now.strftime('%m_%d_%Y__%H_%M_%S')}.#{format}"
  File.join('/tmp/html_from_pdf', file_name)
end