Sha256: 307c496288466e59ba72b8cb214060ba05635ef9ac191bd527095c85933a98e5

Contents?: true

Size: 362 Bytes

Versions: 18

Compression:

Stored size: 362 Bytes

Contents

# frozen_string_literal: true

require_relative "nop"

# :stopdoc:
module IRB
  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
end
# :startdoc:

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/irb-1.4.1/lib/irb/cmd/whereami.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/irb-1.4.1/lib/irb/cmd/whereami.rb
irb-1.4.1 lib/irb/cmd/whereami.rb
irb-1.4.0 lib/irb/cmd/whereami.rb
irb-1.3.8.pre.11 lib/irb/cmd/whereami.rb
irb-1.3.8.pre.10 lib/irb/cmd/whereami.rb
irb-1.3.8.pre.9 lib/irb/cmd/whereami.rb
irb-1.3.8.pre.8 lib/irb/cmd/whereami.rb
irb-1.3.8.pre.7 lib/irb/cmd/whereami.rb
irb-1.3.8.pre.6 lib/irb/cmd/whereami.rb
irb-1.3.8.pre.5 lib/irb/cmd/whereami.rb
irb-1.3.8.pre.4 lib/irb/cmd/whereami.rb
irb-1.3.8.pre.3 lib/irb/cmd/whereami.rb
irb-1.3.8.pre.2 lib/irb/cmd/whereami.rb
irb-1.3.8.pre.1 lib/irb/cmd/whereami.rb
irb-1.3.7 lib/irb/cmd/whereami.rb
irb-1.3.6 lib/irb/cmd/whereami.rb
irb-1.3.5 lib/irb/cmd/whereami.rb