jenkinsci/jenkins.rb — pull request #58 by echohead (2012-09-14 18:44:26+00:00)
Title: fix pathname bug when running in jruby in 1.9 mode.

when running jruby in 1.9 compat mode, jenkins-plugin-runtime fails
with the following error:
jenkins-plugin-runtime-0.2.2/lib/jenkins/plugin/specification.rb:109:in `eval': can't convert Pathname into String (TypeError)

this commit allows the gem to work in both 1.8 and 1.9 by explicitly
converting the Pathname to String.

the difference in how Pathnames are handled can be illustrated in the shell:
$ echo "puts 'ok'" > foo
$ JRUBY_OPTS=--1.8 ruby -e "puts RUBY_VERSION; require 'pathname'; p = Pathname.new('foo'); eval(File.read(p), nil, p, 0)"
1.8.7
ok
$ JRUBY_OPTS=--1.9 ruby -e "puts RUBY_VERSION; require 'pathname'; p = Pathname.new('foo'); eval(File.read(p), nil, p, 0)"
1.9.2
TypeError: can't convert Pathname into String
eval at org/jruby/RubyKernel.java:1088
(root) at -e:1