Sha256: 9cfa0578911115e35c8259ab81ef1a84c737af9e4b1fb35c1d12309ae72d9ac0

Contents?: true

Size: 850 Bytes

Versions: 7

Compression:

Stored size: 850 Bytes

Contents

# frozen_string_literal: false
#
#   change-ws.rb -
#   	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

7 entries across 7 versions & 1 rubygems

Version Path
irb-1.7.4 lib/irb/cmd/pushws.rb
irb-1.7.3 lib/irb/cmd/pushws.rb
irb-1.7.2 lib/irb/cmd/pushws.rb
irb-1.7.1 lib/irb/cmd/pushws.rb
irb-1.7.0 lib/irb/cmd/pushws.rb
irb-1.6.4 lib/irb/cmd/pushws.rb
irb-1.6.3 lib/irb/cmd/pushws.rb