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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODcwNDk4ZDEyOTUxM2I4Nzg4MmJiNTU3OWRiZjUxZDg4Nzg3ZTZhNw==
4
+ OWMzZWU4NTVhZWMyZTYxNTU4NWQxNWZkNWMxZGM0MDdkZTI3MDBjMA==
5
5
  data.tar.gz: !binary |-
6
- YWJhMzdhM2EyYTQzNWI5YTA2NmZmNTE0MmQwNGY1YTk0ZDg2MmExOQ==
6
+ NTQzMGU2MzBiYTJkNTBkYjZmOGY3ZTY3MTQ2OThlYjAwMmYwZmI5Mw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZjNjYmIzMmJjYWJhN2RiYzVlMjQyNmIxM2ZhMTRkNDg4YjU4NDhkYjc2ZDdl
10
- YTM3ZGFlN2MxOTZmYTM5ZDExZWY5YmNiN2VlMTYwMzFlYTUwM2M1YjY1YTA4
11
- YmMzMTc1ZGMxZTNjM2E2ZGQ3NGQ0M2RhNzc5NGYzOTljMWZhYzM=
9
+ YjI3NjhmMjdjMTQxYTYwMDNhOTM4NWEzYTgyOWQxNzI1OTM4MWI3NjJiM2Nj
10
+ NDVjZDcxYmE1MGJkNGRjODQ3OTdkMTA3YTVjMzA2NzdmYzRmMWMwYTZjODhi
11
+ ZTRlYjgxNGUxNGNlMDczZjFiODI0MGIzNjFlM2JhMTdjMTkyOGE=
12
12
  data.tar.gz: !binary |-
13
- ODkzZTE4MTk3ZjkzMTQwOGYzMWQ2MmMwZWMwOWRjM2FjNzIxZmE2ZGMzMTFl
14
- ZjFlY2QwM2U1MTMyYTZhYjU4ZDBjMzk0MmRmZGRhOTlkNjIxOGQ0MWUzNzkw
15
- ZjI4OTNkYjBlZDU2OGE3OWM0ZjBhZjIzYzdmZTYwNzFjZTAyNWY=
13
+ ZTU0OTZlZTNiY2ZhMWMyNDExMjI5YWUzZDcwOGQ2NjRiNDRkNzNiYzcyOWNh
14
+ NThhYjczY2U3MGNlMmE3YTI1NDIyYmExODljNDQzOWU1ZDEzZjQ0ZmRkZDE1
15
+ YmQ1MjY4Y2ZiNTA4N2Y3ODhjMzIwMDNkMmVkZGExOWEzMDgyZDc=
@@ -54,15 +54,27 @@ module UWDC
54
54
 
55
55
  def images
56
56
  viewable_models.inject({}) do |result, model|
57
- result[model] = image_files(model)
58
- result
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
@@ -1,3 +1,3 @@
1
1
  module UWDC
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -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 have no images", pending: true do
60
- #puts @display.images.inspect
61
- expect(@display.images).to be_true
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
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-20 00:00:00.000000000 Z
11
+ date: 2013-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient