ej 0.0.12 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b1ec1d5f0c2e1630c9dcf7aee4e101cc3f53215
4
- data.tar.gz: 5a4e7a17581781b171bbcba5f336442ce124bf78
3
+ metadata.gz: 6ba7f44c1f49100a84246846a99b87fa467ead32
4
+ data.tar.gz: 6223584d39aea4b09bfc2b87ecf8dd5f9e0a1127
5
5
  SHA512:
6
- metadata.gz: 40aa492344a215acdfac37730b50ae3f57a8212903352bf84b80b6ac9bcfebc2617ad7887cb402556c4b113ae2c60caae424ebc4f94a11bce3336039b63e96ac
7
- data.tar.gz: 9a281585c27d17bfb97855a869a7736e014aeff119452e48754104c31553f356ec202e37fe1b6b6cc233f6dd37551fc6fe4b53a90ee8dd34bc9ff28feeaf59a0
6
+ metadata.gz: c167c8f5deea539ab58a5749f2bb6053603217fc5c7b227b7f34b5b77d52dba7211f0ef277bdbebb1343604435bbfca42a1ce76f5843e90951bfc4ef0814b536
7
+ data.tar.gz: 638512a42e5d2ddcdaedaa19085b2d17c054c338aacaecb8b92b1f7edddc610447e0ff3b80e42ecb0f80fe1bf09b88e8998eb63e8f3f4089bd7a3b47fdd7ec26
data/README.md CHANGED
@@ -4,6 +4,8 @@ elasticsearch command line utility
4
4
 
5
5
  required ruby version >= 2.0
6
6
 
7
+ ![ej4.gif](https://qiita-image-store.s3.amazonaws.com/0/26670/116a381c-98f6-aa72-fbd9-ddc4b179b744.gif)
8
+
7
9
  ## Installation
8
10
 
9
11
  Add this line to your application's Gemfile:
data/ej.gemspec CHANGED
@@ -26,6 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_runtime_dependency "thor"
27
27
  spec.add_runtime_dependency "yajl-ruby"
28
28
  spec.add_runtime_dependency "elasticsearch"
29
- spec.add_runtime_dependency "activesupport"
30
29
  spec.add_runtime_dependency "hashie"
31
30
  end
data/lib/ej/commands.rb CHANGED
@@ -4,8 +4,6 @@ require 'thor'
4
4
  require 'yajl'
5
5
  require 'elasticsearch'
6
6
  require 'ej/core'
7
- require 'active_support/core_ext/array'
8
- require 'active_support/core_ext/string'
9
7
  require 'logger'
10
8
 
11
9
  module Ej
@@ -13,7 +11,6 @@ module Ej
13
11
  class_option :index, aliases: '-i', type: :string, default: '_all', desc: 'index'
14
12
  class_option :host, aliases: '-h', type: :string, default: 'localhost', desc: 'host'
15
13
  class_option :debug, aliases: '-d', type: :string, default: false, desc: 'debug mode'
16
- class_option :format, type: :string, default: 'json', enum: ['json', 'yaml'], desc: 'format'
17
14
 
18
15
  map '-s' => :search
19
16
  map '-f' => :facet
@@ -234,20 +231,8 @@ module Ej
234
231
  private
235
232
 
236
233
  def puts_with_format(object)
237
- if options['format'] == 'json'
238
- puts_json(object)
239
- elsif options['format'] == 'yaml'
240
- puts_yaml(object)
241
- end
242
- end
243
-
244
- def puts_json(object)
245
234
  puts Yajl::Encoder.encode(object, pretty: true)
246
235
  end
247
236
 
248
- def puts_yaml(object)
249
- puts YAML.dump(object)
250
- end
251
-
252
237
  end
253
238
  end
data/lib/ej/core.rb CHANGED
@@ -57,6 +57,9 @@ module Ej
57
57
  docs.each do |doc|
58
58
  source = doc.delete('_source')
59
59
  doc.delete('_score')
60
+ ['_id', '_type', '_index'].each do |meta_field|
61
+ source.delete(meta_field)
62
+ end
60
63
  bulk_message << { index: doc.to_h }
61
64
  bulk_message << source
62
65
  end
@@ -239,7 +242,7 @@ module Ej
239
242
  bulk_message << meta
240
243
  bulk_message << record
241
244
  end
242
- bulk_message.in_groups_of(10000, false) do |block|
245
+ bulk_message.each_slice(10000).each do |block|
243
246
  @client.bulk body: block
244
247
  end
245
248
  end
data/lib/ej/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ej
2
- VERSION = '0.0.12'
2
+ VERSION = '0.1.0'
3
3
  end
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.0.12
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - toyama0919
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-27 00:00:00.000000000 Z
11
+ date: 2017-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -122,20 +122,6 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: activesupport
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: hashie
141
127
  requirement: !ruby/object:Gem::Requirement
@@ -196,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
182
  version: '0'
197
183
  requirements: []
198
184
  rubyforge_project:
199
- rubygems_version: 2.4.8
185
+ rubygems_version: 2.5.1
200
186
  signing_key:
201
187
  specification_version: 4
202
188
  summary: elasticsearch command line utility.