elasticsearch-extensions 0.0.19 → 0.0.20

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: 8b6250368c4ae4b601347a41c4af300c9c539b71
4
- data.tar.gz: 809f7bc9ed9ddf45c3dffda512a5c9fe4a2c8a0f
3
+ metadata.gz: 7be8d01471cedb9edc6fef26f2d4b8494e030afe
4
+ data.tar.gz: 3a34292423e4f6fe30578a4c8625799bfa3f8116
5
5
  SHA512:
6
- metadata.gz: ecb428c94a77ad8578141d5b2d8a4806942e900958539999b9d3bae21549eba985296f1869a7652a6a4ca9293a27b06c4f20810d1568e97a3f2e1314aa3f31b5
7
- data.tar.gz: 1ea390d043992f5ee8346d9bb1a78b1f4a527e54a7f0d076cffc22d7161005128c959384fee8126ce32d4b5a676e7d4475de5c47394fa494911ceac2a6b3ab23
6
+ metadata.gz: 8b783d84286a9a4282c74d8631de4f510fdfa2e393363139a878614f814f6409767b11c0c13aba18935a51442b6003dc67eaff65cf5ccfd792b1d3d2ad7ad59a
7
+ data.tar.gz: c93fbdc4a33b389f4a9083a0366907fd66c5feae7dd85cf2ed97a1bc59db2fe754087bd474238786bb70b2025aac5f6a5b3a8935abdd63200d315098c696c3e8
data/README.md CHANGED
@@ -90,6 +90,9 @@ You can control the cluster configuration with environment variables as well:
90
90
  TEST_CLUSTER_NAME=my_testing_cluster \
91
91
  ruby -r elasticsearch -e "require 'elasticsearch/extensions/test/cluster'; Elasticsearch::Extensions::Test::Cluster.start"
92
92
 
93
+ To prevent deleting data and configurations when the cluster is started, for example in a development environment,
94
+ use the `clear_cluster: false` option or the `TEST_CLUSTER_CLEAR=false` environment variable.
95
+
93
96
  [Full documentation](http://rubydoc.info/gems/elasticsearch-extensions/Elasticsearch/Extensions/Test/Cluster)
94
97
 
95
98
  ### Test::StartupShutdown
@@ -54,7 +54,7 @@ module Elasticsearch
54
54
  # @option arguments [Boolean] :multicast_enabled Whether multicast is enabled (default: true)
55
55
  # @option arguments [Integer] :timeout Timeout when starting the cluster (default: 30)
56
56
  # @option arguments [String] :network_host The host that nodes will bind on and publish to
57
- # @option arguments [Boolean] :clear Wipe out cluster content on startup (default: true)
57
+ # @option arguments [Boolean] :clear_cluster Wipe out cluster content on startup (default: true)
58
58
  #
59
59
  # You can also use environment variables to set these options.
60
60
  #
@@ -89,7 +89,8 @@ module Elasticsearch
89
89
  arguments[:multicast_enabled] ||= ENV.fetch('TEST_CLUSTER_MULTICAST', 'true')
90
90
  arguments[:timeout] ||= (ENV.fetch('TEST_CLUSTER_TIMEOUT', 30).to_i)
91
91
  arguments[:network_host] ||= @@network_host
92
- arguments[:clear] ||= true
92
+
93
+ clear_cluster = !!arguments[:clear_cluster] || (ENV.fetch('TEST_CLUSTER_CLEAR', 'true') != 'false')
93
94
 
94
95
  # Make sure `cluster_name` is not dangerous
95
96
  if arguments[:cluster_name] =~ /^[\/\\]?$/
@@ -102,8 +103,8 @@ module Elasticsearch
102
103
  return false
103
104
  end
104
105
 
105
- # Wipe out data for this cluster name if requested
106
- FileUtils.rm_rf "#{arguments[:path_data]}/#{arguments[:cluster_name]}" if arguments[:clear]
106
+ # Wipe out data on disk for this cluster name by default
107
+ FileUtils.rm_rf "#{arguments[:path_data]}/#{arguments[:cluster_name]}" if clear_cluster
107
108
 
108
109
  print "Starting ".ansi(:faint) +
109
110
  @@number_of_nodes.to_s.ansi(:bold, :faint) +
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module Extensions
3
- VERSION = "0.0.19"
3
+ VERSION = "0.0.20"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-14 00:00:00.000000000 Z
11
+ date: 2015-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi