Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move the undef into the 1.9 only branch

  • Loading branch information...
commit 8d576b51a12fdb19e3993f3678ec64b2ea60fada 1 parent b97a3f3
@wycats wycats authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 activesupport/lib/active_support/multibyte/chars.rb
View
4 activesupport/lib/active_support/multibyte/chars.rb
@@ -45,14 +45,14 @@ def initialize(string)
@wrapped_string = string
@wrapped_string.force_encoding(Encoding::UTF_8) unless @wrapped_string.frozen?
end
+
+ undef <=>
else
def initialize(string) #:nodoc:
@wrapped_string = string
end
end
- undef <=>
-
# Forward all undefined methods to the wrapped string.
def method_missing(method, *args, &block)
if method.to_s =~ /!$/

24 comments on commit 8d576b5

@norman

What's the motivation for this? I have a class that subclasses AS::Multibyte::Chars in friendly_id, and this change completely breaks it. <=> is later defined only for Ruby < 1.9, so it looks like 1.9 ends up without this method.

@norman

In fact, running rake test TEST=test/multibyte_chars_test.rb on 1.9.1p378 fails almost all the tests with this commit. Commented out, tests work again. Perhaps it should be reverted?

@wycats
Collaborator

@norman it should be hitting the method_missing a couple lines down. I've seen a few people report 1.9.1 (but not 1.9.2) issues with this change. Are you running 1.9.1?

@jeremy
Owner

Norman, are you on 1.9.1 or 1.9.2?

@norman

Sorry guys, didn't see you had replied. Yes, I'm on 1.9.1.p378. Trying to test with other Rubies but bundle install is crawling on the Railsconf connection...

@wycats
Collaborator

We're not currently supporting 1.9.1, but we should possibly stop Rails 3 itself from booting on 1.9.1. We've gotten a bunch of obscure 1.9.1 bugs and have a lot of trouble keeping CI running on 1.9.1, but this is not the case about 1.9.2.

@norman

@wycats ok, that's good to know. If you're not going to support 1.9.1, then +1 to making that as obvious as possible. Knowing that, I would override a few less methods in Multibyte::Chars - I overrode center and a few others for compatiblity with 1.9.1. I'll send a patch later.

@postmodern

To clarify, would 1.9.2-preview3 be the suggested migration path from 1.9.1?

I have successfully been running a rails3-beta3 app on 1.9.1 for some time now.

@norman

I understand there are very good reasons for supporting only 1.9.2, but who knows when that's going to be released, or what they're going to decide to cram in at the last minute. So maybe it would be better to at least avoid trivial changes that break 1.9.1, even if you don't intend to support it. I'm trying to look at some unrelated things in edge inside ruby-debug right now with 1.9, and I can't use 1.9.2 because linecache hasn't been updated yet. And now I can't use 1.9.1 either because of this commit.

I'm checking out linecache right now to see if I can update it for 1.9.2 but it's starting to feel like yak-shaving.

@josevalim
Owner

Norman, if you provide a patch where Rails test suite can happily run on Ruby 1.9.1 without segfaulting, we will definitely apply it.

@hasimo

Norman, you should use ruby-debug19 and linecache19.
I can make ruby-debug19 and it seem fine.
but gem install need --with-ruby-include argment.
like this. http://gist.github.com/433183

@norman

@hasimo thanks, will try that.

@jose I understand that 1.9.1 is imperfect. I'm not suggesting support, simply "no intentional breakage." But if you feel that it's not worthwhile to consider 1.9.1 at all for Rails, I'm perfectly happy to work with that assumption.

@bartocc

Just to backup what norman said, I have the same problem on ruby-1.9.1-p378
My app has been running fine so far with rails b3 and 1.9.1, and it's deployed on heroku that, as far as I know, does not support 1.9.2 yet

@josevalim
Owner

Norman, we are not able to run Rails tests in 1.9.1. So it makes no sense for us to say that we support it, because we do not even have tests to back us up.

@postmodern

Given that only a few Linux distributions provide 1.9.1 packages, this narrows ones choices down to 1.8.6, 1.8.7, JRuby and Rubinius. I'm sure the JRuby and Rubinius people are going to love this news. :)

@norman

@postmodern - I was told that 1.9.2 will likely be released within months, so I don't think this is as big a deal now as I did a few days ago. :)

@postmodern

@norman The real test will be seeing 1.9.2 packaged by Linux distributions, and installers made available for OSX/Windows. That said, I'm already successfully running 1.9.2-preview3 under RVM on Fedora13, not known to be the most ruby-friendly distribution.

@goncalossilva

@norman The head is already at 1.9.3, so an 1.9.2 official release is expected quite soon.

@goncalossilva

I doubt that it's still up-to-date, after all 1.9.2 is on preview 3. Either way, I believe we can expect p0 to be released soon.

@ncr

@bartocc I had to add following line to initializers:

ActiveSupport::Multibyte::Chars rescue nil
@bartocc

@ncr what you did seems like a hack.
I solved the issue moving from ruby 1.9.1 to 1.9.2

@ncr

@bartocc yep, it's a hack. I need to stick to 1.9.1 -> heroku

Please sign in to comment.
Something went wrong with that request. Please try again.