Sha256: 8d88bb682ebdf4a731419a7c429939f94d4975f40b5307bddb71a95fe4a8167e

Contents?: true

Size: 711 Bytes

Versions: 6

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: true

class Object
  def parent_caller
    caller[0].match(/`(.*)'/)[1]
  end

  def all_callers
    caller.map { |x| x.match(/`(.*)'/)[1] if self.respond_to? x.match(/`(.*)'/)[1].to_sym }.compact
  end

  def caller_key
    caller[0].hash
  end
end

def global_stack
  @global_stack ||= {}
end

class Scarpe
  # STARTING SINGLY, APPENDING TO TOP LEVEL BOX. later will do nested
  class << self
    # Width means nothing right now, but we'll get there
    def stack(width: 1.0)
      hbox = UI.new_horizontal_box
      old_parent = $parent_box ? $parent_box : $vbox
      $parent_box = hbox
      yield
      UI.box_append(old_parent, hbox, 1)
      $parent_box = nil
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
scarpe-0.4.0 spikes/libui/stack.rb
scarpe-0.3.0 spikes/libui/stack.rb
scarpe-0.2.2 spikes/libui/stack.rb
lacci-0.2.1 lib/scarpe/libui/stack.rb
scarpe-0.2.1 lib/scarpe/libui/stack.rb
scarpe-0.2.0 lib/scarpe/libui/stack.rb