lib/elasticsearch/extensions/test/cluster.rb in elasticsearch-extensions-0.0.27 vs lib/elasticsearch/extensions/test/cluster.rb in elasticsearch-extensions-0.0.28
- old
+ new
@@ -194,10 +194,11 @@
-E logger.level=#{ENV['DEBUG'] ? 'DEBUG' : 'INFO'} \
#{arguments[:es_params]}
COMMAND
}
}
+ COMMANDS['7.0'] = COMMANDS['6.0'].clone
COMMANDS.freeze
# Create a new instance of the Cluster class
#
# @option arguments [String] :cluster_name Cluster name (default: `elasticsearch_test`)
@@ -405,11 +406,11 @@
case version
when /^0|^1/
'0.0.0.0'
when /^2/
'_local_'
- when /^5|^6/
+ when /^5|^6|^7/
'_local_'
else
raise RuntimeError, "Cannot determine default network host from version [#{version}]"
end
end
@@ -450,11 +451,11 @@
#
def __determine_version
path_to_lib = File.dirname(arguments[:command]) + '/../lib/'
version = if arguments[:version]
arguments[:version]
- elsif File.exist?(path_to_lib) && !(jar = Dir.entries(path_to_lib).select { |f| f.start_with? 'elasticsearch' }.first).nil?
+ elsif File.exist?(path_to_lib) && !(jar = Dir.entries(path_to_lib).select { |f| f =~ /^elasticsearch\-\d/ }.first).nil?
__log "Determining version from [#{jar}]" if ENV['DEBUG']
if m = jar.match(/elasticsearch\-(\d+\.\d+\.\d+).*/)
m[1]
else
raise RuntimeError, "Cannot determine Elasticsearch version from jar [#{jar}]"
@@ -525,9 +526,11 @@
'2.0'
when /^5\..*/
'5.0'
when /^6\..*/
'6.0'
+ when /^7\..*/
+ '7.0'
else
raise RuntimeError, "Cannot determine major version from [#{version}]"
end
end