Sha256: a3371ba9469732e258e62235d85b3d367621657cd3926d97dff61c4090e2ed3c

Contents?: true

Size: 907 Bytes

Versions: 3

Compression:

Stored size: 907 Bytes

Contents

# frozen_string_literal: false
#
#   change-ws.rb -
#   	$Release Version: 0.9.6$
#   	$Revision$
#   	by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
#
#

require_relative "nop"
require_relative "../ext/workspaces"

module IRB
  # :stopdoc:

  module ExtendCommand
    class Workspaces < Nop
      category "IRB"
      description "Show workspaces."

      def execute(*obj)
        irb_context.workspaces.collect{|ws| ws.main}
      end
    end

    class PushWorkspace < Workspaces
      category "IRB"
      description "Push an object to the workspace stack."

      def execute(*obj)
        irb_context.push_workspace(*obj)
        super
      end
    end

    class PopWorkspace < Workspaces
      category "IRB"
      description "Pop a workspace from the workspace stack."

      def execute(*obj)
        irb_context.pop_workspace(*obj)
        super
      end
    end
  end

  # :startdoc:
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
irb-1.6.2 lib/irb/cmd/pushws.rb
irb-1.6.1 lib/irb/cmd/pushws.rb
irb-1.6.0 lib/irb/cmd/pushws.rb