class Pdfmd
Attributes
filename[RW]
logfile[RW]
logstatus[RW]
Public Class Methods
new(filename)
click to toggle source
# File lib/pdfmd.rb, line 41 def initialize(filename) # Default Logfile location and logging enabled if !@logfile or @logfile.empty? @logfile = Dir.pwd.chomp('/') + '/.pdfmd.log' end @log = true # Defining the loglevel @loglevel = 'info' self.log('debug','---') self.log('info',"Starting with file '#{filename}'.") @filename = filename @hieradata = queryHiera('pdfmd::config') if ! filename.empty? read_metatags(@filename) end end
Public Instance Methods
metadata()
click to toggle source
Make Metadata available to the outside
# File lib/pdfmd.rb, line 63 def metadata @@metadata end
readUserInput(textstring = 'Enter value: ')
click to toggle source
Read user input
# File lib/pdfmd.rb, line 200 def readUserInput(textstring = 'Enter value: ') self.log('info','Waiting for user input.') if textstring.match(/password/i) print textstring STDIN.noecho(&:gets).chomp + "\n" else ask textstring end end