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 +4 -4
- data/README.md +2 -3
- data/fcrepo_wrapper.gemspec +0 -1
- data/lib/fcrepo_wrapper.rb +1 -1
- data/lib/fcrepo_wrapper/downloader.rb +17 -10
- data/lib/fcrepo_wrapper/version.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edb09244809680dd2aac813d7381cae666d9e47c
|
4
|
+
data.tar.gz: 392bc6cc390d1057d056c44bbf7d3baf9afee878
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 |
|
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
|
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
|
-
|
data/fcrepo_wrapper.gemspec
CHANGED
data/lib/fcrepo_wrapper.rb
CHANGED
@@ -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 =
|
5
|
-
open(url,
|
6
|
-
|
7
|
-
|
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
|
-
|
data/spec/spec_helper.rb
CHANGED
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.
|
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-
|
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.
|
153
|
+
rubygems_version: 2.6.13
|
168
154
|
signing_key:
|
169
155
|
specification_version: 4
|
170
156
|
summary: Solr 5 service wrapper
|