summaryrefslogtreecommitdiff
path: root/lib/irb/ext
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irb/ext')
-rw-r--r--lib/irb/ext/change-ws.rb8
-rw-r--r--lib/irb/ext/workspaces.rb7
2 files changed, 6 insertions, 9 deletions
diff --git a/lib/irb/ext/change-ws.rb b/lib/irb/ext/change-ws.rb
index 87fe03e23d..60e8afe31f 100644
--- a/lib/irb/ext/change-ws.rb
+++ b/lib/irb/ext/change-ws.rb
@@ -29,11 +29,9 @@ module IRB # :nodoc:
return main
end
- replace_workspace(WorkSpace.new(_main[0]))
-
- if !(class<<main;ancestors;end).include?(ExtendCommandBundle)
- main.extend ExtendCommandBundle
- end
+ workspace = WorkSpace.new(_main[0])
+ replace_workspace(workspace)
+ workspace.load_helper_methods_to_main
end
end
end
diff --git a/lib/irb/ext/workspaces.rb b/lib/irb/ext/workspaces.rb
index 5a1edd89b7..da09faa83e 100644
--- a/lib/irb/ext/workspaces.rb
+++ b/lib/irb/ext/workspaces.rb
@@ -19,10 +19,9 @@ module IRB # :nodoc:
@workspace_stack.push current_workspace, previous_workspace
end
else
- @workspace_stack.push WorkSpace.new(workspace.binding, _main[0])
- if !(class<<main;ancestors;end).include?(ExtendCommandBundle)
- main.extend ExtendCommandBundle
- end
+ new_workspace = WorkSpace.new(workspace.binding, _main[0])
+ @workspace_stack.push new_workspace
+ new_workspace.load_helper_methods_to_main
end
end