Sha256: 921d6138c9f26d7c69ed10bcfdb6b00659938b6c19e9148e743448bf42e93a54

Contents?: true

Size: 884 Bytes

Versions: 15

Compression:

Stored size: 884 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "grumlin"

require "irb"
require "irb/completion"

require "dead_end"

Grumlin.configure do |config|
  config.url = ENV.fetch("GREMLIN_URL", "ws://localhost:8182/gremlin")
end

class Repository
  extend Grumlin::Repository

  def start_irb
    IRB.setup(nil)
    IRB.conf[:PROMPT][:DEFAULT] = { PROMPT_I: "%N(main):%03n:%i> ",
                                    PROMPT_N: "%N(main):%03n:%i> ",
                                    PROMPT_S: "%N(main):%03n:%i%l ",
                                    PROMPT_C: "%N(main):%03n:%i* ",
                                    RETURN: "=> %s\n" }
    workspace = IRB::WorkSpace.new(binding)
    irb = IRB::Irb.new(workspace)
    IRB.conf[:MAIN_CONTEXT] = irb.context
    irb.eval_input
  end
end

Async do
  Repository.new.start_irb
ensure
  Grumlin.close
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
grumlin-1.2.0 bin/console
grumlin-1.1.0 bin/console
grumlin-1.0.4 bin/console
grumlin-1.0.3 bin/console
grumlin-1.0.3.beta1 bin/console
grumlin-1.0.2 bin/console
grumlin-1.0.1 bin/console
grumlin-1.0.0 bin/console
grumlin-1.0.0.rc7 bin/console
grumlin-1.0.0.rc6 bin/console
grumlin-1.0.0.rc5 bin/console
grumlin-1.0.0.rc4 bin/console
grumlin-1.0.0.rc3 bin/console
grumlin-1.0.0.rc2 bin/console
grumlin-1.0.0.rc1 bin/console