diff options
author | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-13 05:22:30 +0000 |
---|---|---|
committer | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-13 05:22:30 +0000 |
commit | 89833152381b759482d5e0ae9dcbdd9ed29a2b6a (patch) | |
tree | ab615431bccab8bde95bb57d893ecea4b2bd4405 /lib/irb/ext/workspaces.rb | |
parent | 0ac361f54060a26f771d8751f06bbd1013db2016 (diff) | |
download | ruby-89833152381b759482d5e0ae9dcbdd9ed29a2b6a.tar.gz |
* lib/irb*: merge doc from doc/irb/ird.rd and improve overall
documentation of IRB
* doc/irb/irb.rd: remove stale documentation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb/ext/workspaces.rb')
-rw-r--r-- | lib/irb/ext/workspaces.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/irb/ext/workspaces.rb b/lib/irb/ext/workspaces.rb index 118ea598c0..1232fee84f 100644 --- a/lib/irb/ext/workspaces.rb +++ b/lib/irb/ext/workspaces.rb @@ -9,13 +9,14 @@ # # -module IRB +module IRB # :nodoc: class Context def irb_level workspace_stack.size end + # Workspaces in the current stack def workspaces if defined? @workspaces @workspaces @@ -24,6 +25,11 @@ module IRB end end + # Creates a new workspace with the given object or binding, and appends it + # onto the current #workspaces stack. + # + # See IRB::Context#change_workspace and IRB::WorkSpace.new for more + # information. def push_workspace(*_main) if _main.empty? if workspaces.empty? @@ -43,6 +49,10 @@ module IRB end end + # Removes the last element from the current #workspaces stack and returns + # it, or +nil+ if the current workspace stack is empty. + # + # Also, see #push_workspace. def pop_workspace if workspaces.empty? print "workspace stack empty\n" |