Sha256: 105d67a7621f97bb1dc8b38378157870e63b7c8560967f921481325087efc3ec

Contents?: true

Size: 345 Bytes

Versions: 9

Compression:

Stored size: 345 Bytes

Contents

# frozen_string_literal: true

class SourceLocation
  def initialize(binding)
    @binding = binding
  end

  if RUBY_VERSION >= "2.6"
    def path() @binding.source_location.first end
    def lineno() @binding.source_location.last end
  else
    def path() @binding.eval("__FILE__") end
    def lineno() @binding.eval("__LINE__") end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
web-console-4.2.0 lib/web_console/source_location.rb
web-console-4.1.0 lib/web_console/source_location.rb
web-console-4.0.4 lib/web_console/source_location.rb
web-console-4.0.3 lib/web_console/source_location.rb
web-console-4.0.2 lib/web_console/source_location.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/web-console-4.0.1/lib/web_console/source_location.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/web-console-4.0.1/lib/web_console/source_location.rb
web-console-4.0.1 lib/web_console/source_location.rb
web-console-4.0.0 lib/web_console/source_location.rb