Method: LinuxFortune.fortune

Defined in:
lib/linux_fortune.rb

.fortune(sources = nil) ⇒ Object

executes the fortune program



185
186
187
188
# File 'lib/linux_fortune.rb', line 185

def self.fortune(sources = nil)
  #puts "executing #{self.binary_path} -c #{fortune_options} #{sources.each { |s| s.strip }.join(" ") unless sources.nil?} 2>&1"
  `#{self.binary_path} -c #{fortune_options} #{sources.each { |source| source.to_s }.join(" ") unless sources.nil?} 2>&1`
end