Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #456 from sul-dlss/7-0-alpha
Browse files Browse the repository at this point in the history
Version 7
  • Loading branch information
jcoyne committed Apr 11, 2019
2 parents e47e60f + 5e82693 commit 369a5b6
Show file tree
Hide file tree
Showing 55 changed files with 77 additions and 2,882 deletions.
158 changes: 61 additions & 97 deletions .rubocop_todo.yml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ end
# Dependencies are defined in dor-services.gemspec
gemspec

gem 'active-fedora', ENV['AF_VERSION'] if ENV['AF_VERSION']
gem 'activemodel', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
1 change: 0 additions & 1 deletion config/config_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
:solr:
:url:
:opts: {}
:solrizer: {} # deprecated
:metadata:
:catalog:
:url:
Expand Down
2 changes: 1 addition & 1 deletion dor-services.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|

# Runtime dependencies
s.add_dependency 'active-fedora', '>= 8.7.0', '< 9'
s.add_dependency 'activesupport', '>= 4.2.10', '< 6.0.0'
s.add_dependency 'activesupport', '~> 5.1'
s.add_dependency 'confstruct', '~> 0.2.7'
s.add_dependency 'deprecation', '~> 0'
s.add_dependency 'dor-services-client', '~> 1.5'
Expand Down
30 changes: 0 additions & 30 deletions lib/dor-services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ def configure(*args, &block)
Dor::Config.configure *args, &block
end

# Load an object and inspect its identityMetadata to figure out what class
# to adapt it to. This is necessary when the object is not indexed, or the
# index is missing the objectType property.
# @param [String] pid The object's PID
def load_instance(pid)
Deprecation.warn(self, 'load_instance is deprecated, use Dor.find instead')
find(pid)
end

# Load an object and inspect its identityMetadata to figure out what class
# to adapt it to.
# @param [String] pid The object's PID
Expand All @@ -34,23 +25,6 @@ def find(pid, _opts = {})
Dor::Abstract.find pid, cast: true
end

# TODO: return enumerable and lazy load_instance
# TODO: restrict fieldlist (fl) for non-:lightweight queries
def find_all(query, opts = {})
ActiveSupport::Deprecation.warn 'Dor.find_all is deprecated; use activefedora finders instead'

resp = SearchService.query query, opts
resp['response']['docs'].collect do |solr_doc|
find solr_doc['id']
end
end

# @deprecated
def ensure_models_loaded!
ActiveSupport::Deprecation.warn 'Dor.ensure_models_loaded! is unnecessary and has been deprecated.'
eager_load!
end

def root
File.dirname(__FILE__)
end
Expand Down Expand Up @@ -122,13 +96,10 @@ def logger
autoload :Governable
autoload :Describable
autoload :Publishable
autoload :Shelvable
autoload :Embargoable
autoload :Preservable
autoload :Assembleable
autoload :Eventable
autoload :Versionable
autoload :Contentable
autoload :Discoverable
autoload :Geoable
autoload :Releaseable
Expand Down Expand Up @@ -160,7 +131,6 @@ def logger
autoload :DecommissionService
autoload :DigitalStacksService
autoload :DublinCoreService
autoload :FileMetadataMergeService
autoload :IndexingService
autoload :MetadataService
autoload :MergeService
Expand Down
25 changes: 0 additions & 25 deletions lib/dor/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,10 @@ def configure(*args)
result
end

def autoconfigure(url, cert_file = Config.ssl.cert_file, key_file = Config.ssl.key_file, key_pass = Config.ssl.key_pass)
client = make_rest_client(url, cert_file, key_file, key_pass)
config = Confstruct::Configuration.symbolize_hash JSON.parse(client.get(accept: 'application/json'))
configure(config)
end
deprecation_deprecate :autoconfigure

def sanitize
dup
end

def make_rest_client(url, cert = Config.ssl.cert_file, key = Config.ssl.key_file, pass = Config.ssl.key_pass)
params = {}
params[:ssl_client_cert] = OpenSSL::X509::Certificate.new(File.read(cert)) if cert
params[:ssl_client_key] = OpenSSL::PKey::RSA.new(File.read(key), pass) if key
RestClient::Resource.new(url, params)
end
deprecation_deprecate :make_rest_client

def make_solr_connection(add_opts = {})
opts = Dor::Config.solr.opts.merge(add_opts).merge(
url: Dor::Config.solr.url
Expand Down Expand Up @@ -101,16 +86,6 @@ def make_solr_connection(add_opts = {})
set_callback :configure, :after do |config|
configure_client!(config)

if config.solrizer.present?
stack = Kernel.caller.dup
stack.shift while stack[0] =~ %r{(active_support/callbacks|dor/config|dor-services)\.rb}
ActiveSupport::Deprecation.warn 'Dor::Config -- solrizer configuration is deprecated. Please use solr instead.', stack

config.solrizer.each do |k, v|
config.solr[k] ||= v
end
end

if config.solr.url.present?
ActiveFedora::SolrService.register
ActiveFedora::SolrService.instance.instance_variable_set :@conn, make_solr_connection
Expand Down
15 changes: 0 additions & 15 deletions lib/dor/datastreams/workflow_ds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
module Dor
# TODO: class docs
class WorkflowDs < ActiveFedora::OmDatastream
extend Deprecation
self.deprecation_horizon = 'dor-services version 7.0.0'

before_save :build_location
set_terminology do |t|
t.root(path: 'workflows')
Expand Down Expand Up @@ -34,18 +31,6 @@ def self.default_attributes
super.merge(mimeType: 'application/xml')
end

def get_workflow(wf, repo = 'dor')
xml = Dor::Config.workflow.client.workflow_xml(repo, pid, wf)
xml = Nokogiri::XML(xml)
return nil if xml.xpath('workflow').length == 0

Workflow::Document.new(xml.to_s)
end
deprecation_deprecate get_workflow: 'This has been moved to Argo and will be discontinued'

alias [] get_workflow
deprecation_deprecate :[] => 'This has been moved to Argo and will be discontinued'

def ng_xml
@ng_xml ||= Nokogiri::XML::Document.parse(content)
end
Expand Down
3 changes: 0 additions & 3 deletions lib/dor/models/admin_policy_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class AdminPolicyObject < Dor::Abstract
WorkflowsIndexer
)

CREATIVE_COMMONS_USE_LICENSES = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('CREATIVE_COMMONS_USE_LICENSES', 'Dor::CreativeCommonsLicenseService')
OPEN_DATA_COMMONS_USE_LICENSES = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('OPEN_DATA_COMMONS_USE_LICENSES', 'Dor::OpenDataLicenseService')

delegate :add_roleplayer, :purge_roles, :roles, to: :roleMetadata
delegate :mods_title, :mods_title=, to: :descMetadata
delegate :default_collections, :add_default_collection, :remove_default_collection,
Expand Down
18 changes: 0 additions & 18 deletions lib/dor/models/concerns/assembleable.rb

This file was deleted.

185 changes: 0 additions & 185 deletions lib/dor/models/concerns/contentable.rb

This file was deleted.

0 comments on commit 369a5b6

Please sign in to comment.