active_fedora-datastreams 0.3.0 → 0.5.0

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: 046d91b4b339d4a8d607e9661bb0f65920aef226fab2e4501a924b7b5ed24791
4
- data.tar.gz: 9a042abf3bd4b1362e867b8a2ab306cd874bb7e7c2a7b27ec647a394d704d352
3
+ metadata.gz: de7b2795b6188560ce51fefd0dc438041abe196f5955ac4d91a5a3a40de97049
4
+ data.tar.gz: adc5f9a68f7b5706e229ada269b7e10a46f5968cc9910c6b4937bba304104b97
5
5
  SHA512:
6
- metadata.gz: 47c79389f4c376ed9fcad0aaa14099c9e1b2b8d4908e0b2c8b31daa57910e064778a6b5a504b49234e554666c089e51af714241eecd172f4ab737eb502418aad
7
- data.tar.gz: 54f1923d8a551b984e170f2e2128e418794486d4c4021861ef964ad4d1d5ae4690048b3f79e567a4bb1b9a5bb1d6147b0c595a5b859e5c278313ca6037cb00ab
6
+ metadata.gz: 9c94dd7b0b5a68467a7861535fdf01b2ce4b1ec0726e83c730ff409500f03c079038b036438aa18b1d83514f1f6457a3c0eb995df4e203f60596b34dfcb3cf20
7
+ data.tar.gz: 691000ced9706509f8dc720e08bc7bd7362b659d9da7d70f792d4215c67b2bf49330a02d73c80559c6cff41731d9f70f73fe043178445a17213813ccbbc2cfc9
data/.circleci/config.yml CHANGED
@@ -8,7 +8,7 @@ jobs:
8
8
  type: string
9
9
  bundler_version:
10
10
  type: string
11
- default: 2.0.1
11
+ default: 2.4.5
12
12
  rails_version:
13
13
  type: string
14
14
  solr_port:
@@ -49,19 +49,26 @@ workflows:
49
49
  ci:
50
50
  jobs:
51
51
  - bundle_lint_test:
52
- name: ruby2-7_rails5-2
53
- ruby_version: 2.7.4
54
- rails_version: 5.2.6
52
+ name: ruby3-2_rails7-0
53
+ ruby_version: 3.2.0
54
+ rails_version: 7.0.4.2
55
55
  - bundle_lint_test:
56
- name: ruby2-6_rails5-2
57
- ruby_version: 2.6.8
58
- rails_version: 5.2.6
56
+ name: ruby3-2_rails6-1
57
+ ruby_version: 3.2.0
58
+ rails_version: 6.1.7.2
59
59
  - bundle_lint_test:
60
- name: ruby2-5_rails5-2
61
- ruby_version: 2.5.9
62
- rails_version: 5.2.6
60
+ name: ruby3-1_rails6-0
61
+ ruby_version: 3.1.3
62
+ rails_version: 6.0.6.1
63
63
  - bundle_lint_test:
64
- name: ruby2-4_rails5-2
65
- ruby_version: 2.4.10
66
- rails_version: 5.2.6
67
-
64
+ name: ruby3-0_rails6-0
65
+ ruby_version: 3.0.5
66
+ rails_version: 6.0.6.1
67
+ - bundle_lint_test:
68
+ name: ruby2-7_rails6-0
69
+ ruby_version: 2.7.7
70
+ rails_version: 6.0.6.1
71
+ - bundle_lint_test:
72
+ name: ruby2-7_rails5-2
73
+ ruby_version: 2.7.7
74
+ rails_version: 5.2.8.1
data/.rubocop.yml CHANGED
@@ -1,13 +1,14 @@
1
+ inherit_gem:
2
+ bixby: bixby_default.yml
3
+
1
4
  AllCops:
2
- TargetRubyVersion: 2.2
5
+ TargetRubyVersion: 2.6
3
6
  DisplayCopNames: true
4
- Include:
5
- - '**/Rakefile'
6
7
  Exclude:
7
8
  - 'script/**/*'
8
9
  - 'vendor/**/*'
9
10
 
10
- Lint/HandleExceptions:
11
+ Lint/SuppressedException:
11
12
  Exclude:
12
13
  - 'spec/unit/**/*'
13
14
  - 'spec/integration/**/*'
@@ -15,7 +16,7 @@ Lint/HandleExceptions:
15
16
  Lint/AssignmentInCondition:
16
17
  Enabled: false
17
18
 
18
- Metrics/LineLength:
19
+ Layout/LineLength:
19
20
  Enabled: false
20
21
 
21
22
  Metrics/AbcSize:
@@ -38,7 +39,7 @@ Metrics/ClassLength:
38
39
  Metrics/MethodLength:
39
40
  Enabled: false
40
41
 
41
- Style/PredicateName:
42
+ Naming/PredicateName:
42
43
  Exclude:
43
44
  - 'lib/active_fedora/om_datastream.rb'
44
45
 
@@ -46,11 +47,14 @@ Style/BlockDelimiters:
46
47
  Exclude:
47
48
  - 'spec/**/*'
48
49
 
49
- Style/BlockEndNewline:
50
+ Style/FrozenStringLiteralComment:
51
+ Enabled: false
52
+
53
+ Layout/BlockEndNewline:
50
54
  Exclude:
51
55
  - 'spec/**/*'
52
56
 
53
- Style/MultilineBlockLayout:
57
+ Layout/MultilineBlockLayout:
54
58
  Exclude:
55
59
  - 'spec/**/*'
56
60
 
@@ -62,12 +66,12 @@ Style/Lambda:
62
66
  Exclude:
63
67
  - 'spec/**/*'
64
68
 
65
- Style/FileName:
69
+ Naming/FileName:
66
70
  Exclude:
67
71
  - 'spec/samples/hydra-mods_article_datastream.rb'
68
72
 
69
- Style/IndentationConsistency:
70
- EnforcedStyle: rails
73
+ Layout/IndentationConsistency:
74
+ EnforcedStyle: indented_internal_methods
71
75
 
72
76
  Style/CollectionMethods:
73
77
  PreferredMethods:
@@ -105,10 +109,7 @@ Style/SignalException:
105
109
  Rails:
106
110
  Enabled: true
107
111
 
108
- Rails/Date:
109
- Enabled: false
110
-
111
- Rails/TimeZone:
112
+ Rails/RakeEnvironment:
112
113
  Enabled: false
113
114
 
114
115
  RSpec/AnyInstance:
@@ -137,4 +138,4 @@ RSpec/NotToNot:
137
138
  Enabled: false
138
139
 
139
140
  RSpec/ExampleLength:
140
- Enabled: false
141
+ Enabled: false
data/Gemfile CHANGED
@@ -1,6 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activemodel', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
4
+ gem 'om', git: 'https://github.com/avalonmediasystem/om.git', branch: 'ruby3'
4
5
 
5
6
  # Specify your gem's dependencies in active_fedora-datastreams.gemspec
6
7
  gemspec
@@ -9,28 +9,28 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Justin Coyne"]
10
10
  spec.email = ["jcoyne@justincoyne.com"]
11
11
 
12
- spec.summary = %q{Datastreams for ActiveFedora}
13
- spec.description = %q{XML and RDF datastreams for ActiveFedora}
12
+ spec.summary = 'Datastreams for ActiveFedora'
13
+ spec.description = 'XML and RDF datastreams for ActiveFedora'
14
14
  spec.homepage = "https://github.com/projecthydra-labs/active_fedora-datastreams"
15
15
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
16
  spec.bindir = "exe"
17
17
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "active-fedora", ">= 11.0.0.pre", "< 14"
21
- spec.add_dependency "activemodel", "< 6.0" # Pin this because there are test failures with rails 6.1
20
+ spec.add_dependency "active-fedora", ">= 11.0.0.pre"
21
+ spec.add_dependency "activemodel", ">= 5.2"
22
22
  spec.add_dependency "om", "~> 3.1"
23
23
  spec.add_dependency "nom-xml", ">= 0.5.1"
24
- spec.add_dependency "rdf-rdfxml", '~> 2.0'
25
- spec.add_dependency "rdf", "< 3.2" # Pin this to avoid a breaking change introduced in 3.2.0
26
- spec.add_development_dependency "rake", "~> 10.0"
27
- spec.add_development_dependency "rspec", "~> 3.0"
28
- spec.add_development_dependency 'rspec_junit_formatter'
24
+ spec.add_dependency "rdf-rdfxml", '~> 3.2'
25
+ spec.add_dependency "rdf", "~> 3.2"
26
+ spec.add_development_dependency "bixby"
27
+ spec.add_development_dependency "byebug"
29
28
  spec.add_development_dependency 'coveralls'
30
- spec.add_development_dependency 'simplecov'
31
- spec.add_development_dependency "solr_wrapper", "~> 2.1"
32
- spec.add_development_dependency 'fcrepo_wrapper', '~> 0.9'
33
- spec.add_development_dependency "rubocop", '~> 0.42'
34
- spec.add_development_dependency "rubocop-rspec", '~> 1.4'
35
29
  spec.add_development_dependency "equivalent-xml"
30
+ spec.add_development_dependency 'fcrepo_wrapper'
31
+ spec.add_development_dependency "rake"
32
+ spec.add_development_dependency "rspec"
33
+ spec.add_development_dependency 'rspec_junit_formatter'
34
+ spec.add_development_dependency 'simplecov'
35
+ spec.add_development_dependency "solr_wrapper"
36
36
  end
@@ -50,16 +50,16 @@ module ActiveFedora
50
50
 
51
51
  # don't want content eagerly loaded by proxy, so implementing methods that would be implemented by define_attribute_methods
52
52
  def ng_xml_will_change!
53
- attributes_changed_by_setter['ng_xml'] = nil
53
+ attribute_will_change!("ng_xml")
54
54
  end
55
55
 
56
56
  def ng_xml_doesnt_change!
57
- attributes_changed_by_setter.delete('ng_xml')
57
+ clear_attribute_changes("ng_xml")
58
58
  end
59
59
 
60
60
  # don't want content eagerly loaded by proxy, so implementing methods that would be implemented by define_attribute_methods
61
61
  def ng_xml_changed?
62
- attributes_changed_by_setter.key? 'ng_xml'
62
+ changed_attributes.include?("ng_xml")
63
63
  end
64
64
 
65
65
  def remote_content
@@ -108,7 +108,7 @@ module ActiveFedora
108
108
  end
109
109
 
110
110
  def autocreate?
111
- attributes_changed_by_setter.key? :profile
111
+ changed_attributes.include? :profile
112
112
  end
113
113
 
114
114
  def xml_loaded
@@ -1,5 +1,5 @@
1
1
  module ActiveFedora
2
2
  module Datastreams
3
- VERSION = "0.3.0".freeze
3
+ VERSION = "0.5.0".freeze
4
4
  end
5
5
  end
@@ -59,15 +59,13 @@ module ActiveFedora
59
59
  # </mods:name>
60
60
  # </mods>
61
61
  def update_indexed_attributes(params = {}, _opts = {})
62
- if self.class.terminology.nil?
63
- raise "No terminology is set for this OmDatastream class. Cannot perform update_indexed_attributes"
64
- end
62
+ raise "No terminology is set for this OmDatastream class. Cannot perform update_indexed_attributes" if self.class.terminology.nil?
65
63
  # remove any fields from params that this datastream doesn't recognize
66
64
  # make sure to make a copy of params so not to modify hash that might be passed to other methods
67
65
  current_params = params.clone
68
66
  current_params.delete_if do |term_pointer, new_values|
69
67
  if term_pointer.is_a?(String)
70
- ActiveFedora::Base.logger.warn "WARNING: #{self.class.name} ignoring {#{term_pointer.inspect} => #{new_values.inspect}} because #{term_pointer.inspect} is a String (only valid OM Term Pointers will be used). Make sure your html has the correct field_selector tags in it." if ActiveFedora::Base.logger
68
+ ActiveFedora::Base.logger&.warn "WARNING: #{self.class.name} ignoring {#{term_pointer.inspect} => #{new_values.inspect}} because #{term_pointer.inspect} is a String (only valid OM Term Pointers will be used). Make sure your html has the correct field_selector tags in it."
71
69
  true
72
70
  else
73
71
  !self.class.terminology.has_term?(*OM.destringify(term_pointer))
@@ -47,7 +47,7 @@ module ActiveFedora
47
47
 
48
48
  before_save do
49
49
  if content.blank?
50
- ActiveFedora::Base.logger.warn "Cowardly refusing to save a datastream with empty content: #{inspect}" if ActiveFedora::Base.logger
50
+ ActiveFedora::Base.logger&.warn "Cowardly refusing to save a datastream with empty content: #{inspect}"
51
51
  if ActiveSupport.respond_to?(:halt_callback_chains_on_return_false)
52
52
  # For Rails 5+
53
53
  throw :abort
@@ -110,7 +110,7 @@ module ActiveFedora
110
110
  predicate: config.predicate,
111
111
  class_name: config.class_name)
112
112
  end
113
- klass.accepts_nested_attributes_for(*nested_attributes_options.keys) unless nested_attributes_options.blank?
113
+ klass.accepts_nested_attributes_for(*nested_attributes_options.keys) if nested_attributes_options.present?
114
114
  uri_stub = self.class.rdf_subject.call(self)
115
115
 
116
116
  r = klass.new(uri_stub)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_fedora-datastreams
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-04 00:00:00.000000000 Z
11
+ date: 2023-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active-fedora
@@ -17,9 +17,6 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 11.0.0.pre
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '14'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,23 +24,20 @@ dependencies:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 11.0.0.pre
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '14'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: activemodel
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
- - - "<"
31
+ - - ">="
38
32
  - !ruby/object:Gem::Version
39
- version: '6.0'
33
+ version: '5.2'
40
34
  type: :runtime
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
- - - "<"
38
+ - - ">="
45
39
  - !ruby/object:Gem::Version
46
- version: '6.0'
40
+ version: '5.2'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: om
49
43
  requirement: !ruby/object:Gem::Requirement
@@ -78,58 +72,58 @@ dependencies:
78
72
  requirements:
79
73
  - - "~>"
80
74
  - !ruby/object:Gem::Version
81
- version: '2.0'
75
+ version: '3.2'
82
76
  type: :runtime
83
77
  prerelease: false
84
78
  version_requirements: !ruby/object:Gem::Requirement
85
79
  requirements:
86
80
  - - "~>"
87
81
  - !ruby/object:Gem::Version
88
- version: '2.0'
82
+ version: '3.2'
89
83
  - !ruby/object:Gem::Dependency
90
84
  name: rdf
91
85
  requirement: !ruby/object:Gem::Requirement
92
86
  requirements:
93
- - - "<"
87
+ - - "~>"
94
88
  - !ruby/object:Gem::Version
95
89
  version: '3.2'
96
90
  type: :runtime
97
91
  prerelease: false
98
92
  version_requirements: !ruby/object:Gem::Requirement
99
93
  requirements:
100
- - - "<"
94
+ - - "~>"
101
95
  - !ruby/object:Gem::Version
102
96
  version: '3.2'
103
97
  - !ruby/object:Gem::Dependency
104
- name: rake
98
+ name: bixby
105
99
  requirement: !ruby/object:Gem::Requirement
106
100
  requirements:
107
- - - "~>"
101
+ - - ">="
108
102
  - !ruby/object:Gem::Version
109
- version: '10.0'
103
+ version: '0'
110
104
  type: :development
111
105
  prerelease: false
112
106
  version_requirements: !ruby/object:Gem::Requirement
113
107
  requirements:
114
- - - "~>"
108
+ - - ">="
115
109
  - !ruby/object:Gem::Version
116
- version: '10.0'
110
+ version: '0'
117
111
  - !ruby/object:Gem::Dependency
118
- name: rspec
112
+ name: byebug
119
113
  requirement: !ruby/object:Gem::Requirement
120
114
  requirements:
121
- - - "~>"
115
+ - - ">="
122
116
  - !ruby/object:Gem::Version
123
- version: '3.0'
117
+ version: '0'
124
118
  type: :development
125
119
  prerelease: false
126
120
  version_requirements: !ruby/object:Gem::Requirement
127
121
  requirements:
128
- - - "~>"
122
+ - - ">="
129
123
  - !ruby/object:Gem::Version
130
- version: '3.0'
124
+ version: '0'
131
125
  - !ruby/object:Gem::Dependency
132
- name: rspec_junit_formatter
126
+ name: coveralls
133
127
  requirement: !ruby/object:Gem::Requirement
134
128
  requirements:
135
129
  - - ">="
@@ -143,7 +137,7 @@ dependencies:
143
137
  - !ruby/object:Gem::Version
144
138
  version: '0'
145
139
  - !ruby/object:Gem::Dependency
146
- name: coveralls
140
+ name: equivalent-xml
147
141
  requirement: !ruby/object:Gem::Requirement
148
142
  requirements:
149
143
  - - ">="
@@ -157,7 +151,7 @@ dependencies:
157
151
  - !ruby/object:Gem::Version
158
152
  version: '0'
159
153
  - !ruby/object:Gem::Dependency
160
- name: simplecov
154
+ name: fcrepo_wrapper
161
155
  requirement: !ruby/object:Gem::Requirement
162
156
  requirements:
163
157
  - - ">="
@@ -171,63 +165,63 @@ dependencies:
171
165
  - !ruby/object:Gem::Version
172
166
  version: '0'
173
167
  - !ruby/object:Gem::Dependency
174
- name: solr_wrapper
168
+ name: rake
175
169
  requirement: !ruby/object:Gem::Requirement
176
170
  requirements:
177
- - - "~>"
171
+ - - ">="
178
172
  - !ruby/object:Gem::Version
179
- version: '2.1'
173
+ version: '0'
180
174
  type: :development
181
175
  prerelease: false
182
176
  version_requirements: !ruby/object:Gem::Requirement
183
177
  requirements:
184
- - - "~>"
178
+ - - ">="
185
179
  - !ruby/object:Gem::Version
186
- version: '2.1'
180
+ version: '0'
187
181
  - !ruby/object:Gem::Dependency
188
- name: fcrepo_wrapper
182
+ name: rspec
189
183
  requirement: !ruby/object:Gem::Requirement
190
184
  requirements:
191
- - - "~>"
185
+ - - ">="
192
186
  - !ruby/object:Gem::Version
193
- version: '0.9'
187
+ version: '0'
194
188
  type: :development
195
189
  prerelease: false
196
190
  version_requirements: !ruby/object:Gem::Requirement
197
191
  requirements:
198
- - - "~>"
192
+ - - ">="
199
193
  - !ruby/object:Gem::Version
200
- version: '0.9'
194
+ version: '0'
201
195
  - !ruby/object:Gem::Dependency
202
- name: rubocop
196
+ name: rspec_junit_formatter
203
197
  requirement: !ruby/object:Gem::Requirement
204
198
  requirements:
205
- - - "~>"
199
+ - - ">="
206
200
  - !ruby/object:Gem::Version
207
- version: '0.42'
201
+ version: '0'
208
202
  type: :development
209
203
  prerelease: false
210
204
  version_requirements: !ruby/object:Gem::Requirement
211
205
  requirements:
212
- - - "~>"
206
+ - - ">="
213
207
  - !ruby/object:Gem::Version
214
- version: '0.42'
208
+ version: '0'
215
209
  - !ruby/object:Gem::Dependency
216
- name: rubocop-rspec
210
+ name: simplecov
217
211
  requirement: !ruby/object:Gem::Requirement
218
212
  requirements:
219
- - - "~>"
213
+ - - ">="
220
214
  - !ruby/object:Gem::Version
221
- version: '1.4'
215
+ version: '0'
222
216
  type: :development
223
217
  prerelease: false
224
218
  version_requirements: !ruby/object:Gem::Requirement
225
219
  requirements:
226
- - - "~>"
220
+ - - ">="
227
221
  - !ruby/object:Gem::Version
228
- version: '1.4'
222
+ version: '0'
229
223
  - !ruby/object:Gem::Dependency
230
- name: equivalent-xml
224
+ name: solr_wrapper
231
225
  requirement: !ruby/object:Gem::Requirement
232
226
  requirements:
233
227
  - - ">="
@@ -274,7 +268,7 @@ files:
274
268
  homepage: https://github.com/projecthydra-labs/active_fedora-datastreams
275
269
  licenses: []
276
270
  metadata: {}
277
- post_install_message:
271
+ post_install_message:
278
272
  rdoc_options: []
279
273
  require_paths:
280
274
  - lib
@@ -289,8 +283,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
289
283
  - !ruby/object:Gem::Version
290
284
  version: '0'
291
285
  requirements: []
292
- rubygems_version: 3.1.6
293
- signing_key:
286
+ rubygems_version: 3.4.1
287
+ signing_key:
294
288
  specification_version: 4
295
289
  summary: Datastreams for ActiveFedora
296
290
  test_files: []