elastics-client 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/elastics-client.gemspec +3 -3
- data/lib/elastics/prog_bar.rb +9 -7
- data/lib/elastics-client.rb +1 -1
- metadata +5 -10
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.7
|
data/elastics-client.gemspec
CHANGED
@@ -27,7 +27,7 @@ Upgrading Tutorial: http://elastics.github.io/elastics/doc/7-Tutorials/2-Migrate
|
|
27
27
|
|
28
28
|
________________________________________________________________________________
|
29
29
|
EOM
|
30
|
-
s.add_runtime_dependency 'multi_json',
|
31
|
-
s.add_runtime_dependency 'progressbar', '>=
|
32
|
-
s.add_runtime_dependency 'dye',
|
30
|
+
s.add_runtime_dependency 'multi_json', '>= 1.3.4'
|
31
|
+
s.add_runtime_dependency 'ruby-progressbar', '>= 1.2.0'
|
32
|
+
s.add_runtime_dependency 'dye', '~> 0.1.4'
|
33
33
|
end
|
data/lib/elastics/prog_bar.rb
CHANGED
@@ -7,30 +7,32 @@ module Elastics
|
|
7
7
|
@total_count = total_count
|
8
8
|
@successful_count = 0
|
9
9
|
@failed_count = 0
|
10
|
-
@pbar = ::ProgressBar.
|
10
|
+
@pbar = ::ProgressBar.create(:total => total_count,
|
11
|
+
:progress_mark => '|',
|
12
|
+
:format => 'processing... |%b%i| %p%% %E',
|
13
|
+
:length => 80)
|
11
14
|
@pbar.clear
|
12
|
-
@pbar.
|
13
|
-
puts '_' * @pbar.send(:get_term_width)
|
15
|
+
puts '_' * @pbar.send(:length)
|
14
16
|
message = "#{prefix_message}Processing #{total_count} documents"
|
15
17
|
message << " in batches of #{batch_size}:" unless batch_size.nil?
|
16
18
|
puts message
|
17
|
-
@pbar.
|
19
|
+
@pbar.start
|
18
20
|
end
|
19
21
|
|
20
22
|
def process_result(result, inc)
|
21
23
|
unless result.nil? || result.empty?
|
22
24
|
unless result.failed.size == 0
|
23
25
|
Conf.logger.error "Failed load:\n#{result.failed.to_yaml}"
|
24
|
-
@pbar.
|
26
|
+
@pbar.progress_mark = 'F'
|
25
27
|
end
|
26
28
|
@failed_count += result.failed.size
|
27
29
|
@successful_count += result.successful.size
|
28
30
|
end
|
29
|
-
@pbar.inc
|
31
|
+
@pbar.progress += inc
|
30
32
|
end
|
31
33
|
|
32
34
|
def finish
|
33
|
-
@pbar.finish
|
35
|
+
@pbar.finish unless @pbar.finished?
|
34
36
|
puts "Processed #@total_count. Successful #@successful_count. Skipped #{@total_count - @successful_count - @failed_count}. Failed #@failed_count."
|
35
37
|
puts 'See the log for the details about the failures.' unless @failed_count == 0
|
36
38
|
end
|
data/lib/elastics-client.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastics-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -28,16 +28,13 @@ dependencies:
|
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 1.3.4
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
name: progressbar
|
31
|
+
name: ruby-progressbar
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
35
|
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
38
|
-
- - ~>
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.12.0
|
37
|
+
version: 1.2.0
|
41
38
|
type: :runtime
|
42
39
|
prerelease: false
|
43
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -45,10 +42,7 @@ dependencies:
|
|
45
42
|
requirements:
|
46
43
|
- - ! '>='
|
47
44
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
49
|
-
- - ~>
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
version: 0.12.0
|
45
|
+
version: 1.2.0
|
52
46
|
- !ruby/object:Gem::Dependency
|
53
47
|
name: dye
|
54
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,3 +139,4 @@ signing_key:
|
|
145
139
|
specification_version: 3
|
146
140
|
summary: Client gem for elasticsearch
|
147
141
|
test_files: []
|
142
|
+
has_rdoc:
|