cul_scv_hydra 0.18.1 → 0.18.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ce098a5ce4d4651bbaa8d60871fc133cdf24338
4
- data.tar.gz: 7edd645f799a066138c6dc80c027114a19843999
3
+ metadata.gz: 8a1f95f27c9815b98f9bbe434c0cbacfd8088596
4
+ data.tar.gz: 8fc95376596dcb379c2ee4d4bdb5699e3925932f
5
5
  SHA512:
6
- metadata.gz: 15add650218928b7e8ac209ecf51557f4ff23b01f3cd8888e9e53d305b91e399b3b47064ea9847fe81f1fdcc1c226aacc6cda7b96aea8dff27ec0e4102fd0086
7
- data.tar.gz: c7bd33e0cc1853a628a14b528a4271af98b4eb3af2e29f5d84eb9d562f063674ec61d7f0050d125a10fdd131a7f61041413dc1a292c5832a25df1c2d49323bdd
6
+ metadata.gz: 33a7f2aeea4b0e7f64e60f741563ee968c3c1ea80a2a41ebcee43b8be4ec60f9c8eb52925993ab327157f9cf1cc8806117ff765b07e2cdd58ff7108434a83f8e
7
+ data.tar.gz: bb97ea65500960d7d6ff4ca4a5851b4733dc723cb82260da480e4a1b6208d7f7fe1ab88f293574809d8c7f57672f89da26db1a5a4353102a99c98de5909ba0e9
@@ -94,7 +94,8 @@ class GenericResource < ::ActiveFedora::Base
94
94
  rels.each do |dsuri, props|
95
95
  if dsuri =~ /\/content$/ or not props[FORMAT_OF_PREDICATE].blank?
96
96
  dsid = dsuri.split('/')[-1]
97
- res = datastream_as_resource(dsid, props)
97
+ puts props.inspect
98
+ res = datastream_as_resource(dsid, props.with_indifferent_access)
98
99
  results << res
99
100
  end
100
101
  end
@@ -113,10 +114,10 @@ class GenericResource < ::ActiveFedora::Base
113
114
  width_rel = rels_int.relationships(dsuri, :image_width)[0]
114
115
  length_rel = rels_int.relationships(dsuri, :image_length)[0]
115
116
  extent_rel = rels_int.relationships(dsuri, :extent)[0]
116
- props = {EXTENT_PREDICATE => [], WIDTH_PREDICATE => [], LENGTH_PREDICATE => []}
117
- props[EXTENT_PREDICATE] << extent_rel.object.to_s unless extent_rel.blank?
118
- props[WIDTH_PREDICATE] << width_rel.object.to_s unless width_rel.blank?
119
- props[LENGTH_PREDICATE] << length_rel.object.to_s unless length_rel.blank?
117
+ props = {extent: [], image_width: [], image_length: []}
118
+ props[:extent] << extent_rel.object.to_s unless extent_rel.blank?
119
+ props[:image_width] << width_rel.object.to_s unless width_rel.blank?
120
+ props[:image_length] << length_rel.object.to_s unless length_rel.blank?
120
121
  results << datastream_as_resource(dsid, props)
121
122
  end
122
123
  end
@@ -124,7 +125,7 @@ class GenericResource < ::ActiveFedora::Base
124
125
  end
125
126
 
126
127
  def zooming?
127
- !rels_int.relationships(datastreams['content'], :foaf_zooming).first.blank?
128
+ (zr = rels_int.relationships(datastreams['content'], :foaf_zooming) and not zr.first.blank?)
128
129
  end
129
130
 
130
131
  private
@@ -137,12 +138,12 @@ class GenericResource < ::ActiveFedora::Base
137
138
  res[:mime_type] = ds.mimeType
138
139
  res[:content_models] = ["Datastream"]
139
140
  res[:file_size] = ds.dsSize.to_s
140
- if res[:file_size] == "0" and props[EXTENT_PREDICATE]
141
- res[:file_size] = (props[EXTENT_PREDICATE].first || "0")
141
+ if res[:file_size] == "0" and props[:extent]
142
+ res[:file_size] = (props[:extent].first || "0")
142
143
  end
143
144
  res[:size] = (res[:file_size].to_i / 1024).to_s + " Kb"
144
- res[:width] = props[WIDTH_PREDICATE].first || "0"
145
- res[:height] = props[LENGTH_PREDICATE].first || "0"
145
+ res[:width] = (props[:image_width] and props[:image_width].first) || "0"
146
+ res[:height] = (props[:image_length] and props[:image_length].first) || "0"
146
147
  res[:dimensions] = "#{res[:width]} x #{res[:height]}"
147
148
  base_filename = pid.gsub(/\:/,"")
148
149
  res[:filename] = base_filename + "." + dsid + "." + ds.mimeType.gsub(/^[^\/]+\//,"")
@@ -2,7 +2,7 @@
2
2
  module Cul
3
3
  module Scv
4
4
  module Hydra
5
- VERSION = '0.18.1'
5
+ VERSION = '0.18.2'
6
6
  def self.version
7
7
  VERSION
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cul_scv_hydra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.1
4
+ version: 0.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Armintor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-30 00:00:00.000000000 Z
11
+ date: 2014-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blacklight