Determining Which Rems Rails Application Doesn't Use

Work with an application that contains almost 200 gems. Did anyone understand how to isolate precious stones that are not used so that they can be removed from the mixture.

+5
source share
1 answer

Due to the dynamic nature of Ruby, it is not possible to know for sure whether or not it is being used without testing. Although it’s bad practice to upload them to ad-hoc for no good reason, you can require a gem at any time during program execution. They do not need to be loaded up.

Although there may be advantages to loading gems on demand, such as saving less memory and shortening startup time, it makes it difficult to determine where or where they are actually used.

There is not always a correlation between the name of the jewel and the methods used. Although many of them have a namespace that is easily grepped up for, some simply add methods to existing classes, which can make them difficult to track, especially if they go so far as to fix old methods with new ones that have the same name.

, ruby-prof , . .

+3

All Articles