Feature #7848

Restore default state for core ruby objects

Added by Robert A. Heiler over 2 years ago. Updated over 2 years ago.

[ruby-core:52222]
Status:Open
Priority:Low
Assignee:Yukihiro Matsumoto

Description

Hi.

Consider:

class String
def lala
puts 'Running lala() from class String.'
end
end

This is possible.

My question is - is there a reason why we can not restore
to the default ruby state again?

For instance, if I would do:

String.restore

I could undo all modifications to String, save what was used
in String class on startup/initialize.

The reason I would like to have something like this is so
that I could safely undo all "monkey" patches again, if needed,
for a given project.

History

#1 Updated by Koichi Sasada over 2 years ago

  • Category set to core
  • Assignee set to Yukihiro Matsumoto
  • Target version set to next minor

I don't think this proposal can be accepted.

Also available in: Atom PDF