uwdc 0.0.4 → 0.0.5
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 +14 -2
- data/lib/uwdc/version.rb +1 -1
- data/spec/models/display_spec.rb +8 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWMzZWU4NTVhZWMyZTYxNTU4NWQxNWZkNWMxZGM0MDdkZTI3MDBjMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTQzMGU2MzBiYTJkNTBkYjZmOGY3ZTY3MTQ2OThlYjAwMmYwZmI5Mw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjI3NjhmMjdjMTQxYTYwMDNhOTM4NWEzYTgyOWQxNzI1OTM4MWI3NjJiM2Nj
|
10
|
+
NDVjZDcxYmE1MGJkNGRjODQ3OTdkMTA3YTVjMzA2NzdmYzRmMWMwYTZjODhi
|
11
|
+
ZTRlYjgxNGUxNGNlMDczZjFiODI0MGIzNjFlM2JhMTdjMTkyOGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTU0OTZlZTNiY2ZhMWMyNDExMjI5YWUzZDcwOGQ2NjRiNDRkNzNiYzcyOWNh
|
14
|
+
NThhYjczY2U3MGNlMmE3YTI1NDIyYmExODljNDQzOWU1ZDEzZjQ0ZmRkZDE1
|
15
|
+
YmQ1MjY4Y2ZiNTA4N2Y3ODhjMzIwMDNkMmVkZGExOWEzMDgyZDc=
|
data/lib/uwdc/display.rb
CHANGED
@@ -54,15 +54,27 @@ module UWDC
|
|
54
54
|
|
55
55
|
def images
|
56
56
|
viewable_models.inject({}) do |result, model|
|
57
|
-
|
58
|
-
|
57
|
+
unless image_files(model).empty?
|
58
|
+
result[model] = image_files(model)
|
59
|
+
result
|
60
|
+
end
|
59
61
|
end
|
60
62
|
end
|
61
63
|
|
62
64
|
def video
|
63
65
|
end
|
64
66
|
|
67
|
+
def audio_files(model)
|
68
|
+
files.select{|file| file.id.include?(model) && UWDC::Display.use[file.use][:partial] == "audio"}
|
69
|
+
end
|
70
|
+
|
65
71
|
def audio
|
72
|
+
viewable_models.inject({}) do |result, model|
|
73
|
+
unless audio_files(model).empty?
|
74
|
+
result[model] = audio_files(model)
|
75
|
+
result
|
76
|
+
end
|
77
|
+
end
|
66
78
|
end
|
67
79
|
|
68
80
|
def mods
|
data/lib/uwdc/version.rb
CHANGED
data/spec/models/display_spec.rb
CHANGED
@@ -32,6 +32,11 @@ describe UWDC::Display do
|
|
32
32
|
expect(@display.images.size).to eq(5)
|
33
33
|
end
|
34
34
|
|
35
|
+
it "should note include audio" do
|
36
|
+
puts @display.audio.inspect
|
37
|
+
expect(@display.audio).to be_false
|
38
|
+
end
|
39
|
+
|
35
40
|
it "should have metadata" do
|
36
41
|
expect(@display.metadata).to be_true
|
37
42
|
expect(@display.metadata).to be_an_instance_of(UWDC::Mods)
|
@@ -56,10 +61,9 @@ describe UWDC::Display do
|
|
56
61
|
@display = UWDC::Display.new(@id,@xml)
|
57
62
|
end
|
58
63
|
|
59
|
-
it "should
|
60
|
-
|
61
|
-
expect(@display.
|
62
|
-
expect(@display.images.size).to eq(0)
|
64
|
+
it "should include audio" do
|
65
|
+
expect(@display.audio).to be_true
|
66
|
+
expect(@display.audio.size).to eq(1)
|
63
67
|
end
|
64
68
|
end
|
65
69
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uwdc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Larson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|