Sha256: 62e086d4c608412da68e8c6264835705ad48fa1db33f3e98fc80da27b026fa4e

Contents?: true

Size: 368 Bytes

Versions: 5

Compression:

Stored size: 368 Bytes

Contents

# frozen_string_literal: true

require_relative "nop"

module IRB
  # :stopdoc:

  module ExtendCommand
    class Whereami < Nop
      def execute(*)
        code = irb_context.workspace.code_around_binding
        if code
          puts code
        else
          puts "The current context doesn't have code."
        end
      end
    end
  end

  # :startdoc:
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/irb-1.4.2/lib/irb/cmd/whereami.rb
irb-1.5.1 lib/irb/cmd/whereami.rb
irb-1.5.0 lib/irb/cmd/whereami.rb
irb-1.4.3 lib/irb/cmd/whereami.rb
irb-1.4.2 lib/irb/cmd/whereami.rb