Imagine having a set of similar files, requiring similar maintenance. My particular case is RHEL/CentOS network config files "ifcfg-eth*" looking like:
The library "set_line_based()" is designed to handle this, but has a problem with multiple similar files, because of the global scope of classes that are intended to be of local scope.
The relevant part of the bundle looks like:
bundle edit_line set_line_based(v, sep, bp, kp, cp)
The intention is that the the "classes => ..." set inside the "replace_patterns" control the behaviour of other clauses. That's OK... on a single file.
But now imagine calling this for multiple files. A call for one file may set those classes, supposedly locally for itself. But in fact those classes have global scope and will wrongly influence the behaviour of calls on other similar files, particularly any with similar keys.
Those keys need better global uniqueness. For instance, I would suggest that lines such as:
classes => always("replace_attempted_$(ci[$(i)])");
ifvarclass => "replace_attempted_$(ci[$(i)]) ...";
should instead be something like:
classes => always("replace_attempted_$(ci[$(i)])in$(edit_filename)");
ifvarclass => "replace_attempted_$(ci[$(i)])in$(edit_filename) ...";