Closed mungler closed 12 months ago
Hi, sorry for my late reply.
Instead of a monkey patch, Passbook::PKPass support a custom signer as second argument. So you could create a specific Signer let's say JRubySigner which would include your patch to get it working with JRuby and pass a new instance to it when you initialize your pkpass.
That would give you something like this
require 'jruby_signer'
my_signer = Passbook::JRubySigner.new
my_pass = Passbook::PKPass.new 'data', my_signer
...
Hope this will help
Good to know, thanks. I guess the gem could detect the platform and use a different default signer if its java?
Detecting ruby version could be tricky, what could be possible would be to add a new configuration var which would let you choose which signer to use in the initializer.
But one question would remain, I saw your issue on jruby-openssl, does this behavior is consistant across all version of jruby-openssl? And will it still be? What if we issue a new signer for jruby which would only work for the current release and won't on the next one.
Detecting JRuby is very simple:
RUBY_PLATFORM == "java"
But yes, I'm not sure about whether things may change between JRuby releases. The correct solution is to have JRuby behave the same as MRI. I may revisit this with the JRuby guys. Thanks!
I hit problems using this Gem with latest JRuby 9.1.8.0 and latest JRuby-OpenSSL.
This monkey-patch may be useful - it addresses a bug in JRuby-OpenSSL (by explicitly passing
pk7.data
as a second argument to thewrite_smime
method), as well as problems withstr_debut
andstr_end
being in a slightly different format in the JRuby output.Hope its useful to someone :)