module EitilSupport class Stack attr_reader :stack, :backtrace def initialize @stack = caller[1..] @backtrace = stack.map { |call| EitilSupport::Call.new(call) } end def report backtrace.map.with_index { |call, call_nr| "#{call_nr}. #{call}" } end def report_app_calls filter_report '/app/' end def filter_report(path_shard) report.select { |call| call.include? path_shard } end def show ap report end def find(&block) backtrace.find(&block) end def self.parse(array_as_string) array_as_string.sub('[', ' ').reverse.sub(']','').reverse.split(',').flatten end end end