Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Be more explicit about passing a block #291

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

jfirebaugh commented Jan 25, 2011

JRuby 1.6.0 is not likely to support the previous bit of Proc.new magic; see http://jira.codehaus.org/browse/JRUBY-5420

Be more explicit about passing a block
JRuby 1.6.0 is not likely to support the previous bit of Proc.new
magic; see http://jira.codehaus.org/browse/JRUBY-5420
Owner

dchelimsky commented Jan 26, 2011

I had it structured that way so the then clause (which happens more often than the else) wouldn't have to take the hit of Ruby creating a Proc object. That said, I did some benchmarks with this patch applied and not applied and there is no real difference on up to 100k examples on MRI or jruby.

Contributor

jfirebaugh commented Jan 26, 2011

Be more explicit about passing a block

JRuby 1.6.0 is not likely to support the previous bit of Proc.new
magic; see http://jira.codehaus.org/browse/JRUBY-5420

Owner

dchelimsky commented Jan 26, 2011

Ugh - I ran the benchmarks without around hooks. Turns out that this change borks around hooks in jruby!

Leaving this open until I resolve that.

Contributor

jfirebaugh commented Jan 26, 2011

Ugh, I see what you mean -- it breaks on JRuby 1.5.6:

NoMethodError: undefined method `metadata' for #Proc:0x18d1cbd

Looks like another JRuby bug.

Owner

dchelimsky commented Jan 26, 2011

I've got a fix ready - just running it through its paces against diff versions of ruby. Push coming soon.

Owner

dchelimsky commented Jan 26, 2011

I take it back. The fix I had was that Procsy no longer inherits from Proc, but it looks like it needs to in order to be able to use yield. This cuke is therefore failing: https://github.com/rspec/rspec-core/blob/master/features/hooks/around_hooks.feature#L12.

Contributor

jfirebaugh commented Jan 26, 2011

Hmm... How's the performance of adding #metadata as a singleton method on a non-subclassed Proc instance?

Owner

dchelimsky commented Jan 26, 2011

Haven't tried and need to shut down for a few hours - wanna give that a roll and report back?

Owner

dchelimsky commented Jan 27, 2011

Make Procsy a module and extend the generated Procs instead of
inheriting from Proc.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment