Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #7 from mezis/pg-compatibility
Browse files Browse the repository at this point in the history
pg and old sqlite3 compatibility
  • Loading branch information
mezis committed Jul 13, 2013
2 parents e605a0b + cadc6bf commit f321723
Show file tree
Hide file tree
Showing 16 changed files with 346 additions and 116 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ rvm:
- "1.8.7"
- "1.9.2"
- "1.9.3"
- "2.0.0"
gemfile:
- gemfiles/rails23.gemfile
- gemfiles/rails30.gemfile
- gemfiles/rails31.gemfile
- gemfiles/rails32.gemfile
- gemfiles/rails32_pg.gemfile
- gemfiles/rails32_mysql.gemfile
before_script:
- psql -c 'create database fuzzily_test;' -U postgres
- mysql -e 'create database fuzzily_test;'
env: TRAVIS=TRUE
4 changes: 4 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ end
appraise "rails32-pg" do
gem "activerecord", "~> 3.2.0"
end

appraise "rails32-mysql" do
gem "activerecord", "~> 3.2.0"
end
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
fuzzily (0.2.2)
fuzzily (0.2.3)
activerecord (>= 2.3.17)

GEM
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Blurrily finds misspelled, prefix, or partial needles in a haystack of
strings. It's a fast, [trigram](http://en.wikipedia.org/wiki/N-gram)-based, database-backed [fuzzy](http://en.wikipedia.org/wiki/Approximate_string_matching) string search/match engine for Rails.
Loosely inspired from an [old blog post](http://unirec.blogspot.co.uk/2007/12/live-fuzzy-search-using-n-grams-in.html).

Works with ActiveRecord 2.3, 3.0, 3.1, 3.2 on various Rubies; tested with SQLite, MySQL, and PostGreSQL.
Tested with ActiveRecord (2.3, 3.0, 3.1, 3.2) on various Rubies (1.8.7, 1.9.2, 1.9.3, 2.0.0) and the most common adapters (SQLite3, MySQL, and PostgreSQL).

If your dateset is big, if you need yet more speed, or do not use ActiveRecord,
check out [blurrily](http://github.com/mezis/blurrily), another gem (backed with a C extension)
Expand Down Expand Up @@ -126,4 +126,7 @@ MIT licence. Quite permissive if you ask me.
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
5. Create a new Pull Request


Thanks to @bclennox and @fdegiuli for helping fix compatibility issues.
47 changes: 32 additions & 15 deletions gemfiles/rails23.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: /Users/mezis/Dropbox/Development/fuzzily
specs:
fuzzily (0.2.2)
fuzzily (0.2.3)
activerecord (>= 2.3.17)

GEM
Expand All @@ -10,38 +10,55 @@ GEM
activerecord (2.3.17)
activesupport (= 2.3.17)
activesupport (2.3.17)
appraisal (0.5.1)
appraisal (0.5.2)
bundler
rake
coderay (1.0.9)
diff-lcs (1.1.3)
colorize (0.5.8)
coveralls (0.6.7)
colorize
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
thor
diff-lcs (1.2.4)
method_source (0.8.1)
mime-types (1.23)
multi_json (1.7.2)
mysql2 (0.3.11)
pg (0.14.1)
pry (0.9.12)
pg (0.15.1)
pry (0.9.12.1)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
pry-nav (0.2.3)
pry (~> 0.9.10)
rake (10.0.3)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.2)
slop (3.4.3)
rake (10.0.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
slop (3.4.4)
sqlite3 (1.3.7)
thor (0.18.1)

PLATFORMS
ruby

DEPENDENCIES
activerecord (~> 2.3.0)
appraisal
coveralls
fuzzily!
mysql2
pg
Expand Down
45 changes: 31 additions & 14 deletions gemfiles/rails30.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,59 @@ GEM
arel (~> 2.0.10)
tzinfo (~> 0.3.23)
activesupport (3.0.20)
appraisal (0.5.1)
appraisal (0.5.2)
bundler
rake
arel (2.0.10)
builder (2.1.2)
coderay (1.0.9)
diff-lcs (1.1.3)
colorize (0.5.8)
coveralls (0.6.7)
colorize
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
thor
diff-lcs (1.2.4)
i18n (0.5.0)
method_source (0.8.1)
mime-types (1.23)
multi_json (1.7.2)
mysql2 (0.3.11)
pg (0.15.1)
pry (0.9.12)
pry (0.9.12.1)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
pry-nav (0.2.3)
pry (~> 0.9.10)
rake (10.0.3)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.2)
slop (3.4.3)
rake (10.0.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
slop (3.4.4)
sqlite3 (1.3.7)
tzinfo (0.3.35)
thor (0.18.1)
tzinfo (0.3.37)

PLATFORMS
ruby

DEPENDENCIES
activerecord (~> 3.0.0)
appraisal
coveralls
fuzzily!
mysql2
pg
Expand Down
48 changes: 32 additions & 16 deletions gemfiles/rails31.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,59 @@ GEM
tzinfo (~> 0.3.29)
activesupport (3.1.11)
multi_json (~> 1.0)
appraisal (0.5.1)
appraisal (0.5.2)
bundler
rake
arel (2.2.3)
builder (3.0.4)
coderay (1.0.9)
diff-lcs (1.1.3)
i18n (0.6.1)
colorize (0.5.8)
coveralls (0.6.7)
colorize
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
thor
diff-lcs (1.2.4)
i18n (0.6.4)
method_source (0.8.1)
multi_json (1.6.1)
mime-types (1.23)
multi_json (1.7.2)
mysql2 (0.3.11)
pg (0.15.1)
pry (0.9.12)
pry (0.9.12.1)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
pry-nav (0.2.3)
pry (~> 0.9.10)
rake (10.0.3)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.2)
slop (3.4.3)
rake (10.0.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
slop (3.4.4)
sqlite3 (1.3.7)
tzinfo (0.3.35)
thor (0.18.1)
tzinfo (0.3.37)

PLATFORMS
ruby

DEPENDENCIES
activerecord (~> 3.1.0)
appraisal
coveralls
fuzzily!
mysql2
pg
Expand Down
62 changes: 39 additions & 23 deletions gemfiles/rails32.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,60 +1,76 @@
PATH
remote: /Users/mezis/Dropbox/Development/fuzzily
specs:
fuzzily (0.2.2)
fuzzily (0.2.3)
activerecord (>= 2.3.17)

GEM
remote: https://rubygems.org/
specs:
activemodel (3.2.12)
activesupport (= 3.2.12)
activemodel (3.2.13)
activesupport (= 3.2.13)
builder (~> 3.0.0)
activerecord (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
activerecord (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activesupport (3.2.12)
i18n (~> 0.6)
activesupport (3.2.13)
i18n (= 0.6.1)
multi_json (~> 1.0)
appraisal (0.5.1)
appraisal (0.5.2)
bundler
rake
arel (3.0.2)
builder (3.0.4)
coderay (1.0.9)
diff-lcs (1.1.3)
colorize (0.5.8)
coveralls (0.6.7)
colorize
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
thor
diff-lcs (1.2.4)
i18n (0.6.1)
method_source (0.8.1)
multi_json (1.6.1)
mime-types (1.23)
multi_json (1.7.2)
mysql2 (0.3.11)
pg (0.15.1)
pry (0.9.12)
pry (0.9.12.1)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
pry-nav (0.2.3)
pry (~> 0.9.10)
rake (10.0.3)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.2)
slop (3.4.3)
rake (10.0.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
slop (3.4.4)
sqlite3 (1.3.7)
tzinfo (0.3.35)
thor (0.18.1)
tzinfo (0.3.37)

PLATFORMS
ruby

DEPENDENCIES
activerecord (~> 3.2.0)
appraisal
coveralls
fuzzily!
mysql2
pg
Expand Down
10 changes: 10 additions & 0 deletions gemfiles/rails32_mysql.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 3.2.0"

gemspec :path=>"../"

ENV['FUZZILY_ADAPTER'] = 'mysql'
ENV['FUZZILY_DB_USER'] = ENV['TRAVIS'] ? 'travis' : 'root'

0 comments on commit f321723

Please sign in to comment.