Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify in_position? method to fix inconsistencies
in_position? method wasn't working right due to issues with using following-sibling when before and preceding-sibling when after, this corrects it with new, hopefully proper assumptions. The only item that small change didn't fix was last() which was not working for either because of the way siblings treat the last() command as it will always resolve to true on the first match in those cases. This patch assumes that you'll never have more than one [last()] in your xpath for positioning and swaps it out with the correct final array value of augeas matches. We use an invert boolean on 'after' positions as we will always have an empty? resolving as true if the match exists before the item we're looking for. Whereas we'll always have empty? as false if we do a 'before' and the actual item currently exists after the line we're trying to match.
- Loading branch information