Sha256: 31f553b72d7566920364ac5a99bd79eebf04b1dc4eeaf1e627a626c8fc356423

Contents?: true

Size: 619 Bytes

Versions: 6815

Compression:

Stored size: 619 Bytes

Contents

# frozen_string_literal: true

module PryByebug
  module Helpers
    #
    # Compatibility helper to handle source location
    #
    module Location
      module_function

      #
      # Current file in the target binding. Used as the default breakpoint
      # location.
      #
      def current_file(source = target)
        # Guard clause for Ruby >= 2.6 providing now Binding#source_location ...
        return source.source_location[0] if source.respond_to?(:source_location)

        # ... to avoid warning: 'eval may not return location in binding'
        source.eval("__FILE__")
      end
    end
  end
end

Version data entries

6,815 entries across 6,811 versions & 32 rubygems

Version Path
ory-client-0.0.1.alpha119 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha118 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha117 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha116 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha115 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
primary_connect_proto-0.6.0 vendor/bundle/ruby/2.6.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-keto-client-0.8.0.alpha2 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha113 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha112 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha111 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha110 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha109 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
avalara_sdk-2.4.26 vendor/bundle/ruby/2.6.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha108 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-oathkeeper-client-0.38.23.beta1 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-oathkeeper-client-0.38.22.beta1 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha107 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-hydra-client-1.11.7 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha106 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-hydra-client-1.11.6 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb