Module: StackDeck

Defined in:
lib/stackdeck.rb,
lib/stackdeck/frame.rb,
lib/stackdeck/context.rb,
lib/stackdeck/postgres.rb,
lib/stackdeck/exception.rb

Defined Under Namespace

Modules: ExceptionSupport Classes: Context, Frame

Class Method Summary collapse

Class Method Details

.apply_boundary!(deck) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/stackdeck/frame.rb', line 15

def self.apply_boundary!(deck)
  deck.each_with_index do |s, idx|
    # We don't want any more frames if this is a boundary marker,
    # *and* the exception didn't occur really close to said boundary.
    if s.boundary? && idx > 2
      deck.slice! idx, -1
      break
    end
  end
end

.boundaryObject



3
# File 'lib/stackdeck/frame.rb', line 3

def self.boundary; yield; end

.split_list(full_list, short_list) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/stackdeck/frame.rb', line 5

def self.split_list(full_list, short_list)
  short_list = short_list.dup
  upper = full_list.dup
  lower = []
  while !short_list.empty? && upper.last == short_list.pop
    lower << upper.pop
  end
  [upper, lower.reverse]
end