Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4636

Change the behavior of existing Ruby code without modifying the original code (like Byteman)

$
0
0

Background

  • I bumped into the same situation as the question Eclipse + Encoding + Gitlab and am trying to change the behavior of GitLab.
  • I have looked around the source of GitLab and decided to start by changing the behavior of class like BlobHelper or EncodingHelper.
  • I don't want to modify the original GitLab code to simplify updating.

Question

Is there any way to add or change the behavior of existing Ruby code without modifying the code?

For example, in Java, you can use Byteman in this situation. With Byteman, you can add the code to any point like the start of a method from command-line options.


Viewing all articles
Browse latest Browse all 4636

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>