Skip to content

Commit

Permalink
Merge pull request #101 from alexkravets/master
Browse files Browse the repository at this point in the history
Make rake index task available within rails app
  • Loading branch information
mauriciozaffari committed Sep 8, 2016
2 parents 24cac58 + 2529201 commit 77bf98e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

5 changes: 3 additions & 2 deletions lib/mongoid_search.rb
@@ -1,9 +1,10 @@
# encoding: utf-8

require 'mongoid_search/railtie' if defined?(Rails) && defined?(Rails::Railtie)
require 'mongoid_search/mongoid_search'

Dir["tasks/**/*.rake"].each { |ext| load ext } if defined?(Rake)
if defined?(Rails)
require 'mongoid_search/railtie'
end

module Mongoid::Search
## Default matching type. Match :any or :all searched keywords
Expand Down
7 changes: 2 additions & 5 deletions lib/mongoid_search/railtie.rb
@@ -1,10 +1,7 @@
require 'mongoid_search'
require 'rails'

module Mongoid::Search
class Railtie < Rails::Railtie
rake_tasks do
Dir[File.join(File.dirname(__FILE__), '../../tasks/*.rake')].each { |f| load f }
Dir[File.join(File.dirname(__FILE__), 'tasks/*.rake')].each { |f| load f }
end
end
end
end
File renamed without changes.
2 changes: 1 addition & 1 deletion mongoid_search-java.gemspec
Expand Up @@ -4,7 +4,7 @@ $:.unshift lib unless $:.include?(lib)

Gem::Specification.new do |s|
s.name = "mongoid_search"
s.version = "0.3.2"
s.version = "0.3.3"
s.authors = ["Mauricio Zaffari"]
s.email =["mauricio@papodenerd.net"]
s.homepage = "http://www.papodenerd.net/mongoid-search-full-text-search-for-your-mongoid-models/"
Expand Down
6 changes: 3 additions & 3 deletions mongoid_search.gemspec
Expand Up @@ -4,7 +4,7 @@ $:.unshift lib unless $:.include?(lib)

Gem::Specification.new do |s|
s.name = "mongoid_search"
s.version = "0.3.2"
s.version = "0.3.3"
s.authors = ["Mauricio Zaffari"]
s.email =["mauricio@papodenerd.net"]
s.homepage = "http://www.papodenerd.net/mongoid-search-full-text-search-for-your-mongoid-models/"
Expand All @@ -13,9 +13,9 @@ Gem::Specification.new do |s|
s.license = 'MIT'

s.required_rubygems_version = ">= 1.3.6"

s.platform = "ruby"

s.add_dependency("mongoid", [">= 3.0.0"])
s.add_dependency("fast-stemmer", ["~> 1.0.0"])
s.add_development_dependency("database_cleaner", [">= 0.8.0"])
Expand Down

0 comments on commit 77bf98e

Please sign in to comment.