-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refinements #72
Refinements #72
Conversation
3dbf940
to
34f5e5f
Compare
I'm only realizing after seeing the build fail: this will exclude support for Ruby 2.0.0 and older, since refinements are kind of broken in Ruby 2.0.0 (they're only allowed at the file scope, I think) and don't exist prior to that. Though it's almost three years old, does it pose a problem to existing users to require Ruby 2.1? |
@kputnam With Ruby 2.3.0 coming out in 7 days I believe it is ok to at least require Ruby 2.1 |
Sounds good, @irobayna. I think you closed this PR by mistake :-) |
@kputnam good catch! sorry, did not meant to close. |
Which version number? I changed the Ruby versions in |
Yes, I meant to say to bump I was getting some errors on
By adding
|
With the line above I am able to run successfully using Rails parsing several large files (11,280 segments) and the rspec tests. FYI
|
Thanks for the report Isi. I think I see the likely cause of the problem you mentioned, and I'm glad you caught that. The issue is I don't think you can refine modules only classes. So I still had to monkey-patch But I'll check again, I think those methods are never used. Or at least not used in a way that requires them to be defined as a monkey patch. I'll bet people call |
@kputnam way better, works as expected out of the box |
@kputnam This branch seems to have fixed my Rails issues as well. Nicely done! Thank you very much for the update! |
@kputnam let me know if you need anything to get this merge |
Unless anyone objects, I'll merge this on Friday. |
This PR addresses incompatibilities with Rails and ActiveSupport caused by monkey patches in
lib/ruby
. Specifically issues and PRs #70, #67, #62, #63, #48 should (might?) be solved.From what I can tell, this doesn't require any changes in client code unless someone was calling those monkey-patched methods directly. To make that work, clients will need to declare
using Stupidedi::Refinements
to bring the extension methods into scope.Before merging this, I would like this to be reviewed and tested by someone other than myself. I've worked through several issues in the test suite, but I don't have a living application with which to test integration issues. If you have time, @irobayna, @alexkyllo, @johnstem, @serixscorpio, @limratana, @andrewthad, please try this branch out and let me know if you run into problems.
Some issues I ran into are documented here: https://gist.github.com/kputnam/c77e69264a2dc878ed8e