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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWMzZWU4NTVhZWMyZTYxNTU4NWQxNWZkNWMxZGM0MDdkZTI3MDBjMA==
4
+ ZjUwZjVmYjgxZTg5NzNiNTZhYThlNDA3YzgzOTQ3ZGZkMTVmYTMzMg==
5
5
  data.tar.gz: !binary |-
6
- NTQzMGU2MzBiYTJkNTBkYjZmOGY3ZTY3MTQ2OThlYjAwMmYwZmI5Mw==
6
+ MThkNGRkOTVmMTVlMjEzOGRkOTUxMTdiOWJlZWVhYjNjMzMzZDVjOA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YjI3NjhmMjdjMTQxYTYwMDNhOTM4NWEzYTgyOWQxNzI1OTM4MWI3NjJiM2Nj
10
- NDVjZDcxYmE1MGJkNGRjODQ3OTdkMTA3YTVjMzA2NzdmYzRmMWMwYTZjODhi
11
- ZTRlYjgxNGUxNGNlMDczZjFiODI0MGIzNjFlM2JhMTdjMTkyOGE=
9
+ NDRhNzVmMDM4NTE3N2E3ZDIxZjA4NzRiNmVkY2VlMTg2OTYyNjU3NGMwZDEz
10
+ YWE5ZDcyY2ZhNjNlYTFhYjVjZDQ1OWFjZTMyNDQ1ODUzODg5OThhMWY5ZjRh
11
+ YjRkOWIzM2Q1YjhhM2U2NDgyZjY5NzVjYTM5YzNmMDdmMTA2Nzc=
12
12
  data.tar.gz: !binary |-
13
- ZTU0OTZlZTNiY2ZhMWMyNDExMjI5YWUzZDcwOGQ2NjRiNDRkNzNiYzcyOWNh
14
- NThhYjczY2U3MGNlMmE3YTI1NDIyYmExODljNDQzOWU1ZDEzZjQ0ZmRkZDE1
15
- YmQ1MjY4Y2ZiNTA4N2Y3ODhjMzIwMDNkMmVkZGExOWEzMDgyZDc=
13
+ OTNjM2ViOTg5YjdjZTVhMDMxOGYyMzhmYzQxMDg1MmY4ZWQwMGI3MGFlYmEy
14
+ OWQ0NzQ0NTI3YTNiNTU5Mzg1MzQyNDRjNjg0NjFlZTlhZTI5YWQzMWJlOGRm
15
+ Y2VjZmRiOTU5M2Q4MmFiYzczM2JlMzVjYWE5YzEwZjg2Mzc0YWU=
@@ -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 image_files(model).empty?
58
- result[model] = image_files(model)
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 audio_files(model).empty?
74
- result[model] = audio_files(model)
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
@@ -1,3 +1,3 @@
1
1
  module UWDC
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -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 note include audio" do
36
- puts @display.audio.inspect
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uwdc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Larson