fcrepo_wrapper 0.8.0 → 0.9.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: 586c5e4826f1221029e3439407b883e2e55060df
4
- data.tar.gz: b38c2fffacec23ad368571395be5ec133d9bb361
3
+ metadata.gz: edb09244809680dd2aac813d7381cae666d9e47c
4
+ data.tar.gz: 392bc6cc390d1057d056c44bbf7d3baf9afee878
5
5
  SHA512:
6
- metadata.gz: 6705b3df401d00cd08d1c476554ccfbf7fe27aae7be54a6df7c7a756dbe7c22919276dde077928b3d6dc4f497a819005dd8fe82055093bde6ede840974a10809
7
- data.tar.gz: 0d3bd0dd6be8568fdf643a92e0dcae15730e51ff24396e1ce413de520dc62413e56af2a378ccd2bd932aa090e9c416c56a0d329359090bf1c76012a8e839fa9c
6
+ metadata.gz: 126eefe977370e43d2936566f1838da100408c38738b33d6c9390d1c40fb97624920c026266486329f722911b29936e1a8b3e5c19c9d647473c94b9f91bdc161
7
+ data.tar.gz: 9268715cdd5219d4c031be4ca14a2684acc8be3766193d70af2d52b87ae547095d59e73075823c0eeaab9bc30e293ac9a31221c3ebfc5829c883797b3f4e1575
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Wrap any task with a Fcrepo instance:
4
4
 
5
5
  ```ruby
6
- FcrepoWrapper.wrap do |solr|
6
+ FcrepoWrapper.wrap do |fedora_repo|
7
7
  # Something that requires Fcrepo
8
8
  end
9
9
  ```
@@ -35,7 +35,7 @@ $ fcrepo_wrapper -config <path_to_config_file>
35
35
  |-----------------|-----------------------------------------|
36
36
  | download_dir | Local path for storing the downloaded jar & md5 file |
37
37
  | env | *(Hash)* |
38
- | fcrepo_home_dir | Directory to store fedora repoistory data files |
38
+ | fcrepo_home_dir | Directory to store fedora repository data files |
39
39
  | fedora_options | *(Hash)* |
40
40
  | ignore_md5sum | *(Boolean)* suppress checksum error messages |
41
41
  | instance_dir | Directory to store the fedora jar file |
@@ -54,4 +54,3 @@ To clean out data that is being stored in you FcrepoWrapper explicitly run:
54
54
  $ fcrepo_wrapper <configuration options> clean
55
55
  ```
56
56
  ***Note*** You must use the same configuration options on the clean command as you do on the run command to clean the correct instance.
57
-
@@ -25,6 +25,5 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.add_development_dependency "rspec"
27
27
  spec.add_development_dependency "rubocop"
28
- spec.add_development_dependency "simple_solr_client"
29
28
  spec.add_development_dependency "coveralls"
30
29
  end
@@ -7,7 +7,7 @@ require 'fcrepo_wrapper/instance'
7
7
 
8
8
  module FcrepoWrapper
9
9
  def self.default_fcrepo_version
10
- '4.7.1'
10
+ '4.7.3'
11
11
  end
12
12
 
13
13
  def self.default_fcrepo_port
@@ -1,18 +1,25 @@
1
+ require 'ruby-progressbar'
2
+
1
3
  module FcrepoWrapper
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,
8
+ content_length_proc: ->(bytes) { pbar.total = bytes },
9
+ progress_proc: ->(bytes) { pbar.progress = bytes }) do |io|
13
10
  IO.copy_stream(io, output)
14
11
  end
15
12
  end
13
+
14
+ class SafeProgressBar < ProgressBar::Base
15
+ def progress=(new_progress)
16
+ self.total = new_progress if total.to_i <= new_progress
17
+ super
18
+ end
19
+
20
+ def total=(new_total)
21
+ super if new_total && new_total > 0
22
+ end
23
+ end
16
24
  end
17
25
  end
18
-
@@ -1,3 +1,3 @@
1
1
  module FcrepoWrapper
2
- VERSION = '0.8.0'.freeze
2
+ VERSION = '0.9.0'.freeze
3
3
  end
@@ -2,7 +2,6 @@ require 'coveralls'
2
2
  Coveralls.wear!
3
3
 
4
4
  require 'fcrepo_wrapper'
5
- require 'simple_solr_client'
6
5
 
7
6
  require 'rspec'
8
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fcrepo_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.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: 2017-01-25 00:00:00.000000000 Z
11
+ date: 2017-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-progressbar
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: simple_solr_client
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: coveralls
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -164,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
150
  version: '0'
165
151
  requirements: []
166
152
  rubyforge_project:
167
- rubygems_version: 2.6.8
153
+ rubygems_version: 2.6.13
168
154
  signing_key:
169
155
  specification_version: 4
170
156
  summary: Solr 5 service wrapper