mongoid-elasticsearch 0.3.2 → 0.3.3

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88487cee6ea854abe2c5d830e319fba9a6ecf76a
4
- data.tar.gz: 13d3d7ec572729e6b24616cfec05bc12627e64b5
3
+ metadata.gz: 70c322f4b4cde8641a2f498e1b3f4df697070239
4
+ data.tar.gz: 9beac903f1d23efe9d85257bb19ddf0cc0439fe6
5
5
  SHA512:
6
- metadata.gz: 780cf948874da57f3c455603a1314110b02e1c5361c2ef0c1db24820cdca31cb351b04cd98eec5309d98fe28f6fd53cfdada970423f8eae27598b5a84116e96e
7
- data.tar.gz: b7eb6e71cf359e7b781b53fe5e532939d808238b309f6ce5fb206c8dae43da5b4c85b4c60502863bdf31c40cb62b309c351813ab160e1ea061fa3f130249fa2f
6
+ metadata.gz: 0977850c4ca620de45102cd4ab420030ae93d54d37f9f61878a14a6a6bd1a40bb47069b947648657ac141ef0cbc60b7d1eb9c1cb1864927b06c3e7f801a6ddee
7
+ data.tar.gz: b7d08fb4ec1c184d67d71772f314b938702fc90c57fb48b2942d20415d33b37da95833c03f6bc300d0455a62c77f8b7b4f77b5a867e0b8bcdbfda72301c552e4
@@ -5,7 +5,7 @@ module Mongoid
5
5
  module Elasticsearch
6
6
  module Utils
7
7
  def clean(s)
8
- s.to_s.gsub(/\W+/, ' ').gsub(/ +/, '').strip
8
+ s.to_s.gsub(/\P{Word}+/, ' ').gsub(/ +/, '').strip
9
9
  end
10
10
 
11
11
  extend self
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Elasticsearch
3
- VERSION = "0.3.2"
3
+ VERSION = "0.3.3"
4
4
  end
5
5
  end
@@ -123,6 +123,26 @@ describe Article do
123
123
  all.should eq @articles.map(&:id).map(&:to_s).sort
124
124
  end
125
125
  end
126
+
127
+ context 'destroy' do
128
+ before :each do
129
+ @articles = []
130
+ 10.times { @articles << Article.create!(name: 'test') }
131
+ Article.es.index.refresh
132
+ end
133
+ it '#destroy' do
134
+ Article.es.all.count.should eq 10
135
+ @articles[0].destroy
136
+ Article.es.index.refresh
137
+ Article.es.all.count.should eq 9
138
+ end
139
+ it '#destroy_all' do
140
+ Article.es.all.count.should eq 10
141
+ Article.destroy_all
142
+ Article.es.index.refresh
143
+ Article.es.all.count.should eq 0
144
+ end
145
+ end
126
146
  end
127
147
 
128
148
 
@@ -334,3 +354,8 @@ describe Namespaced::Model do
334
354
  end
335
355
  end
336
356
 
357
+ describe 'utils' do
358
+ it 'doesnt strip non-ascii text' do
359
+ Mongoid::Elasticsearch::Utils.clean('тест {{').should eq 'тест'
360
+ end
361
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebtv
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-25 00:00:00.000000000 Z
11
+ date: 2013-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid
@@ -213,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
213
  version: '0'
214
214
  requirements: []
215
215
  rubyforge_project:
216
- rubygems_version: 2.0.6
216
+ rubygems_version: 2.1.10
217
217
  signing_key:
218
218
  specification_version: 4
219
219
  summary: Simple and easy integration of mongoid with the new elasticsearch gem