Sha256: 31f553b72d7566920364ac5a99bd79eebf04b1dc4eeaf1e627a626c8fc356423

Contents?: true

Size: 619 Bytes

Versions: 6816

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,816 entries across 6,812 versions & 32 rubygems

Version Path
ory-client-0.0.1.alpha156 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha155 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha154 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-oathkeeper-client-0.38.24.beta1 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha153 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha152 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha151 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha150 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha149 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha148 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha147 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-kratos-client-0.9.0.alpha3 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha146 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha145 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-kratos-client-0.9.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.alpha144 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha143 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha142 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha141 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb
ory-client-0.0.1.alpha140 vendor/bundle/ruby/2.5.0/gems/pry-byebug-3.9.0/lib/pry-byebug/helpers/location.rb