From: Rick DeNatale Date: 2009-10-04T03:31:14+09:00 Subject: Re: Having a gem for 1.8 and 1.9 On Sat, Oct 3, 2009 at 12:12 AM, (RK) Sentinel wrote: > Rick Denatale wrote: >> 1.8 vs 1.9 because of the differences in Strings, but I've been able >> to conditionally select which implementation of a few methods get >> "compiled" by testing the ruby version inline. >> >> -- >> Rick DeNatale > > Could you give me a snippet of your conditional selection ? > > A link to your project code might help too. I've googled a bit, no files > released on http://rubyforge.org/frs/?group_id=8234 it seems. Au contraire mon frere. The code is on both rubyforge and github http://rubyforge.org/projects/ri-cal/ http://github.com/rubyredrick/ri_cal For some specific examples grep the project for "RUBY_VERSION" so far there are only two files which are version sensitive lib/ri_cal/component/calendar.rb and lib/ri_cal/core_extensions/date/conversions.rb The first file works around the difference in Strings, and the second has two methods which are included if ActiveSupport is also not loaded, and we're not running Ruby 1.9, for two methods which ActiveSupport defines when running Ruby 1.8.x -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale