uwdc 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/uwdc/display.rb +8 -16
- data/lib/uwdc/version.rb +1 -1
- data/spec/models/display_spec.rb +2 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjUwZjVmYjgxZTg5NzNiNTZhYThlNDA3YzgzOTQ3ZGZkMTVmYTMzMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MThkNGRkOTVmMTVlMjEzOGRkOTUxMTdiOWJlZWVhYjNjMzMzZDVjOA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDRhNzVmMDM4NTE3N2E3ZDIxZjA4NzRiNmVkY2VlMTg2OTYyNjU3NGMwZDEz
|
10
|
+
YWE5ZDcyY2ZhNjNlYTFhYjVjZDQ1OWFjZTMyNDQ1ODUzODg5OThhMWY5ZjRh
|
11
|
+
YjRkOWIzM2Q1YjhhM2U2NDgyZjY5NzVjYTM5YzNmMDdmMTA2Nzc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTNjM2ViOTg5YjdjZTVhMDMxOGYyMzhmYzQxMDg1MmY4ZWQwMGI3MGFlYmEy
|
14
|
+
OWQ0NzQ0NTI3YTNiNTU5Mzg1MzQyNDRjNjg0NjFlZTlhZTI5YWQzMWJlOGRm
|
15
|
+
Y2VjZmRiOTU5M2Q4MmFiYzczM2JlMzVjYWE5YzEwZjg2Mzc0YWU=
|
data/lib/uwdc/display.rb
CHANGED
@@ -48,32 +48,20 @@ module UWDC
|
|
48
48
|
@mets.file_sec.files
|
49
49
|
end
|
50
50
|
|
51
|
-
def image_files(model)
|
52
|
-
files.select{|file| file.id.include?(model) && UWDC::Display.use[file.use][:partial] == "image"}
|
53
|
-
end
|
54
|
-
|
55
51
|
def images
|
56
52
|
viewable_models.inject({}) do |result, model|
|
57
|
-
unless
|
58
|
-
|
59
|
-
result
|
60
|
-
end
|
53
|
+
result[model] = select_files(model, "image") unless select_files(model, "image").empty?
|
54
|
+
result
|
61
55
|
end
|
62
56
|
end
|
63
57
|
|
64
58
|
def video
|
65
59
|
end
|
66
60
|
|
67
|
-
def audio_files(model)
|
68
|
-
files.select{|file| file.id.include?(model) && UWDC::Display.use[file.use][:partial] == "audio"}
|
69
|
-
end
|
70
|
-
|
71
61
|
def audio
|
72
62
|
viewable_models.inject({}) do |result, model|
|
73
|
-
unless
|
74
|
-
|
75
|
-
result
|
76
|
-
end
|
63
|
+
result[model] = select_files(model, "audio") unless select_files(model, "audio").empty?
|
64
|
+
result
|
77
65
|
end
|
78
66
|
end
|
79
67
|
|
@@ -99,6 +87,10 @@ module UWDC
|
|
99
87
|
|
100
88
|
private
|
101
89
|
|
90
|
+
def select_files(model, partial)
|
91
|
+
files.select{|file| file.id.include?(model) && UWDC::Display.use[file.use][:partial] == partial}
|
92
|
+
end
|
93
|
+
|
102
94
|
def content_models
|
103
95
|
@mets.rels_ext.models
|
104
96
|
end
|
data/lib/uwdc/version.rb
CHANGED
data/spec/models/display_spec.rb
CHANGED
@@ -32,9 +32,8 @@ describe UWDC::Display do
|
|
32
32
|
expect(@display.images.size).to eq(5)
|
33
33
|
end
|
34
34
|
|
35
|
-
it "should
|
36
|
-
|
37
|
-
expect(@display.audio).to be_false
|
35
|
+
it "should not include audio" do
|
36
|
+
expect(@display.audio).to be_empty
|
38
37
|
end
|
39
38
|
|
40
39
|
it "should have metadata" do
|
@@ -43,14 +42,10 @@ describe UWDC::Display do
|
|
43
42
|
end
|
44
43
|
|
45
44
|
it "should have partials" do
|
46
|
-
#puts @display.partials.inspect
|
47
45
|
expect(@display.partials).to be_true
|
48
46
|
end
|
49
47
|
|
50
48
|
it "should have models" do
|
51
|
-
@display.partials.each do |div|
|
52
|
-
puts @display.models.select{|model| model.include?(clean_id(div.id))}
|
53
|
-
end
|
54
49
|
expect(@display.models).to be_true
|
55
50
|
end
|
56
51
|
end
|