Sha256: 123badcecfb1165f1e3903c309cb946abaff37f08ce26fe21961c3fcc53bebed

Contents?: true

Size: 680 Bytes

Versions: 2

Compression:

Stored size: 680 Bytes

Contents

module Pacer
  class << self
    # Return a graph for the given path. Will create a graph if none exists at
    # that location. (The graph is only created if data is actually added to it).
    def dex(path)
      dex = com.tinkerpop.blueprints.impls.dex.DexGraph
      path = File.expand_path(path)
      open = proc do
        graph = Pacer.open_graphs[path]
        unless graph
          graph = dex.new(path)
          Pacer.open_graphs[path] = graph
        end
        graph
      end
      shutdown = proc do |g|
        g.blueprints_graph.shutdown
        Pacer.open_graphs[path] = nil
      end
      PacerGraph.new(Pacer::YamlEncoder, open, shutdown)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pacer-dex-2.0.0-java lib/pacer-dex/graph.rb
pacer-dex-2.0.0.pre-java lib/pacer-dex/graph.rb