elastomer-cli 0.2.2 → 0.2.3
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/CHANGELOG.md +5 -0
- data/bin/elastomer +3 -0
- data/lib/elastomer/cli/index.rb +6 -0
- data/lib/elastomer/cli/version.rb +1 -1
- data/lib/elastomer/cli.rb +15 -0
- data/test/node_test.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b09a4148ac027157b8a858b8ca3efcd450195728
|
4
|
+
data.tar.gz: 9f8b7f6b2c1a4d5a4e758a204acf35c446763ceb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 839e9ea2e84aad6f21ee6353ef82a5b1f1ea26cdf384eefb7ec77919ab9a2aec4b54f63abe373626bf465f163477a0cb903c6fa9200a857d0ba3545230df5490
|
7
|
+
data.tar.gz: 322853197e039d9886ec4b4373f0ebc01f0a9f3bf67bb8c8a1b603c4728acb641d0517f45dae09ec4f1c08d7a3742eb892f92bf595dc774dc99723055afee859
|
data/CHANGELOG.md
CHANGED
data/bin/elastomer
CHANGED
data/lib/elastomer/cli/index.rb
CHANGED
@@ -6,6 +6,12 @@ module Elastomer
|
|
6
6
|
response = client.cluster.indices
|
7
7
|
puts response.keys.sort
|
8
8
|
end
|
9
|
+
|
10
|
+
desc "count [NAME] [TYPE]", "count documents in index NAME of type TYPE"
|
11
|
+
def count(index, type)
|
12
|
+
response = client.docs(index, type).search({:query => {:match_all => {}}}, :search_type => :count)
|
13
|
+
puts response["hits"]["total"]
|
14
|
+
end
|
9
15
|
end
|
10
16
|
end
|
11
17
|
end
|
data/lib/elastomer/cli.rb
CHANGED
@@ -16,5 +16,20 @@ module Elastomer
|
|
16
16
|
def self.start(*args)
|
17
17
|
Elastomer::CLI::Application.start(*args)
|
18
18
|
end
|
19
|
+
|
20
|
+
module FailureHook
|
21
|
+
# This method, defined on a Thor class, causes it to exit with nonzero
|
22
|
+
# status if a command fails. By default, Thor doesn't exit if a command
|
23
|
+
# fails, and the eventual exit status is zero (success).
|
24
|
+
def exit_on_failure?
|
25
|
+
true
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# Force Thor to exit immediately with nonzero status if a command fails.
|
30
|
+
# This is probably what you want when running from the command line.
|
31
|
+
def self.setup_failure_hook
|
32
|
+
Base.extend(FailureHook)
|
33
|
+
end
|
19
34
|
end
|
20
35
|
end
|
data/test/node_test.rb
CHANGED
@@ -10,7 +10,7 @@ describe Elastomer::CLI::Node do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'should get hot_threads for all nodes' do
|
13
|
-
VCR.use_cassette('two_node_cluster'
|
13
|
+
VCR.use_cassette('two_node_cluster') do
|
14
14
|
elastomer 'node hot_threads'
|
15
15
|
@out.must_match /^:::.*:9300/
|
16
16
|
@out.must_match /^:::.*:9301/
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastomer-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grant Rodgers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|