letsshop_mapper 0.8.6beta → 0.9.0beta

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -54,6 +54,8 @@ end
54
54
 
55
55
  desc 'Build the gem'
56
56
  task :release => :install do
57
+ system "git commit -m \"#{PKGVERSION}\""
58
+ system "git push origin master"
57
59
  system "gem push letsshop_mapper-#{PKGVERSION}.gem"
58
60
  end
59
61
 
@@ -34,8 +34,10 @@ module LetsShopMapper
34
34
  query << "&nhits=#{conditions[:nhits]}" if conditions[:nhits] != nil
35
35
  if conditions[:f] != nil
36
36
  refine = ""
37
- conditions[:f].split(',').each do |f|
38
- refine << f.gsub(/(refine:)+(\047)+(.+)(\047)/, '\1"\3",')
37
+ refine_splited = conditions[:f].split(',')
38
+ refine_splited.each do |f|
39
+ refine << f.gsub(/(refine:||refine:\()+(\047)(.+)(\047)/, '\1"\3"').gsub(/(\047) (OR||AND) (\047)/, '" \2 "')
40
+ refine << "," unless f == refine_splited.last
39
41
  end
40
42
  query << "&f=#{CGI.escape(refine)}"
41
43
  end
@@ -1,8 +1,8 @@
1
1
  module LetsShopMapper
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 8
5
- TINY = 6
4
+ MINOR = 9
5
+ TINY = 0
6
6
  BUILD = "beta"
7
7
  STRING = [MAJOR, MINOR, TINY, BUILD].join('.')
8
8
  end
@@ -135,6 +135,20 @@ module LetsShopMapper
135
135
  f = lshop.feed.entries[0].get_facets_by("brand")
136
136
  assert_equal "levi's", f[0].title
137
137
  end
138
+ def test_search_refine_with_operator_supplier
139
+ lshop = LetsShopMapper::Connection::Base::new("letsshop.dev.happun.com", "82842d494583280b940b208664f34014")
140
+ lshop.find({:f => "refine:('supplier:galeries lafayette' OR 'supplier:brandalley')", :start => 0, :nhits => 5})
141
+ assert_equal "UTF-8", lshop.feed.encoding
142
+ f = lshop.feed.get_facets_by("supplier")
143
+ assert_equal "brandalley", f[0].title
144
+ assert_equal "galeries lafayette", f[1].title
145
+ lshop.find({:f => "refine:('supplier:brandalley' AND 'brand:morgan')", :start => 0, :nhits => 5})
146
+ assert_equal "UTF-8", lshop.feed.encoding
147
+ f = lshop.feed.get_facets_by("supplier")
148
+ assert_equal "brandalley", f[0].title
149
+ f = lshop.feed.get_facets_by("brand")
150
+ assert_equal "morgan", f[0].title
151
+ end
138
152
  def test_search_product
139
153
  lshop = LetsShopMapper::Connection::Base::new("letsshop.dev.happun.com", "82842d494583280b940b208664f34014")
140
154
  lshop.find({:producs => "b67ab565e1e0f2661e08845111a2106f"})
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letsshop_mapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1481994153
4
+ hash: -1139874821
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
- - 8
9
- - 6beta
10
- version: 0.8.6beta
8
+ - 9
9
+ - 0beta
10
+ version: 0.9.0beta
11
11
  platform: ruby
12
12
  authors:
13
13
  - happun
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-27 00:00:00 +02:00
18
+ date: 2010-08-10 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21