valkyrie 2.0.0 → 2.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
  SHA256:
3
- metadata.gz: f944c9582622daf4bc0eddee8290ae57a7bf43f01d38c261814a8668cce8f4bb
4
- data.tar.gz: 3ab12ff9a09532f59f6cc635c01d40283eb3a63ed6d0bca2f1a78d118524c0a9
3
+ metadata.gz: e1b458c0bf12323ee7593ba335f9b11d933bbf3bc8e2dd1174f2a682e0be10c7
4
+ data.tar.gz: 59ec4d50795fa715b260fd77b773a4113d90731ae12719d8ed35d494f600f056
5
5
  SHA512:
6
- metadata.gz: 15bfe465aa9152f3a9fb9b6eaf5d40ce86e1e024c937bc9062a5ab421d23f5f8b05b29f1ab22a869ceb5f800f6f217cbdea443b5b34fee7330720ae702c052db
7
- data.tar.gz: a2d61190c00329845a913a7f571a19549a0b0d39f9ab2654212789d16f2db212aff67f5e8a10bdf1cf1843c5e5d9bad4c604359954b5821ba06610eceed49866
6
+ metadata.gz: 9625fb7adb62fd504dde9e216a4b86b10c3054258f3363eb717da22e5bd1a81c8dc72608022739311a5b914528d9ac045dd66063148ec58da1de63e5cda08575
7
+ data.tar.gz: 4692ea78e86c4a8a74ddbea67c2b74660f7c7a2f4d69efd0c6755f6f2ba9258620eeaa7d03f1455b24a81e4c61dff5533f47072db6f9945eff92d1779696df6e
@@ -1,3 +1,18 @@
1
+ # v2.0.1 2019-07-03
2
+
3
+ ## Changes since last release
4
+
5
+ * Remove strftime from `Fedora::Persister::ModelConverter`
6
+ [tpendragon](https://github.com/tpendragon)
7
+ * Only parse ISO8601 strings into DateTimes
8
+ [awead](https://github.com/awead)
9
+
10
+
11
+ Additional thanks to the following for code review and issue reports leading to
12
+ this release:
13
+
14
+ [dgcliff](https://github.com/dgcliff)
15
+
1
16
  # v2.0.0 2019-06-06
2
17
 
3
18
  ## Changes since last release
@@ -488,10 +488,9 @@ module Valkyrie::Persistence::Fedora
488
488
  # @return [Valkyrie::Persistence::Fedora::Persister::ModelConverter::Property]
489
489
  def result
490
490
  # cast it to datetime for storage, to preserve milliseconds and date
491
- # @todo Remove strftime when https://github.com/ruby-rdf/rdf/issues/394 is closed.
492
491
  map_value(converted_value:
493
492
  RDF::Literal.new(
494
- value.value.to_datetime.strftime("%Y-%m-%dT%H:%M:%S.%N%z"),
493
+ value.value.to_datetime,
495
494
  datatype: PermissiveSchema.valkyrie_time
496
495
  ))
497
496
  end
@@ -137,15 +137,17 @@ module Valkyrie::Persistence::Shared
137
137
  # e. g. 1970-01-01
138
138
  # @param [Object] value
139
139
  # @return [Boolean]
140
+ # rubocop:disable Metrics/CyclomaticComplexity
140
141
  def self.handles?(value)
141
142
  return false unless value.is_a?(String)
142
- return false unless value[4] == "-"
143
+ return false unless value[4] == "-" && value[10] == "T"
143
144
  year = value.to_s[0..3]
144
145
  return false unless year.length == 4 && year.to_i.to_s == year
145
146
  DateTime.iso8601(value)
146
147
  rescue
147
148
  false
148
149
  end
150
+ # rubocop:enable Metrics/CyclomaticComplexity
149
151
 
150
152
  # Generates a Time object in the UTC from the datestamp string value
151
153
  # @return [Time]
@@ -7,6 +7,7 @@ RSpec.shared_examples 'a Valkyrie::Persister' do |*flags|
7
7
  include Valkyrie::Resource::AccessControls
8
8
  attribute :title
9
9
  attribute :author
10
+ attribute :other_author
10
11
  attribute :member_ids
11
12
  attribute :nested_resource
12
13
  attribute :single_value, Valkyrie::Types::String.optional
@@ -179,7 +180,8 @@ RSpec.shared_examples 'a Valkyrie::Persister' do |*flags|
179
180
  it "can store DateTimes" do
180
181
  time1 = DateTime.current
181
182
  time2 = Time.current.in_time_zone
182
- book = persister.save(resource: resource_class.new(title: [time1], author: [time2]))
183
+ time3 = "2019-01"
184
+ book = persister.save(resource: resource_class.new(title: [time1], author: [time2], other_author: [time3]))
183
185
 
184
186
  reloaded = query_service.find_by(id: book.id)
185
187
 
@@ -187,6 +189,7 @@ RSpec.shared_examples 'a Valkyrie::Persister' do |*flags|
187
189
  expect(reloaded.title.first.zone).to eq('UTC')
188
190
  expect(reloaded.author.first.to_i).to eq(time2.to_i)
189
191
  expect(reloaded.author.first.zone).to eq('UTC')
192
+ expect(reloaded.other_author.first).to eq "2019-01"
190
193
  end
191
194
 
192
195
  it "can store Floats" do
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Valkyrie
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'draper'
25
25
  spec.add_dependency 'activemodel'
26
26
  spec.add_dependency 'dry-types', '~> 1.0'
27
- spec.add_dependency 'rdf'
27
+ spec.add_dependency 'rdf', '~> 3.0.10'
28
28
  spec.add_dependency 'activesupport'
29
29
  spec.add_dependency 'railties' # To use generators and engines
30
30
  spec.add_dependency 'reform'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valkyrie
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trey Pendragon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-20 00:00:00.000000000 Z
11
+ date: 2019-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: rdf
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 3.0.10
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 3.0.10
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: activesupport
85
85
  requirement: !ruby/object:Gem::Requirement