ro-crate 0.4.15 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +1 -1
- data/.ruby-version +1 -1
- data/Gemfile.lock +6 -4
- data/lib/ro_crate/model/contextual_entity.rb +1 -2
- data/lib/ro_crate/model/crate.rb +15 -14
- data/lib/ro_crate/model/entity.rb +7 -2
- data/lib/ro_crate/model/entry.rb +6 -0
- data/lib/ro_crate/model/remote_entry.rb +7 -1
- data/lib/ro_crate/reader.rb +1 -1
- data/lib/ro_crate/writer.rb +16 -8
- data/ro_crate.gemspec +3 -2
- data/test/crate_test.rb +2 -1
- data/test/entity_test.rb +2 -0
- data/test/fixtures/workflow-test-fixture-symlink/LICENSE +21 -0
- data/test/fixtures/workflow-test-fixture-symlink/README.md +2 -0
- data/test/fixtures/workflow-test-fixture-symlink/concat_two_files.ga +151 -0
- data/test/fixtures/workflow-test-fixture-symlink/diagram.png +0 -0
- data/test/fixtures/workflow-test-fixture-symlink/images/workflow-diagram.png +1 -0
- data/test/writer_test.rb +29 -2
- metadata +24 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa3bf8a8cdaa985143e1e2988d4fc24e14aad40bfd55763b4be17af23c8fa36a
|
4
|
+
data.tar.gz: 190326475ec90f7328e86252dd4f0c1150750ba8298fef7ba8337291ae988e21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cf568838eba39df6ff3770456a8f2133efe8797d1b916b0acf4523f1830623120e14e3a3e8d3e5bbbf09d7960fe5afc585389010ab674394cc80b3c944363d7
|
7
|
+
data.tar.gz: 151807e2411c7d7d09ef2930f75b1eca9f1274fce14ca28d084c7b609268defc70803832697d79b68b9efe282ed63b0af1b179fd1cb0de2dba641798b331afe9
|
data/.github/workflows/tests.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-
|
1
|
+
ruby-3.0.4
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ro-crate (0.
|
4
|
+
ro-crate (0.5.0)
|
5
5
|
addressable (>= 2.7, < 2.9)
|
6
6
|
rubyzip (~> 2.0.0)
|
7
7
|
|
@@ -14,9 +14,10 @@ GEM
|
|
14
14
|
safe_yaml (~> 1.0.0)
|
15
15
|
docile (1.3.5)
|
16
16
|
hashdiff (1.0.1)
|
17
|
-
power_assert (
|
17
|
+
power_assert (2.0.1)
|
18
18
|
public_suffix (4.0.6)
|
19
19
|
rake (13.0.0)
|
20
|
+
rexml (3.2.5)
|
20
21
|
rubyzip (2.0.0)
|
21
22
|
safe_yaml (1.0.5)
|
22
23
|
simplecov (0.21.2)
|
@@ -25,7 +26,7 @@ GEM
|
|
25
26
|
simplecov_json_formatter (~> 0.1)
|
26
27
|
simplecov-html (0.12.3)
|
27
28
|
simplecov_json_formatter (0.1.2)
|
28
|
-
test-unit (3.
|
29
|
+
test-unit (3.5.3)
|
29
30
|
power_assert
|
30
31
|
webmock (3.8.3)
|
31
32
|
addressable (>= 2.3.6)
|
@@ -38,9 +39,10 @@ PLATFORMS
|
|
38
39
|
|
39
40
|
DEPENDENCIES
|
40
41
|
rake (~> 13.0.0)
|
42
|
+
rexml (~> 3.2.5)
|
41
43
|
ro-crate!
|
42
44
|
simplecov (~> 0.21.2)
|
43
|
-
test-unit (~> 3.
|
45
|
+
test-unit (~> 3.5.3)
|
44
46
|
webmock (~> 3.8.3)
|
45
47
|
yard (~> 0.9.25)
|
46
48
|
|
@@ -4,8 +4,7 @@ module ROCrate
|
|
4
4
|
# Contextual Entities are used to describe and provide context to the Data Entities within the crate.
|
5
5
|
class ContextualEntity < Entity
|
6
6
|
def self.format_local_id(id)
|
7
|
-
|
8
|
-
i.start_with?('#') ? i : "##{i}"
|
7
|
+
super(id.start_with?('#') ? id : "##{id}")
|
9
8
|
end
|
10
9
|
|
11
10
|
##
|
data/lib/ro_crate/model/crate.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'set'
|
2
|
+
|
1
3
|
module ROCrate
|
2
4
|
##
|
3
5
|
# A Ruby abstraction of an RO-Crate.
|
@@ -20,8 +22,8 @@ module ROCrate
|
|
20
22
|
##
|
21
23
|
# Initialize an empty RO-Crate.
|
22
24
|
def initialize(id = IDENTIFIER, properties = {})
|
23
|
-
@data_entities =
|
24
|
-
@contextual_entities =
|
25
|
+
@data_entities = Set.new
|
26
|
+
@contextual_entities = Set.new
|
25
27
|
super(self, nil, id, properties)
|
26
28
|
end
|
27
29
|
|
@@ -144,8 +146,8 @@ module ROCrate
|
|
144
146
|
# @return [Entity] the entity itself, or a clone of the entity "owned" by this crate.
|
145
147
|
def add_contextual_entity(entity)
|
146
148
|
entity = claim(entity)
|
147
|
-
contextual_entities.delete(entity) # Remove (then re-add) the entity if it exists
|
148
|
-
contextual_entities.
|
149
|
+
contextual_entities.delete?(entity) # Remove (then re-add) the entity if it exists
|
150
|
+
contextual_entities.add(entity)
|
149
151
|
entity
|
150
152
|
end
|
151
153
|
|
@@ -156,8 +158,8 @@ module ROCrate
|
|
156
158
|
# @return [Entity] the entity itself, or a clone of the entity "owned" by this crate.
|
157
159
|
def add_data_entity(entity)
|
158
160
|
entity = claim(entity)
|
159
|
-
data_entities.delete(entity) # Remove (then re-add) the entity if it exists
|
160
|
-
data_entities.
|
161
|
+
data_entities.delete?(entity) # Remove (then re-add) the entity if it exists
|
162
|
+
data_entities.add(entity)
|
161
163
|
entity
|
162
164
|
end
|
163
165
|
|
@@ -189,7 +191,7 @@ module ROCrate
|
|
189
191
|
##
|
190
192
|
# All the entities within the crate. Includes contextual entities, data entities, the crate itself and its metadata file.
|
191
193
|
#
|
192
|
-
# @return [
|
194
|
+
# @return [Set<Entity>]
|
193
195
|
def entities
|
194
196
|
default_entities | data_entities | contextual_entities
|
195
197
|
end
|
@@ -197,9 +199,9 @@ module ROCrate
|
|
197
199
|
##
|
198
200
|
# Entities for the metadata file and crate itself, which should be present in all RO-Crates.
|
199
201
|
#
|
200
|
-
# @return [
|
202
|
+
# @return [Set<Entity>]
|
201
203
|
def default_entities
|
202
|
-
[metadata, preview, self]
|
204
|
+
Set.new([metadata, preview, self])
|
203
205
|
end
|
204
206
|
|
205
207
|
def properties
|
@@ -217,7 +219,7 @@ module ROCrate
|
|
217
219
|
#
|
218
220
|
# @return [Addressable::URI]
|
219
221
|
def canonical_id
|
220
|
-
Addressable::URI.parse("arcp://uuid,#{uuid}").join(id)
|
222
|
+
@canonical_id ||= Addressable::URI.parse("arcp://uuid,#{uuid}").join(id)
|
221
223
|
end
|
222
224
|
|
223
225
|
##
|
@@ -248,8 +250,7 @@ module ROCrate
|
|
248
250
|
# Gather a map of entries, starting from the crate itself, then any directory data entities, then finally any
|
249
251
|
# file data entities. This ensures in the case of a conflict, the more "specific" data entities take priority.
|
250
252
|
entries = own_payload
|
251
|
-
|
252
|
-
sorted_entities = (non_self_entities | data_entities).sort_by { |e| e.is_a?(ROCrate::Directory) ? 0 : 1 }
|
253
|
+
sorted_entities = (default_entities.delete(self) | data_entities).sort_by { |e| e.is_a?(ROCrate::Directory) ? 0 : 1 }
|
253
254
|
|
254
255
|
sorted_entities.each do |entity|
|
255
256
|
entity.payload.each do |path, entry|
|
@@ -277,7 +278,7 @@ module ROCrate
|
|
277
278
|
entity = dereference(entity) if entity.is_a?(String)
|
278
279
|
return unless entity
|
279
280
|
|
280
|
-
deleted = data_entities.delete(entity) || contextual_entities.delete(entity)
|
281
|
+
deleted = data_entities.delete?(entity) || contextual_entities.delete?(entity)
|
281
282
|
|
282
283
|
if deleted && remove_orphaned
|
283
284
|
crate_entities = crate.linked_entities(deep: true)
|
@@ -293,7 +294,7 @@ module ROCrate
|
|
293
294
|
# Optionally takes a block to decide whether the given entity should be removed or not, otherwise removes all
|
294
295
|
# unlinked entities.
|
295
296
|
# @yieldparam [ContextualEntity] entity An unlinked contextual entity.
|
296
|
-
# @
|
297
|
+
# @yieldreturn [Boolean] remove Should this entity be removed?
|
297
298
|
#
|
298
299
|
# @return [Array<ContextualEntity>] The entities that were removed.
|
299
300
|
def gc(&block)
|
@@ -57,7 +57,12 @@ module ROCrate
|
|
57
57
|
# @param id [String] The candidate local ID to be formatted.
|
58
58
|
# @return [String] The formatted local ID.
|
59
59
|
def self.format_local_id(id)
|
60
|
-
|
60
|
+
if id.start_with?('#')
|
61
|
+
'#' + Addressable::URI.encode_component(id[1..-1], Addressable::URI::CharacterClasses::QUERY)
|
62
|
+
else
|
63
|
+
# Remove initial ./ if present
|
64
|
+
Addressable::URI.encode_component(id.sub(/\A\.\//, ''), Addressable::URI::CharacterClasses::PATH)
|
65
|
+
end
|
61
66
|
end
|
62
67
|
|
63
68
|
##
|
@@ -246,7 +251,7 @@ module ROCrate
|
|
246
251
|
value = properties[key] # We're doing this to call the JSONLDHash#[] method which wraps
|
247
252
|
value = [value] if value.is_a?(JSONLDHash)
|
248
253
|
|
249
|
-
if value.
|
254
|
+
if value.respond_to?(:each)
|
250
255
|
value.each do |v|
|
251
256
|
if v.is_a?(JSONLDHash) && !linked.key?(v['@id'])
|
252
257
|
entity = v.dereference
|
data/lib/ro_crate/model/entry.rb
CHANGED
@@ -38,6 +38,12 @@ module ROCrate
|
|
38
38
|
::File.directory?(source) rescue false
|
39
39
|
end
|
40
40
|
|
41
|
+
##
|
42
|
+
# Does this Entry point to a symlink on the disk?
|
43
|
+
def symlink?
|
44
|
+
::File.symlink?(source) rescue false
|
45
|
+
end
|
46
|
+
|
41
47
|
##
|
42
48
|
# Does this Entry point to a remote resource?
|
43
49
|
def remote?
|
@@ -21,11 +21,17 @@ module ROCrate
|
|
21
21
|
end
|
22
22
|
|
23
23
|
##
|
24
|
-
# Does this RemoteEntry point to a directory
|
24
|
+
# Does this RemoteEntry point to a directory
|
25
25
|
def directory?
|
26
26
|
false
|
27
27
|
end
|
28
28
|
|
29
|
+
##
|
30
|
+
# Does this RemoteEntry point to a symlink
|
31
|
+
def symlink?
|
32
|
+
false
|
33
|
+
end
|
34
|
+
|
29
35
|
##
|
30
36
|
# Does this RemoteEntry point to a remote resource?
|
31
37
|
def remote?
|
data/lib/ro_crate/reader.rb
CHANGED
@@ -182,7 +182,7 @@ module ROCrate
|
|
182
182
|
crate.metadata.context = context
|
183
183
|
preview_properties = entity_hash.delete(ROCrate::Preview::IDENTIFIER)
|
184
184
|
preview_path = ::File.join(source, ROCrate::Preview::IDENTIFIER)
|
185
|
-
preview_path = ::File.
|
185
|
+
preview_path = ::File.exist?(preview_path) ? Pathname.new(preview_path) : nil
|
186
186
|
if preview_properties || preview_path
|
187
187
|
crate.preview = ROCrate::Preview.new(crate, preview_path, preview_properties || {})
|
188
188
|
end
|
data/lib/ro_crate/writer.rb
CHANGED
@@ -21,13 +21,17 @@ module ROCrate
|
|
21
21
|
next if !overwrite && ::File.exist?(fullpath)
|
22
22
|
next if entry.directory?
|
23
23
|
FileUtils.mkdir_p(::File.dirname(fullpath))
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
temp.
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
if entry.symlink?
|
25
|
+
::File.symlink(entry.source.readlink, fullpath)
|
26
|
+
else
|
27
|
+
temp = Tempfile.new('ro-crate-temp')
|
28
|
+
begin
|
29
|
+
entry.write_to(temp)
|
30
|
+
temp.close
|
31
|
+
FileUtils.mv(temp, fullpath)
|
32
|
+
ensure
|
33
|
+
temp.unlink
|
34
|
+
end
|
31
35
|
end
|
32
36
|
end
|
33
37
|
end
|
@@ -40,7 +44,11 @@ module ROCrate
|
|
40
44
|
Zip::File.open(destination, Zip::File::CREATE) do |zip|
|
41
45
|
@crate.payload.each do |path, entry|
|
42
46
|
next if entry.directory?
|
43
|
-
|
47
|
+
if entry.symlink?
|
48
|
+
zip.add(path, entry.path) if entry.path
|
49
|
+
else
|
50
|
+
zip.get_output_stream(path) { |s| entry.write_to(s) }
|
51
|
+
end
|
44
52
|
end
|
45
53
|
end
|
46
54
|
end
|
data/ro_crate.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'ro-crate'
|
3
|
-
s.version = '0.
|
3
|
+
s.version = '0.5.0'
|
4
4
|
s.summary = 'Create, manipulate, read RO-Crates.'
|
5
5
|
s.authors = ['Finn Bacall']
|
6
6
|
s.email = 'finn.bacall@manchester.ac.uk'
|
@@ -11,8 +11,9 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.add_runtime_dependency 'addressable', '>= 2.7', '< 2.9'
|
12
12
|
s.add_runtime_dependency 'rubyzip', '~> 2.0.0'
|
13
13
|
s.add_development_dependency 'rake', '~> 13.0.0'
|
14
|
-
s.add_development_dependency 'test-unit', '~> 3.
|
14
|
+
s.add_development_dependency 'test-unit', '~> 3.5.3'
|
15
15
|
s.add_development_dependency 'simplecov', '~> 0.21.2'
|
16
16
|
s.add_development_dependency 'yard', '~> 0.9.25'
|
17
17
|
s.add_development_dependency 'webmock', '~> 3.8.3'
|
18
|
+
s.add_development_dependency 'rexml', '~> 3.2.5'
|
18
19
|
end
|
data/test/crate_test.rb
CHANGED
@@ -171,7 +171,8 @@ class CrateTest < Test::Unit::TestCase
|
|
171
171
|
crate.author = bob
|
172
172
|
info.author = bob
|
173
173
|
|
174
|
-
|
174
|
+
assert_includes crate.contextual_entities, bob
|
175
|
+
assert_equal 1, crate.contextual_entities.length
|
175
176
|
assert_equal bob, info.author
|
176
177
|
assert_equal bob, crate.author
|
177
178
|
end
|
data/test/entity_test.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'test_helper'
|
2
3
|
|
3
4
|
class EntityTest < Test::Unit::TestCase
|
@@ -75,6 +76,7 @@ class EntityTest < Test::Unit::TestCase
|
|
75
76
|
assert_equal "#Hello%20World/Goodbye%20World", ROCrate::ContextualEntity.format_id('#Hello World/Goodbye World')
|
76
77
|
assert_equal "#Hello%20World/Goodbye%20World", ROCrate::ContextualEntity.format_id('Hello World/Goodbye World')
|
77
78
|
assert_equal "#%F0%9F%98%8A", ROCrate::ContextualEntity.format_id("😊")
|
79
|
+
assert_equal "https://orcid.org/0000-0002-0048-3300", ROCrate::ContextualEntity.format_id("https://orcid.org/0000-0002-0048-3300")
|
78
80
|
|
79
81
|
assert_equal "test123/hello.txt", ROCrate::File.format_id('./test123/hello.txt')
|
80
82
|
assert_equal "test123/hello.txt", ROCrate::File.format_id('./test123/hello.txt/')
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2021 Finn Bacall
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,151 @@
|
|
1
|
+
{
|
2
|
+
"a_galaxy_workflow": "true",
|
3
|
+
"annotation": "",
|
4
|
+
"creator": [
|
5
|
+
{
|
6
|
+
"class": "Person",
|
7
|
+
"identifier": "",
|
8
|
+
"name": "Finn Bacall"
|
9
|
+
}
|
10
|
+
],
|
11
|
+
"format-version": "0.1",
|
12
|
+
"license": "MIT",
|
13
|
+
"name": "Concat two files",
|
14
|
+
"steps": {
|
15
|
+
"0": {
|
16
|
+
"annotation": "",
|
17
|
+
"content_id": null,
|
18
|
+
"errors": null,
|
19
|
+
"id": 0,
|
20
|
+
"input_connections": {},
|
21
|
+
"inputs": [
|
22
|
+
{
|
23
|
+
"description": "",
|
24
|
+
"name": "input1"
|
25
|
+
}
|
26
|
+
],
|
27
|
+
"label": "input1",
|
28
|
+
"name": "Input dataset",
|
29
|
+
"outputs": [],
|
30
|
+
"position": {
|
31
|
+
"bottom": 254.1999969482422,
|
32
|
+
"height": 61.19999694824219,
|
33
|
+
"left": 393,
|
34
|
+
"right": 593,
|
35
|
+
"top": 193,
|
36
|
+
"width": 200,
|
37
|
+
"x": 393,
|
38
|
+
"y": 193
|
39
|
+
},
|
40
|
+
"tool_id": null,
|
41
|
+
"tool_state": "{\"optional\": false}",
|
42
|
+
"tool_version": null,
|
43
|
+
"type": "data_input",
|
44
|
+
"uuid": "7a90b91e-b143-4aa3-923d-fbcca5994d60",
|
45
|
+
"workflow_outputs": [
|
46
|
+
{
|
47
|
+
"label": null,
|
48
|
+
"output_name": "output",
|
49
|
+
"uuid": "1a510a60-afcc-4491-911b-3519da79f22d"
|
50
|
+
}
|
51
|
+
]
|
52
|
+
},
|
53
|
+
"1": {
|
54
|
+
"annotation": "",
|
55
|
+
"content_id": null,
|
56
|
+
"errors": null,
|
57
|
+
"id": 1,
|
58
|
+
"input_connections": {},
|
59
|
+
"inputs": [
|
60
|
+
{
|
61
|
+
"description": "",
|
62
|
+
"name": "input2"
|
63
|
+
}
|
64
|
+
],
|
65
|
+
"label": "input2",
|
66
|
+
"name": "Input dataset",
|
67
|
+
"outputs": [],
|
68
|
+
"position": {
|
69
|
+
"bottom": 374.1999969482422,
|
70
|
+
"height": 61.19999694824219,
|
71
|
+
"left": 393,
|
72
|
+
"right": 593,
|
73
|
+
"top": 313,
|
74
|
+
"width": 200,
|
75
|
+
"x": 393,
|
76
|
+
"y": 313
|
77
|
+
},
|
78
|
+
"tool_id": null,
|
79
|
+
"tool_state": "{\"optional\": false}",
|
80
|
+
"tool_version": null,
|
81
|
+
"type": "data_input",
|
82
|
+
"uuid": "baa13f22-7e0c-4533-b12c-7d31caf0c9b3",
|
83
|
+
"workflow_outputs": [
|
84
|
+
{
|
85
|
+
"label": null,
|
86
|
+
"output_name": "output",
|
87
|
+
"uuid": "1ded3ee7-d176-4385-8d1e-09b74af213fe"
|
88
|
+
}
|
89
|
+
]
|
90
|
+
},
|
91
|
+
"2": {
|
92
|
+
"annotation": "",
|
93
|
+
"content_id": "toolshed.g2.bx.psu.edu/repos/bgruening/text_processing/tp_cat/0.1.0",
|
94
|
+
"errors": null,
|
95
|
+
"id": 2,
|
96
|
+
"input_connections": {
|
97
|
+
"inputs": {
|
98
|
+
"id": 0,
|
99
|
+
"output_name": "output"
|
100
|
+
},
|
101
|
+
"queries_0|inputs2": {
|
102
|
+
"id": 1,
|
103
|
+
"output_name": "output"
|
104
|
+
}
|
105
|
+
},
|
106
|
+
"inputs": [],
|
107
|
+
"label": null,
|
108
|
+
"name": "Concatenate datasets",
|
109
|
+
"outputs": [
|
110
|
+
{
|
111
|
+
"name": "out_file1",
|
112
|
+
"type": "input"
|
113
|
+
}
|
114
|
+
],
|
115
|
+
"position": {
|
116
|
+
"bottom": 336.1999969482422,
|
117
|
+
"height": 143.1999969482422,
|
118
|
+
"left": 613,
|
119
|
+
"right": 813,
|
120
|
+
"top": 193,
|
121
|
+
"width": 200,
|
122
|
+
"x": 613,
|
123
|
+
"y": 193
|
124
|
+
},
|
125
|
+
"post_job_actions": {},
|
126
|
+
"tool_id": "toolshed.g2.bx.psu.edu/repos/bgruening/text_processing/tp_cat/0.1.0",
|
127
|
+
"tool_shed_repository": {
|
128
|
+
"changeset_revision": "ddf54b12c295",
|
129
|
+
"name": "text_processing",
|
130
|
+
"owner": "bgruening",
|
131
|
+
"tool_shed": "toolshed.g2.bx.psu.edu"
|
132
|
+
},
|
133
|
+
"tool_state": "{\"__input_ext\": \"txt\", \"chromInfo\": \"/opt/galaxy/tool-data/shared/ucsc/chrom/?.len\", \"inputs\": {\"__class__\": \"ConnectedValue\"}, \"queries\": [{\"__index__\": 0, \"inputs2\": {\"__class__\": \"ConnectedValue\"}}], \"__page__\": null, \"__rerun_remap_job_id__\": null}",
|
134
|
+
"tool_version": "0.1.0",
|
135
|
+
"type": "tool",
|
136
|
+
"uuid": "b2de7621-8ea3-4384-8f79-766ef38ebcfe",
|
137
|
+
"workflow_outputs": [
|
138
|
+
{
|
139
|
+
"label": null,
|
140
|
+
"output_name": "out_file1",
|
141
|
+
"uuid": "cba40c62-d9bd-49e0-b636-48cfab67c107"
|
142
|
+
}
|
143
|
+
]
|
144
|
+
}
|
145
|
+
},
|
146
|
+
"tags": [
|
147
|
+
"cat"
|
148
|
+
],
|
149
|
+
"uuid": "94a9a580-75d1-434f-b2af-02017de43e23",
|
150
|
+
"version": 1
|
151
|
+
}
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
../diagram.png
|
data/test/writer_test.rb
CHANGED
@@ -195,9 +195,36 @@ class WriterTest < Test::Unit::TestCase
|
|
195
195
|
Dir.mktmpdir do |dir|
|
196
196
|
ROCrate::Writer.new(crate).write(dir)
|
197
197
|
Dir.chdir(dir) do
|
198
|
-
|
199
|
-
|
198
|
+
file_list = Dir.glob('*').sort
|
199
|
+
assert_equal ["ro-crate-metadata.json", "ro-crate-preview.html"], file_list
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
test 'write crate with data entity refers to a symlink as directory' do
|
205
|
+
crate = ROCrate::Crate.new
|
206
|
+
crate.add_all(fixture_file('workflow-test-fixture-symlink').path)
|
207
|
+
assert crate.payload['images/workflow-diagram.png'].source.symlink?
|
208
|
+
|
209
|
+
Dir.mktmpdir do |dir|
|
210
|
+
ROCrate::Writer.new(crate).write(dir)
|
211
|
+
Dir.chdir(dir) do
|
212
|
+
assert File.symlink?('images/workflow-diagram.png')
|
213
|
+
end
|
200
214
|
end
|
215
|
+
end
|
216
|
+
|
217
|
+
test 'write crate with data entity refers to a symlink as zip' do
|
218
|
+
crate = ROCrate::Crate.new
|
219
|
+
crate.add_all(fixture_file('workflow-test-fixture-symlink').path)
|
220
|
+
assert crate.payload['images/workflow-diagram.png'].source.symlink?
|
221
|
+
|
222
|
+
Tempfile.create do |file|
|
223
|
+
ROCrate::Writer.new(crate).write_zip(file)
|
224
|
+
|
225
|
+
Zip::File.open(file) do |zipfile|
|
226
|
+
assert zipfile.find_entry('images/workflow-diagram.png').symlink?
|
227
|
+
end
|
201
228
|
end
|
202
229
|
end
|
203
230
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ro-crate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Finn Bacall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -64,14 +64,14 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 3.
|
67
|
+
version: 3.5.3
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 3.
|
74
|
+
version: 3.5.3
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: simplecov
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,6 +114,20 @@ dependencies:
|
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: 3.8.3
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: rexml
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 3.2.5
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 3.2.5
|
117
131
|
description:
|
118
132
|
email: finn.bacall@manchester.ac.uk
|
119
133
|
executables: []
|
@@ -2428,6 +2442,11 @@ files:
|
|
2428
2442
|
- test/fixtures/workflow-0.2.0/workflow/workflow.knime
|
2429
2443
|
- test/fixtures/workflow-0.2.0/workflow/workflow.svg
|
2430
2444
|
- test/fixtures/workflow-0.2.0/workflow/workflowset.meta
|
2445
|
+
- test/fixtures/workflow-test-fixture-symlink/LICENSE
|
2446
|
+
- test/fixtures/workflow-test-fixture-symlink/README.md
|
2447
|
+
- test/fixtures/workflow-test-fixture-symlink/concat_two_files.ga
|
2448
|
+
- test/fixtures/workflow-test-fixture-symlink/diagram.png
|
2449
|
+
- test/fixtures/workflow-test-fixture-symlink/images/workflow-diagram.png
|
2431
2450
|
- test/reader_test.rb
|
2432
2451
|
- test/test_helper.rb
|
2433
2452
|
- test/writer_test.rb
|
@@ -2450,7 +2469,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2450
2469
|
- !ruby/object:Gem::Version
|
2451
2470
|
version: '0'
|
2452
2471
|
requirements: []
|
2453
|
-
rubygems_version: 3.
|
2472
|
+
rubygems_version: 3.2.33
|
2454
2473
|
signing_key:
|
2455
2474
|
specification_version: 4
|
2456
2475
|
summary: Create, manipulate, read RO-Crates.
|