elastics-client 1.1.10 → 1.1.11
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 +1 -1
- data/lib/elastics/prog_bar.rb +0 -29
- data/lib/elastics/result/bulk.rb +3 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.11
|
data/elastics-client.gemspec
CHANGED
@@ -30,7 +30,7 @@ Upgrading Tutorial: http://elastics.github.io/elastics/doc/7-Tutorials/2-Migrate
|
|
30
30
|
________________________________________________________________________________
|
31
31
|
EOM
|
32
32
|
s.add_runtime_dependency 'multi_json', '>= 1.3.4'
|
33
|
-
s.add_runtime_dependency 'ruby-progressbar', '>= 1.
|
33
|
+
s.add_runtime_dependency 'ruby-progressbar', '>= 1.4.0'
|
34
34
|
s.add_runtime_dependency 'dye', '~> 0.1.4'
|
35
35
|
s.add_runtime_dependency 'prompter', '~> 0.1.6'
|
36
36
|
end
|
data/lib/elastics/prog_bar.rb
CHANGED
@@ -1,32 +1,3 @@
|
|
1
|
-
class ProgressBar
|
2
|
-
module Format
|
3
|
-
class Base
|
4
|
-
# see https://github.com/jfelchner/ruby-progressbar/pull/50
|
5
|
-
def process(environment)
|
6
|
-
processed_string = @format_string.dup
|
7
|
-
|
8
|
-
non_bar_molecules.each do |molecule|
|
9
|
-
processed_string.gsub!("%#{molecule.key}", environment.send(molecule.method_name).to_s)
|
10
|
-
end
|
11
|
-
|
12
|
-
remaining_molecules = bar_molecules.size
|
13
|
-
placeholder_length = remaining_molecules * 2
|
14
|
-
|
15
|
-
processed_string.gsub! '%%', '%'
|
16
|
-
processed_string_length = processed_string.gsub(/\e\[[\d;]+m/, '').length
|
17
|
-
leftover_bar_length = environment.send(:length) - processed_string_length + placeholder_length
|
18
|
-
leftover_bar_length = leftover_bar_length < 0 ? 0 : leftover_bar_length
|
19
|
-
|
20
|
-
bar_molecules.each do |molecule|
|
21
|
-
processed_string.gsub!("%#{molecule.key}", environment.send(molecule.method_name, leftover_bar_length).to_s)
|
22
|
-
end
|
23
|
-
|
24
|
-
processed_string
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
1
|
module Elastics
|
31
2
|
class ProgBar
|
32
3
|
|
data/lib/elastics/result/bulk.rb
CHANGED
@@ -8,11 +8,12 @@ module Elastics
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def failed
|
11
|
-
self['items'].reject{|i| i['
|
11
|
+
self['items'].reject{|i| i.first.last['ok'] }
|
12
12
|
end
|
13
13
|
|
14
|
+
|
14
15
|
def successful
|
15
|
-
self['items'].select{|i| i['
|
16
|
+
self['items'].select{|i| i.first.last['ok']}
|
16
17
|
end
|
17
18
|
|
18
19
|
end
|
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.1.
|
4
|
+
version: 1.1.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.
|
37
|
+
version: 1.4.0
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.
|
45
|
+
version: 1.4.0
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: dye
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|