active-fedora 11.0.0 → 11.0.1

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: 1a3e4470dd33d72dc20a0794fd42e8a08d96363f
4
- data.tar.gz: 9e7b438a6b8a23515de79c50b3f44dc2df2a6d3f
3
+ metadata.gz: 16ead45129d9f2be4aa17bde6a13d62a1079cf31
4
+ data.tar.gz: ae8fb524751ba62d38fe12f0f4b3953efaf2a4e1
5
5
  SHA512:
6
- metadata.gz: f86db04efd279c3412c1e57fa8449f7fbef3ac6cb83143314b573edaf559dfca3bc0bab762ada09c87c0f86759aea537f812bd194c3361f8adbea78385abbfe3
7
- data.tar.gz: fd864a26944cc8e5ca33b313a1a2544dcfa965e46005a16c6a4833755f85e82ab349e36470347c02eef601b979213c3877c2691153a41c81429595337dc68ead
6
+ metadata.gz: f043c0eabd5bc35f273e2d479d01edf61afc4d5987ac3c48eef8fd58eae863f5901d87192fea088c2e4d0c6d0abe6bf93931c8fab2fb80b5d443f870575bc625
7
+ data.tar.gz: f2eff2fb6b5d014e6c6ec7a1f97cb4dd152ee92218526040bc78a6fbe53463018b15009d620677fefe29e6aef9183d882f6f4a818a89e725578523a0e38760ac
@@ -138,7 +138,7 @@ module ActiveFedora
138
138
  def warn_duplicate_predicates(new_name, new_properties)
139
139
  new_predicate = new_properties[:predicate]
140
140
  properties.select { |_k, existing| existing.predicate == new_predicate }.each do |key, _value|
141
- ActiveFedora::Base.logger.warn "Same predicate (#{new_predicate}) used for properties #{key} and #{new_name}"
141
+ ActiveFedora::Base.logger.warn "Same predicate (#{new_predicate}) used for properties #{key} and #{new_name}" if ActiveFedora::Base.logger
142
142
  end
143
143
  end
144
144
 
@@ -86,7 +86,7 @@ module ActiveFedora
86
86
 
87
87
  def validate_options
88
88
  unless host.downcase.end_with?("/rest")
89
- ActiveFedora::Base.logger.warn "Fedora URL (#{host}) does not end with /rest. This could be a problem. Check your fedora.yml config"
89
+ ActiveFedora::Base.logger.warn "Fedora URL (#{host}) does not end with /rest. This could be a problem. Check your fedora.yml config" if ActiveFedora::Base.logger
90
90
  end
91
91
  end
92
92
  end
@@ -176,7 +176,7 @@ module ActiveFedora
176
176
  def property_reflection(attribute_name)
177
177
  self.class.reflect_on_property(attribute_name)
178
178
  rescue ActiveTriples::UndefinedPropertyError
179
- ActiveFedora::Base.logger.info "Undefined property #{attribute_name} reflected."
179
+ ActiveFedora::Base.logger.info "Undefined property #{attribute_name} reflected." if ActiveFedora::Base.logger
180
180
  nil
181
181
  end
182
182
 
@@ -7,5 +7,6 @@ module ActiveFedora
7
7
  autoload :ProjectHydra
8
8
  autoload :FieldMap
9
9
  autoload :FieldMapEntry
10
+ autoload :ValueCaster
10
11
  end
11
12
  end
@@ -22,5 +22,11 @@ module ActiveFedora::RDF
22
22
  self.behaviors.uniq!
23
23
  self.values += values
24
24
  end
25
+
26
+ def values
27
+ @values.map do |value|
28
+ ValueCaster.new(value).value
29
+ end
30
+ end
25
31
  end
26
32
  end
@@ -0,0 +1,15 @@
1
+ module ActiveFedora::RDF
2
+ class ValueCaster
3
+ def initialize(value)
4
+ @value = value
5
+ end
6
+
7
+ def value
8
+ if @value.respond_to?(:language) # Cast RDF::Literals
9
+ @value.to_s
10
+ else
11
+ @value
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "11.0.0".freeze
2
+ VERSION = "11.0.1".freeze
3
3
  end
@@ -20,7 +20,7 @@ describe ActiveFedora::RDF::IndexingService do
20
20
  MyObj.new.tap do |obj|
21
21
  obj.created = [Date.parse("2012-03-04")]
22
22
  obj.title = ["Of Mice and Men, The Sequel"]
23
- obj.publisher = ["Bob's Blogtastic Publishing"]
23
+ obj.publisher = [RDF::Literal.new("Bob's Blogtastic Publishing", language: :fr)]
24
24
  obj.based_near = ["Tacoma, WA", "Renton, WA"]
25
25
  obj.related_url = ["http://example.org/blogtastic/"]
26
26
  obj.rights = ["Totally open, y'all"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-fedora
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.0.0
4
+ version: 11.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zumwalt
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-09-13 00:00:00.000000000 Z
13
+ date: 2016-09-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr
@@ -456,6 +456,7 @@ files:
456
456
  - lib/active_fedora/rdf/indexing_service.rb
457
457
  - lib/active_fedora/rdf/persistence.rb
458
458
  - lib/active_fedora/rdf/project_hydra.rb
459
+ - lib/active_fedora/rdf/value_caster.rb
459
460
  - lib/active_fedora/reflection.rb
460
461
  - lib/active_fedora/relation.rb
461
462
  - lib/active_fedora/relation/calculations.rb