Sha256: 9caac5d1867f71a1858d033e2b4589ddbd571c591d6e2e41bba2c7b72745c59a

Contents?: true

Size: 935 Bytes

Versions: 11

Compression:

Stored size: 935 Bytes

Contents

Pry::CLI.add_options do

  on :w, :wrap, "Run the script wrapped by the exception explorer", true do |file|
    PryExceptionExplorer.wrap do
      require file
    end

    exit
  end

  on "c-exceptions", "Experimental hook for C exceptions" do
    require 'pry-exception_explorer/shim_builder'

    binary_name = "lib_overrides.#{PryExceptionExplorer::ShimBuilder::Dyname}"

    if !File.exists? File.join PryExceptionExplorer::ShimBuilder.dir, binary_name
      puts "First run, building shim"
      PryExceptionExplorer::ShimBuilder.compile
      puts "Hopefully built...!"
    end

    if RUBY_PLATFORM =~ /darwin/
      ENV['DYLD_FORCE_FLAT_NAMESPACE'] = "1"
      ENV['DYLD_INSERT_LIBRARIES'] = File.join PryExceptionExplorer::ShimBuilder.dir, binary_name
    else
      ENV['LD_PRELOAD'] = File.join PryExceptionExplorer::ShimBuilder.dir, binary_name
    end

    exec("pry #{(ARGV - ["--c-exceptions"]).join(' ')}")
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pry-exception_explorer-0.1.7 lib/pry-exception_explorer/cli.rb
pry-exception_explorer-0.1.6 lib/pry-exception_explorer/cli.rb
pry-exception_explorer-0.1.5 lib/pry-exception_explorer/cli.rb
pry-exception_explorer-0.1.4 lib/pry-exception_explorer/cli.rb
pry-exception_explorer-0.1.3.5 lib/pry-exception_explorer/cli.rb
pry-exception_explorer-0.1.3.4 lib/pry-exception_explorer/cli.rb
pry-exception_explorer-0.1.3.3 lib/pry-exception_explorer/cli.rb
pry-exception_explorer-0.1.3.2 lib/pry-exception_explorer/cli.rb
pry-exception_explorer-0.1.3.1 lib/pry-exception_explorer/cli.rb
pry-exception_explorer-0.1.3pre1 lib/pry-exception_explorer/cli.rb
pry-exception_explorer-0.1.1pre8 lib/pry-exception_explorer/cli.rb