ies 0.1.0 → 0.1.1
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/README.md +1 -1
- data/exe/ies +49 -1
- data/lib/ies/version.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: 85f0467f2e1f8aea96e12bfa298a8d72a0ea7def
|
4
|
+
data.tar.gz: e22581b173471dbf3af9c76e2f95a0960bbc6a89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1f3954909be2e066a6f08fc958163057475c468d663d4b453807baf9bfe92ddbd387f4d65e55bdcbe1456a97a8779258cb38c98da0d7f9f68768e49eef5706b
|
7
|
+
data.tar.gz: edb5db150149cc27377c6b47accef750271ae7a715704147ec22b01c14297d04c4e450d577f52bb7b7c4b3bf787bf50b8be7d26b5949e5c9d1d860c165e6d154
|
data/README.md
CHANGED
data/exe/ies
CHANGED
@@ -8,5 +8,53 @@ require 'optparse'
|
|
8
8
|
require 'elasticsearch'
|
9
9
|
require 'pry'
|
10
10
|
|
11
|
+
options = {
|
12
|
+
url: nil,
|
13
|
+
log: false,
|
14
|
+
require: [],
|
15
|
+
execute: [],
|
16
|
+
}
|
17
|
+
|
18
|
+
OptionParser.new do |opts|
|
19
|
+
opts.banner = 'Usage: ies [options]'
|
20
|
+
|
21
|
+
opts.on("--url URL", "elasticsearch's URLs that are separated with comma. (Default: ENV['ELASTICSEARCH_URL])") do |value|
|
22
|
+
options[:url] = value
|
23
|
+
end
|
24
|
+
|
25
|
+
opts.on("-l", "--log", "log client requets. (Default: #{options[:log]})") do |value|
|
26
|
+
options[:log] = value
|
27
|
+
end
|
28
|
+
|
29
|
+
opts.on("-e COMMAND", "--execute COMMAND", "one line of script. Several -e's allowed.") do |value|
|
30
|
+
options[:execute] << value
|
31
|
+
end
|
32
|
+
|
33
|
+
opts.on("-r LIBRARY", "--require LIBRARY", "require the library") do |values|
|
34
|
+
options[:require] << values
|
35
|
+
end
|
36
|
+
|
37
|
+
opts.on("-h", "--help") do
|
38
|
+
puts opts
|
39
|
+
exit
|
40
|
+
end
|
41
|
+
end.parse!
|
42
|
+
|
43
|
+
options[:require].each do |library|
|
44
|
+
require library
|
45
|
+
end
|
46
|
+
|
47
|
+
client_opts = {}
|
48
|
+
client_opts[:log] = options[:log]
|
49
|
+
client_opts[:url] = options[:url] if options[:url]
|
50
|
+
|
51
|
+
client = Elasticsearch::Client.new(client_opts)
|
52
|
+
|
53
|
+
if !options[:execute].empty?
|
54
|
+
scripts = options[:execute].join("\n")
|
55
|
+
client.instance_eval(scripts)
|
56
|
+
exit
|
57
|
+
end
|
58
|
+
|
11
59
|
Pry.config.prompt = [proc { "ies> " }, proc { "ies| " }]
|
12
|
-
|
60
|
+
client.pry
|
data/lib/ies/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mizokami
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|