chewy 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8eb12f365d07168ff5e5f52511029a07a5eccda1
4
- data.tar.gz: aae1608aa3438ea0bc28ed43bf65ccde19e2bc8b
3
+ metadata.gz: a311bdd3957835909c81ba57886bba5fbebebbef
4
+ data.tar.gz: 0011b212e985166c040bb195ec3dc0214b797ab5
5
5
  SHA512:
6
- metadata.gz: 2db0c6c51c6fc9061c5e751e2759213723b5a2524c4443e7688bd792b81615104d6f5ba698b5de33a0c91030045666d20957255a13e3d706c8f76b68bf7d4174
7
- data.tar.gz: bab3cb005e8f0264022c39ecaa4d04b81b9dbccfc4de7fd28c637250746eb18ffea1d6cef89c2dcc7c09f4a4dccb0120a89e7bf15be1e1bf769dc85c10b5b4f1
6
+ metadata.gz: 2727a488bbaefa2b0d9bd47da643a83e72882bfe3da41e4eda9e7e59df37fb72ad0343273594ae7dfbfbb8d4f84534d63867038b6fd8de667aca4eb0126c34a3
7
+ data.tar.gz: 6e54cfb1362cc06ff500ee01eb24c809c54c590b6390e20bfd45db4bb61c0c403ea3afd93b6dd3ef23bb53336efb157bd9c4cbca2aad9065db019a6693e84530
data/.travis.yml CHANGED
@@ -37,6 +37,6 @@ matrix:
37
37
  - rvm: 2.2.0
38
38
  gemfile: gemfiles/rails.3.2.activerecord.will_paginate.gemfile
39
39
  before_install:
40
- - curl -# https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.0.tar.gz | tar xz -C /tmp
40
+ - curl -# https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.2.tar.gz | tar xz -C /tmp
41
41
  before_script:
42
- - TEST_CLUSTER_COMMAND="/tmp/elasticsearch-1.5.0/bin/elasticsearch" rake elasticsearch:start
42
+ - TEST_CLUSTER_COMMAND="/tmp/elasticsearch-1.5.2/bin/elasticsearch" rake elasticsearch:start
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # master
2
2
 
3
+ # Version 0.8.1
4
+
5
+ ## Bugfixes
6
+
7
+ * Added support of elasticsearch-ruby 1.0.10
8
+
3
9
  # Version 0.8.0
4
10
 
5
11
  ## Incompatible changes:
@@ -78,7 +78,11 @@ module Chewy
78
78
  # UsersIndex.delete '01-2014' # deletes `users_01-2014` index
79
79
  #
80
80
  def delete suffix = nil
81
- delete! suffix
81
+ result = client.indices.delete index: build_index_name(suffix: suffix)
82
+ Chewy.wait_for_status if result
83
+ result
84
+ # es-ruby >= 1.0.10 handles Elasticsearch::Transport::Transport::Errors::NotFound
85
+ # by itself, rescue is for previous versions
82
86
  rescue Elasticsearch::Transport::Transport::Errors::NotFound
83
87
  false
84
88
  end
@@ -93,9 +97,9 @@ module Chewy
93
97
  # UsersIndex.delete '01-2014' # deletes `users_01-2014` index
94
98
  #
95
99
  def delete! suffix = nil
96
- result = client.indices.delete index: build_index_name(suffix: suffix)
97
- Chewy.wait_for_status if result
98
- result
100
+ # es-ruby >= 1.0.10 handles Elasticsearch::Transport::Transport::Errors::NotFound
101
+ # by itself, so it is raised here
102
+ delete(suffix) or raise Elasticsearch::Transport::Transport::Errors::NotFound
99
103
  end
100
104
 
101
105
  # Deletes and recreates index. Supports suffixes.
@@ -118,11 +122,8 @@ module Chewy
118
122
  # UsersIndex.purge! '01-2014' # deletes `users` and `users_01-2014` indexes, creates `users_01-2014`
119
123
  #
120
124
  def purge! suffix = nil
121
- begin
122
- delete! if suffix.present? && exists?
123
- delete! suffix
124
- rescue Elasticsearch::Transport::Transport::Errors::NotFound
125
- end
125
+ delete if suffix.present? && exists?
126
+ delete suffix
126
127
  create! suffix
127
128
  end
128
129
 
@@ -61,7 +61,7 @@ module Chewy
61
61
  def debug string
62
62
  if Chewy.logger && Chewy.logger.debug?
63
63
  line = caller.detect { |line| line !~ %r{lib/chewy/strategy.rb:|lib/chewy.rb:} }
64
- Chewy.logger.debug(["Chewy strategies stack: #{string}", line.sub(/:in\s.+$/, '')].join(' @ '))
64
+ Chewy.logger.debug(["DEBUG: Chewy strategies stack: #{string}", line.sub(/:in\s.+$/, '')].join(' @ '))
65
65
  end
66
66
  end
67
67
 
data/lib/chewy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Chewy
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chewy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyromaniac