sufia-models 6.0.0.rc1 → 6.0.0.rc2

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: b91961eb43dcfd1c29bfafc09c472ee106c6f44c
4
- data.tar.gz: 73a99ff722911ef488be5ecc5b6ee5c12a4d10df
3
+ metadata.gz: 61b522c3064c907375bcbad951e0878c3b692fac
4
+ data.tar.gz: a4074b935257278771c9e4808d8c8dd5c87ebc48
5
5
  SHA512:
6
- metadata.gz: bbd507e709ff276f2fbd63571b23c9ecb7b0ba006781a8851ae5cda68e2da671ab118137372763f6373fd9bcea4d4aa476b1e672a8213a4c29b9ac23d2f2fe36
7
- data.tar.gz: 08cf35ef184ec551b484a199a03accbfa281b8ff414f5d2202f82a2588a5dc684d5b33df2e7831bd2616e266e504845bcdb3abb99a772e7c534f156f65dc9a0f
6
+ metadata.gz: 73aacb00e97352fbaad299467c98ca52349d11b8070da097aa565403ebf46398e3550d97066b3242b56180d14b9604ef1ab76c6b5b1714cee03c3cec8789ad4b
7
+ data.tar.gz: 3ae78655ec6badec1106aeebe2833729591744c877bd1571ed87da3314dfa4fc49fff1f0637dd303f34661778996ea6b33dc129475d3aa0156dd4ce12aefaf54
@@ -44,7 +44,7 @@ module Sufia::User
44
44
  # 2. the orcid field is blank
45
45
  # 3. the orcid is already in its normalized form
46
46
  return if self.errors[:orcid].first.present? || self.orcid.blank? || self.orcid.starts_with?('http://orcid.org/')
47
- bare_orcid = /\d{4}-\d{4}-\d{4}-\d{4}/.match(self.orcid).string
47
+ bare_orcid = Sufia::OrcidValidator.match(self.orcid).string
48
48
  self.orcid = "http://orcid.org/#{bare_orcid}"
49
49
  end
50
50
 
@@ -2,7 +2,11 @@ module Sufia
2
2
  class OrcidValidator < ActiveModel::Validator
3
3
  def validate(record)
4
4
  return if record.orcid.blank?
5
- record.errors.add(:orcid, 'must be a string of 19 characters, e.g., "0000-0000-0000-0000"') unless /\d{4}-\d{4}-\d{4}-\d{4}/.match(record.orcid)
5
+ record.errors.add(:orcid, 'must be a string of 19 characters, e.g., "0000-0000-0000-0000"') unless self.class.match(record.orcid)
6
+ end
7
+
8
+ def self.match(string)
9
+ /\d{4}-\d{4}-\d{4}-\d{3}[\dX]/.match(string)
6
10
  end
7
11
  end
8
12
  end
@@ -1,5 +1,5 @@
1
1
  module Sufia
2
2
  module Models
3
- VERSION = "6.0.0.rc1"
3
+ VERSION = "6.0.0.rc2"
4
4
  end
5
5
  end
data/sufia-models.gemspec CHANGED
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
29
29
  spec.add_dependency 'rails', '~> 4.0', '< 5.0.0'
30
30
  spec.add_dependency 'activeresource', "~> 4.0" # No longer a dependency of rails 4.0
31
31
 
32
- spec.add_dependency "hydra-head", "~> 9.0.0.rc2"
33
- spec.add_dependency "active-fedora", "~> 9.0.0.rc2"
32
+ spec.add_dependency "hydra-head", "~> 9.0.0.rc3"
33
+ spec.add_dependency "active-fedora", "~> 9.0.0.rc3"
34
34
  spec.add_dependency "hydra-collections", "~> 4.0.0.rc2"
35
35
  spec.add_dependency 'hydra-derivatives', '~> 1.0.0.rc1'
36
36
  spec.add_dependency 'nest', '~> 1.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sufia-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.rc1
4
+ version: 6.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Friesen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-07 00:00:00.000000000 Z
11
+ date: 2015-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -78,28 +78,28 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 9.0.0.rc2
81
+ version: 9.0.0.rc3
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 9.0.0.rc2
88
+ version: 9.0.0.rc3
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: active-fedora
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: 9.0.0.rc2
95
+ version: 9.0.0.rc3
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: 9.0.0.rc2
102
+ version: 9.0.0.rc3
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: hydra-collections
105
105
  requirement: !ruby/object:Gem::Requirement