Module: ElasticSearch::Node

Defined in:
lib/elasticsearch-node.rb,
lib/elasticsearch-node/remote.rb,
lib/elasticsearch-node/version.rb,
lib/elasticsearch-node/embedded.rb,
lib/elasticsearch-node/external.rb

Defined Under Namespace

Classes: Embedded, External, Remote

Constant Summary collapse

VERSION =
"0.7.5"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#versionObject

Returns the value of attribute version.



6
7
8
# File 'lib/elasticsearch-node.rb', line 6

def version
  @version
end

Class Method Details

.binaryObject



16
17
18
19
20
21
22
# File 'lib/elasticsearch-node.rb', line 16

def self.binary
  if self.windows?
    File.join(path, 'bin', 'elasticsearch.bat')
  else
    File.join(path, 'bin', 'elasticsearch')
  end
end

.config(name) ⇒ Object



28
29
30
# File 'lib/elasticsearch-node.rb', line 28

def self.config(name)
  root('configs', name.to_s, "config")
end

.default_config(name) ⇒ Object



32
33
34
# File 'lib/elasticsearch-node.rb', line 32

def self.default_config(name)
  ENV["ES_JAVA_OPTS"] = "-Des.path.conf=#{self.config(name)}"
end

.libObject



24
25
26
# File 'lib/elasticsearch-node.rb', line 24

def self.lib
  File.join(path, 'lib')
end

.pathObject



12
13
14
# File 'lib/elasticsearch-node.rb', line 12

def self.path
  File.expand_path(File.join(root, "elasticsearch-#{version}"))
end

.root(*args) ⇒ Object



8
9
10
# File 'lib/elasticsearch-node.rb', line 8

def self.root(*args)
  File.join(File.dirname(__FILE__), "..", *args)
end

.versionObject



36
37
38
# File 'lib/elasticsearch-node.rb', line 36

def self.version
  @version || ENV["ES_VERSION"] || "0.20.1"
end

.windows?Boolean

Returns:

  • (Boolean)


40
41
42
43
# File 'lib/elasticsearch-node.rb', line 40

def self.windows?
  require 'rbconfig'
  RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
end