Forum: Ruby-core [ruby-trunk - Feature #7848][Open] Restore default state for core ruby objects

Posted by Markus H. (markus_h)
on 2013-02-13 20:43
(Received via mailing list)
Issue #7848 has been reported by shevegen (markus heiler).

----------------------------------------
Feature #7848: Restore default state for core ruby objects
https://bugs.ruby-lang.org/issues/7848

Author: shevegen (markus heiler)
Status: Open
Priority: Low
Assignee:
Category:
Target version:


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.
Posted by ko1 (Koichi Sasada) (Guest)
on 2013-02-17 06:12
(Received via mailing list)
Issue #7848 has been updated by ko1 (Koichi Sasada).

Category set to core
Assignee set to matz (Yukihiro Matsumoto)
Target version set to next minor

I don't think this proposal can be accepted.

----------------------------------------
Feature #7848: Restore default state for core ruby objects
https://bugs.ruby-lang.org/issues/7848#change-36370

Author: shevegen (markus heiler)
Status: Open
Priority: Low
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: next minor


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.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.