Ken Dreyer writes:

> Hi folks,
>
> Unfortunately the recent ThinkingSphinx bump in
> 0e162d083d4f005355b1320b2dad91688cb0c615 pushed us to a version of
> ThinkingSphinx that does not work on Ruby 1.8.7.

Oh no!

> I looked a bit into what it would take to fix it, and the short
> version is that it was over my head :)
>
> ThinkingSphinx has two classes which inherit BaseObject, a Ruby 1.9
> feature. https://github.com/pat/thinking-sphinx/issues/453 . I was
> unable to use a simple monkey-patch in Gitorious to override this
> because, as far as I can tell, Bundler is evaluating the
> thinking_sphinx code (and therefore the inheritance chain) before it
> evaluates any code in config/initializers. So even if I define a
> BaseObject (and make it inherit from ActiveSupport::BaseObject) in
> config/initializers/thinking_sphinx.rb, Ruby 1.8.7 still thinks
> BaseObject is undefined when I run "bundler exec rake".
>
> I tried to solve this by patching my own copy of the ThinkingSphinx
> gem so that it would conditionally inherit from
> ActiveSupport::BaseObject or BaseObject depending on RUBY_VERSION.
> This got me a little further, but I ran into another issue:
>
> .gems/gems/thinking-sphinx-3.0.4/lib/thinking_sphinx/active_record/column.rb:19:
> syntax error, unexpected tIDENTIFIER, expecting tAMPER

I just had a look at this file for any obvious issues, but that's some
pretty funky syntax :-)

> At this point, I gave up. So I have the following questions:
>
> - Can we go back to an older thinking_sphinx Gem?

The older (2.x) version of ts has been really buggy, so I'd really
prefer not doing that.

> - Can we only use the older thinking_sphinx on older Ruby?

Well, we *could*, but we'd have to do some legwork for it to work.
An easier solution would probably be to extract search into a separate
gem and add that to mainline's Gemfile. When doing this, we could create
an API wrapper in that gem which works with ts behind the scenes - and
let that gem switch TS versions based on the Ruby version. The API could
be something along these lines:

- Gitorious::Search.configure_indexes do {}
- Gitorious::Search.perform(options)
- And we'd have to set up rake tasks in the gem to be included in the
  mainline repository too

I've added an issue to the bug tracker:
https://issues.gitorious.org/issues/202 - let's move the discussion
there.

Oh, and I'm really glad you're keeping an eye on this, Ken, although
keeping 1.8 support is an uphill battle these days...

Cheers,
- Marius

-- 
-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to