seasyar 0.0.9 → 0.0.10

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.
data/Gemfile.lock CHANGED
@@ -1,42 +1,43 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activemodel (3.0.9)
5
- activesupport (= 3.0.9)
6
- builder (~> 2.1.2)
7
- i18n (~> 0.5.0)
8
- activerecord (3.0.9)
9
- activemodel (= 3.0.9)
10
- activesupport (= 3.0.9)
11
- arel (~> 2.0.10)
12
- tzinfo (~> 0.3.23)
13
- activesupport (3.0.9)
14
- arel (2.0.10)
15
- builder (2.1.2)
16
- diff-lcs (1.1.2)
4
+ activemodel (3.1.3)
5
+ activesupport (= 3.1.3)
6
+ builder (~> 3.0.0)
7
+ i18n (~> 0.6)
8
+ activerecord (3.1.3)
9
+ activemodel (= 3.1.3)
10
+ activesupport (= 3.1.3)
11
+ arel (~> 2.2.1)
12
+ tzinfo (~> 0.3.29)
13
+ activesupport (3.1.3)
14
+ multi_json (~> 1.0)
15
+ arel (2.2.1)
16
+ builder (3.0.0)
17
+ diff-lcs (1.1.3)
17
18
  git (1.2.5)
18
- i18n (0.5.0)
19
+ i18n (0.6.0)
19
20
  jeweler (1.6.4)
20
21
  bundler (~> 1.0)
21
22
  git (>= 1.2.5)
22
23
  rake
23
- multi_json (1.0.3)
24
- rake (0.9.2)
25
- rcov (0.9.10)
26
- rspec (2.6.0)
27
- rspec-core (~> 2.6.0)
28
- rspec-expectations (~> 2.6.0)
29
- rspec-mocks (~> 2.6.0)
30
- rspec-core (2.6.4)
31
- rspec-expectations (2.6.0)
24
+ multi_json (1.0.4)
25
+ rake (0.9.2.2)
26
+ rcov (0.9.11)
27
+ rspec (2.8.0)
28
+ rspec-core (~> 2.8.0)
29
+ rspec-expectations (~> 2.8.0)
30
+ rspec-mocks (~> 2.8.0)
31
+ rspec-core (2.8.0)
32
+ rspec-expectations (2.8.0)
32
33
  diff-lcs (~> 1.1.2)
33
- rspec-mocks (2.6.0)
34
+ rspec-mocks (2.8.0)
34
35
  seasy (0.0.7)
35
- sqlite3 (1.3.3)
36
- standalone_migrations (1.0.1)
36
+ sqlite3 (1.3.5)
37
+ standalone_migrations (1.0.5)
37
38
  activerecord (>= 3)
38
39
  rake
39
- tzinfo (0.3.29)
40
+ tzinfo (0.3.31)
40
41
 
41
42
  PLATFORMS
42
43
  ruby
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.9
1
+ 0.0.10
Binary file
@@ -30,10 +30,13 @@ module Seasyar
30
30
 
31
31
  def search question
32
32
  # todo : count hits.....
33
- hits = Seasyar::SeasyData.find_all_by_key_and_index_name question, @name
33
+ query_parts = question.split ' ' # TODO : split on other white spaces?
34
34
  result = {}
35
- hits.each do |one_hit|
36
- result[one_hit.target] = one_hit.weight
35
+ query_parts.each do |query_part|
36
+ hits = Seasyar::SeasyData.find_all_by_key_and_index_name query_part, @name
37
+ hits.each do |one_hit|
38
+ result[one_hit.target] = one_hit.weight
39
+ end
37
40
  end
38
41
  result
39
42
  end
data/seasyar.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "seasyar"
8
- s.version = "0.0.9"
8
+ s.version = "0.0.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Fredrik Rubensson"]
12
- s.date = "2011-11-20"
12
+ s.date = "2012-01-20"
13
13
  s.description = "Seasy integration. Active record storage for seasy and save hooks in models."
14
14
  s.email = "fredrik@eldfluga.se"
15
15
  s.extra_rdoc_files = [
data/spec/storage_spec.rb CHANGED
@@ -58,4 +58,13 @@ describe Seasyar::ActiveRecordStorage do
58
58
  i1.search( 'ruben').should == {'landsnora' => 1}
59
59
  i2.search( 'ruben').should == {'edsberg' => 1}
60
60
  end
61
+
62
+ it "should split query strings on space" do
63
+ Seasy.configure do |config|
64
+ config.storage = Seasyar::ActiveRecordStorage
65
+ end
66
+ i = Seasy::Index.new
67
+ i.add 'Frodolin', 'a hobbit', :source => 'a gossipy hobbit'
68
+ i.search( 'Frodo Baggins' ).should == {'a hobbit' => 1}
69
+ end
61
70
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: seasyar
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.9
5
+ version: 0.0.10
6
6
  platform: ruby
7
7
  authors:
8
8
  - Fredrik Rubensson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-11-20 00:00:00 Z
13
+ date: 2012-01-20 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: seasy
@@ -155,7 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - ">="
157
157
  - !ruby/object:Gem::Version
158
- hash: -2946730820229906441
158
+ hash: -646363705184731964
159
159
  segments:
160
160
  - 0
161
161
  version: "0"