Class: Gotenberg::Backtrace
- Inherits:
-
Object
- Object
- Gotenberg::Backtrace
- Defined in:
- lib/gotenberg/backtrace.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(files) ⇒ Backtrace
constructor
A new instance of Backtrace.
Constructor Details
#initialize(files) ⇒ Backtrace
Returns a new instance of Backtrace.
7 8 9 |
# File 'lib/gotenberg/backtrace.rb', line 7 def initialize files @files = files end |
Instance Attribute Details
#files ⇒ Object
Returns the value of attribute files.
5 6 7 |
# File 'lib/gotenberg/backtrace.rb', line 5 def files @files end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/gotenberg/backtrace.rb', line 11 def call return unless index_available? FileUtils.mkdir_p(backtrace_location) files.each do |file| File.open(File.join(backtrace_location, file.original_filename), 'wb') do |f| f << file.io.read end file.io.rewind end ::Launchy.open(File.join(backtrace_location, 'index.html')) end |