seeker 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- M2RkZTVhMjU3MzkzZDA3OTY4NWEyNjUwM2E4MzM1M2JiNmJlYTM0OQ==
5
- data.tar.gz: !binary |-
6
- NWU5ZDllNTgyYTUwN2M0MjdmMDY4ZDhiYjcyYzVhODBkMzAyZGJkOA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- NGY0MGU3NDk2ZDk5Nzg4YmM2YjMzZmNiNjQ4NWNlN2JiZGI4Y2MzYjQzYTgy
10
- NDA5NDQ4NjI2YmM2YTJlZTVmOTQxMzAxMDYwMzE2MmQzNzk5Mjc1ZWI4Mjcy
11
- YTg4MDg5YTUxYzMwNGE0NzQwZGZhZDMxMThmMWUyMTJkMWZlZWE=
12
- data.tar.gz: !binary |-
13
- MTY4YzJhNGIxMjI2ZjVlYTQ3NDNjNDM4YTlhYzMwZTRhYTY5MTljZjFhM2Zl
14
- N2Q3MjVkNDJmNWYzY2FmZTM3ZjBjNmZiYzE5YmUyZDg5Njg0NDJkNDI5ZDZl
15
- NTNjZDhjYTU5NDJjZDQ2M2Y5OWJmMTFmZWU1YzIyMGM3YjhkNTE=
2
+ SHA1:
3
+ metadata.gz: bd93ed1af2cebe4b83d46784f981d91c0db45358
4
+ data.tar.gz: eaf1b67565acdab7c8ef9f86f3338ebddb5988e8
5
+ SHA512:
6
+ metadata.gz: ab7067467f67ee0239c0c99e8a0dd82e555e8ebecc61b50f6d87962652b2c72a4ca7f30882a1f57aa00c5077463e3de2bb078dfaba26d8bfbfb265f031982274
7
+ data.tar.gz: f52a554607215b61d624f3d1ecdd4038fb345f860114ddc1cde3e056adbbdd3be82ead403f0f0a2b32efb781506dbee6bb3c27edf403491c5c5569b42eadb4d4
data/README.md CHANGED
@@ -14,6 +14,7 @@ Right now it supports only [sunspot](https://github.com/sunspot/sunspot) and was
14
14
  Given you have Product model:
15
15
 
16
16
  class Product < ActiveRecord::Base
17
+ mount_searcher ProductSearcher
17
18
  end
18
19
 
19
20
  Create corresponding searcher:
@@ -37,7 +38,7 @@ Use it in your controller:
37
38
 
38
39
  class ProductsController < ApplicationController
39
40
  def index
40
- @searcher = ProductSearcher.new params[:product]
41
+ @searcher = Product.searcher params[:product]
41
42
  end
42
43
  end
43
44
 
@@ -3,7 +3,7 @@ class Seeker::Base
3
3
 
4
4
  def self.construct(model)
5
5
  self.model = model
6
- model.searchable &@_searchable if @_searchable
6
+ model.searchable(@_searchable_options, &@_searchable) if @_searchable
7
7
  self
8
8
  end
9
9
 
@@ -19,7 +19,8 @@ class Seeker::Base
19
19
  @_model_name ||= ActiveModel::Name.new model
20
20
  end
21
21
 
22
- def self.searchable(&block)
22
+ def self.searchable(searchable_options = {}, &block)
23
+ @_searchable_options = searchable_options
23
24
  @_searchable = block
24
25
  end
25
26
 
@@ -1,3 +1,3 @@
1
1
  module Seeker
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seeker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Szymon Przybył
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-21 00:00:00.000000000 Z
11
+ date: 2013-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,14 +28,14 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: This Ruby on Rails gem provides an elegant way to separate search logic
@@ -70,17 +70,17 @@ require_paths:
70
70
  - lib
71
71
  required_ruby_version: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - ! '>='
78
+ - - '>='
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.0.5
83
+ rubygems_version: 2.0.3
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: It separates search indecies setup and search rules to searchers. They also