solr_wrapper 0.7.3 → 0.8.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: 8e4d41ab3bd1b628c5f948717dcf7f48d76d1106
4
- data.tar.gz: 204dcf436957092b4f9e787f60ebcd3af028b390
3
+ metadata.gz: 26e84bf462a67bf41bcc28be718464861ce482d8
4
+ data.tar.gz: c38874bc575bfe27d3481ea5e6b61d8f9da28ca1
5
5
  SHA512:
6
- metadata.gz: d234f9ac3315f4a09edd69c759c174305e81ac55ff50165cffcb4a62d2a275fde28acb1c36dd500da796f24120e6ecc668ef70f130a0b9b2a003974e96673893
7
- data.tar.gz: 2df041374409128b007c738f2824806bd249a3fce6a10c6400bd2da2273fbe2bb75dd63dc7848c977b57cc2b0e7c54e3b4117c485f7b519b71b99926817d389d
6
+ metadata.gz: 28ade5c8d559625c6d584202ecdd9ce5ca0bc55d2e49fe3bfe3480629df45e766311986cf8d0a1ba80d2f1b3826094c18014c8e2dd3e754702067391d726846f
7
+ data.tar.gz: fc164fb6434984bd6c6f05964a2755b08c71c303480542dea0da5149dc0c3e60d79eb61c74afaafb8aa44a591baba8a728bb4420f34ca91055918b7ee38c064a
@@ -7,3 +7,6 @@ rvm:
7
7
  cache:
8
8
  directories:
9
9
  - /tmp/solr-5.4.1
10
+
11
+ jdk:
12
+ - oraclejdk8
@@ -7,7 +7,7 @@ require 'solr_wrapper/instance'
7
7
 
8
8
  module SolrWrapper
9
9
  def self.default_solr_version
10
- '5.4.1'
10
+ '6.0.0'
11
11
  end
12
12
 
13
13
  def self.default_instance_options
@@ -1,17 +1,23 @@
1
+ require 'ruby-progressbar'
2
+
1
3
  module SolrWrapper
2
4
  class Downloader
3
5
  def self.fetch_with_progressbar(url, output)
4
- pbar = ProgressBar.create(title: File.basename(url), total: nil, format: "%t: |%B| %p%% (%e )")
5
- open(url, content_length_proc: lambda do|t|
6
- if t && 0 < t
7
- pbar.total = t
8
- end
9
- end,
10
- progress_proc: lambda do|s|
11
- pbar.progress = s
12
- end) do |io|
6
+ pbar = SafeProgressBar.new(title: File.basename(url), total: nil, format: '%t: |%B| %p%% (%e )')
7
+ open(url, content_length_proc: ->(bytes) { pbar.total = bytes }, progress_proc: ->(bytes) { pbar.progress = bytes }) do |io|
13
8
  IO.copy_stream(io, output)
14
9
  end
15
10
  end
11
+
12
+ class SafeProgressBar < ProgressBar::Base
13
+ def progress=(new_progress)
14
+ self.total = new_progress if total <= new_progress
15
+ super
16
+ end
17
+
18
+ def total=(new_total)
19
+ super if new_total && new_total > 0
20
+ end
21
+ end
16
22
  end
17
23
  end
@@ -2,7 +2,6 @@ require 'digest'
2
2
  require 'fileutils'
3
3
  require 'json'
4
4
  require 'open-uri'
5
- require 'ruby-progressbar'
6
5
  require 'securerandom'
7
6
  require 'socket'
8
7
  require 'stringio'
@@ -1,3 +1,3 @@
1
1
  module SolrWrapper
2
- VERSION = '0.7.3'
2
+ VERSION = '0.8.0'
3
3
  end
@@ -73,7 +73,7 @@ describe SolrWrapper::Instance do
73
73
 
74
74
  describe "#version" do
75
75
  subject { solr_instance.version }
76
- it { is_expected.to eq '5.4.1' }
76
+ it { is_expected.to eq '6.0.0' }
77
77
  end
78
78
 
79
79
  describe "#md5" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solr_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2016-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  version: '0'
172
172
  requirements: []
173
173
  rubyforge_project:
174
- rubygems_version: 2.5.1
174
+ rubygems_version: 2.4.5.1
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: Solr 5 service wrapper
@@ -189,4 +189,3 @@ test_files:
189
189
  - spec/lib/solr_wrapper/instance_spec.rb
190
190
  - spec/lib/solr_wrapper_spec.rb
191
191
  - spec/spec_helper.rb
192
- has_rdoc: