mongoid / mongoid_fulltext

An n-gram-based full-text search implementation for the Mongoid ODM.
MIT License
150 stars 66 forks source link

Allow to use Mongoid 3.0 or 3.1. #5

Closed simi closed 11 years ago

simi commented 11 years ago

Ready for rubygems push @artsy, @dblock I can setup Travis for both versions later.

dblock commented 11 years ago

This project uses Jeweler for its gemspec, and you're editing the generated file. Make changes to Gemfile, then run rake gemspec.

I believe the Gemfile reference is incorrect, gem "mongoid", "~> 3.1" isn't what you intended per supporting mongoid 3.0 and above.

simi commented 11 years ago

Gemfile is used only for local development. Correct mongoid version reference is in gemspec, which is used for resolving dependencies by bundler for example. I'll add later travis setup to use both ~> 3.0 and ~> 3.1 mongoid versions.

simi commented 11 years ago

rake gemspec did this -> https://gist.github.com/simi/5301920 @dblock

simi commented 11 years ago

I tried to use mongoid ~> 3.0 and ~> 3.1 in Gemfile and all tests were green. I'll do same setup for Travis.

dblock commented 11 years ago

@simi I can see how this looks confusing, but you're incorrect.

The gemfile is the source of the .gemspec for Jewler, a tool that is used to generate the .gemspec that is then used for production purposes. Whether you craft a gemspec manually or with Jewler is more like a style choice, read about it.

Go back to clean code without your changes and modify Gemfile to have the correct Mongoid reference, probably ~> 3.0 which means 3.0, 3.1, etc. Any 3.x version. Then run rake gemspec, that will create an updated .gemspec. I think that should be everything you need.

simi commented 11 years ago

OK, I'll try. I'm not Jeweler user.

dblock commented 11 years ago

Also, thank you for sending the patch. We definitely want to fix the dependency so that this gem can work with whatever version of Mongoid.