When the gem is installed in a directory containing lib in its name (e.g. _/var/lib/jenkins/workspace/rightclearing_next-spec/vendor/bundlergems/ruby/1.9.1/gems/exchange-0.5.0) it does not work correctly:
No such file or directory - /var/jenkins/workspace/rightclearing_next-spec/vendor/bundler_gems/ruby/1.9.1/gems/exchange-0.5.0/lib/iso4217.yml
The problem lies in the following line:
EXCHANGE_GEM_ROOT_PATH = File.dirname(__FILE__).sub(/\/lib/, '') if __FILE__.is_a?(String)
The regexp in the sub call will replace the first occurrence of /lib in the path and not the last one. The following should do the trick:
EXCHANGE_GEM_ROOT_PATH = File.dirname(__FILE__).sub(/\/lib$/, '') if __FILE__.is_a?(String)
When the gem is installed in a directory containing lib in its name (e.g. _/var/lib/jenkins/workspace/rightclearing_next-spec/vendor/bundlergems/ruby/1.9.1/gems/exchange-0.5.0) it does not work correctly:
The problem lies in the following line:
The regexp in the sub call will replace the first occurrence of /lib in the path and not the last one. The following should do the trick: