class RBT::GeneratePdfTutorial

Constants

NAMESPACE
#

NAMESPACE

#
STORE_PDF_FILE_HERE
#

STORE_PDF_FILE_HERE

Where to store the .pdf file.

#
URL
#

URL

#

Public Class Methods

new( run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/generate_pdf_tutorial.rb, line 48
def initialize(
    run_already = true
  )
  reset
  run if run_already
end
store_pdf_file_where?() click to toggle source
#

RBT::GeneratePdfTutorial.store_pdf_file_where?

#
# File lib/rbt/utility_scripts/generate_pdf_tutorial.rb, line 41
def self.store_pdf_file_where?
  STORE_PDF_FILE_HERE
end

Public Instance Methods

reset() click to toggle source
#

reset

#
Calls superclass method RBT::Base#reset
# File lib/rbt/utility_scripts/generate_pdf_tutorial.rb, line 58
def reset
  super()
  @namespace = NAMESPACE
  @store_where = STORE_PDF_FILE_HERE
end
run() click to toggle source
#

run

#
# File lib/rbt/utility_scripts/generate_pdf_tutorial.rb, line 74
def run
  # ======================================================================= #
  # First, always get rid of the old .pdf file.
  # ======================================================================= #
  remove_file(store_where?) if File.exist?(store_where?)
  # ======================================================================= #
  # Here we should have generated it.
  # ======================================================================= #
  opnn; e 'Next trying the URL `'+sfancy(URL)+'`.'
  open(URL)
  result = "The .pdf file should now exist at "\
           "`#{sfile(store_where?)}`".dup
  if File.exist? store_where?
    result << ' (Yes, it does exist there)'
  end
  result << '.'
  opnn; e result 
end
store_where?() click to toggle source
#

store_where?

#
# File lib/rbt/utility_scripts/generate_pdf_tutorial.rb, line 67
def store_where?
  @store_where
end