Sha256: 31f553b72d7566920364ac5a99bd79eebf04b1dc4eeaf1e627a626c8fc356423

Contents?: true

Size: 619 Bytes

Versions: 6769

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,769 entries across 6,766 versions & 30 rubygems

Version Path
cybrid_api_organization_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_id_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_bank_ruby-0.123.142 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_id_ruby-0.123.142 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_organization_ruby-0.123.142 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_bank_ruby-0.123.140 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_id_ruby-0.123.140 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_organization_ruby-0.123.140 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_bank_ruby-0.123.139 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_id_ruby-0.123.139 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_organization_ruby-0.123.139 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_id_ruby-0.123.137 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_organization_ruby-0.123.137 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_bank_ruby-0.123.137 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_organization_ruby-0.123.135 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_bank_ruby-0.123.135 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_id_ruby-0.123.135 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_bank_ruby-0.123.134 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_id_ruby-0.123.134 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb
cybrid_api_organization_ruby-0.123.134 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/helpers/location.rb