ej 0.1.9 → 0.1.10
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 +4 -4
- data/lib/ej/commands.rb +1 -1
- data/lib/ej/constants.rb +2 -0
- data/lib/ej/values.rb +8 -3
- data/lib/ej/version.rb +1 -1
- data/spec/core_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 719a4ba9e1eb1f6fc382cce5f1d1b51571478294
|
4
|
+
data.tar.gz: a602858b43d554d18d5c588dad77caee78bf5bef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f00eb51f37d65e89791a15b1a327742db9889c8b6e059ded000f9c3e8f940bb72fef98ed074fa0f0b337c1f2966ad85b36697419b5b8fac26c690d1140961e9
|
7
|
+
data.tar.gz: e45cde9cc3abe2dcb3e063eba243bc6ef01053f34479e2da656fd877539e2e74d51450313f17f82267d28e10b5f3b84b07ed6192c7c5a5fa68fc8129ee2522bf
|
data/lib/ej/commands.rb
CHANGED
@@ -5,7 +5,7 @@ require 'yajl'
|
|
5
5
|
module Ej
|
6
6
|
class Commands < Thor
|
7
7
|
class_option :index, aliases: '-i', type: :string, default: '_all', desc: 'index'
|
8
|
-
class_option :host, aliases: '-h', type: :string, default:
|
8
|
+
class_option :host, aliases: '-h', type: :string, default: DEFAULT_HOST, desc: 'host'
|
9
9
|
class_option :debug, aliases: '-d', type: :boolean, default: false, desc: 'debug mode'
|
10
10
|
|
11
11
|
map '-s' => :search
|
data/lib/ej/constants.rb
CHANGED
data/lib/ej/values.rb
CHANGED
@@ -11,11 +11,16 @@ module Ej
|
|
11
11
|
@index = global_options[:index]
|
12
12
|
end
|
13
13
|
|
14
|
-
def get_client(
|
15
|
-
host, port =
|
14
|
+
def get_client(host_string, index)
|
15
|
+
host, port = (host_string || DEFAULT_HOST), DEFAULT_PORT
|
16
|
+
if !host_string.nil? && host_string.include?(":")
|
17
|
+
host, port = host_string.split(':')
|
18
|
+
end
|
19
|
+
|
20
|
+
hosts = [{ host: host, port: port }]
|
16
21
|
transport = ::Elasticsearch::Transport::Transport::HTTP::Faraday.new(
|
17
22
|
{
|
18
|
-
hosts:
|
23
|
+
hosts: hosts,
|
19
24
|
options: {
|
20
25
|
reload_connections: true,
|
21
26
|
reload_on_failure: false,
|
data/lib/ej/version.rb
CHANGED
data/spec/core_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ej
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toyama0919
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
204
|
version: '0'
|
205
205
|
requirements: []
|
206
206
|
rubyforge_project:
|
207
|
-
rubygems_version: 2.
|
207
|
+
rubygems_version: 2.2.2
|
208
208
|
signing_key:
|
209
209
|
specification_version: 4
|
210
210
|
summary: elasticsearch command line utility.
|