News for hackers. Stuff that matters.
Re:Ruby Is Still a Diamond by bradstewart on Thursday September 02, 2021 @11:36AM (#28393374)
How do you define "business safe"? Java won't prevent you from sending a message to the wrong customer or something like that.
Re:Ruby Is Still a Diamond by shagie on Thursday September 02, 2021 @12:44PM (#28394284)
I can look at the code and see if anyone is doing:

        Class cache = Integer.class.getDeclaredClasses()[0];
        Field c = cache.getDeclaredField("cache");
        c.setAccessible(true);
I can examine to see that java.lang.{something} class is getting reflected on. I can check to see if anything is calling getDeclaredField and flag that. I can see the setAccessible and really flag that.

This isn't about coding errors. This is about being able to analyze the code and see if the code is using prohibited methods.

Through static analysis, I can verify if anyone is trying to do something tricky with the String class.

Can I verify if a method is being modified added to an instance of a String in Ruby through static analysis?

Re:Ruby Is Still a Diamond by WJW on Thursday September 02, 2021 @02:54PM (#28395887)
I don't know of anyone actually doing that, but all the code is right there. You could probably wrangle the linter into checking those things if you really want to. That said, many Ruby frameworks rely on being able to dynamically add methods to classes at runtime so I don't think such a thing would be all that beneficial.