cherry pick commit #fd4d434663a08b00b354e3d7fe6862db91b83900
cherry pick commit #c432997c77dcae30d3ffd81d68af1535805f5dff
Merge pull request #276 from mkristian/nexus-2.7.x

backport change for ruby-plugin on master to Nexus 2.7.x