diff --git a/app/models/electronic_locations/ark_location.rb b/app/models/electronic_locations/ark_location.rb deleted file mode 100644 index 9ea0e8794..000000000 --- a/app/models/electronic_locations/ark_location.rb +++ /dev/null @@ -1,13 +0,0 @@ -module ElectronicLocations - # Model for electronic location subfield values for ARKs - # (ARKs are persistent URL's for resources on the WWW) - # @see https://confluence.ucop.edu/display/Curation/ARK - class ARKLocation < OnlineLocation - # Constructor - # @param value [URI::ARK, String] the ARK URI - def initialize(value:) - ark_value = value.is_a?(URI::ARK) ? value : URI::ARK.parse(url: value) - super(value: ark_value) - end - end -end diff --git a/app/services/ark_resolver.rb b/app/services/ark_resolver.rb deleted file mode 100644 index 1e8ad56ee..000000000 --- a/app/services/ark_resolver.rb +++ /dev/null @@ -1,26 +0,0 @@ -class ArkResolver - attr_reader :ark - def initialize(ark:) - @ark = ark - end - - def location - @location ||= - begin - return unless final_result && final_result.status == 302 - final_result.headers["location"] - end - end - - private - - def initial_result - return if ark.blank? - @initial_result ||= Faraday.head(ark) - end - - def final_result - return unless initial_result && initial_result.status == 301 - @final_result ||= Faraday.head(initial_result.headers["location"]) - end -end diff --git a/config/application.rb b/config/application.rb index 00a4d003d..c6f56a523 100644 --- a/config/application.rb +++ b/config/application.rb @@ -43,5 +43,6 @@ class Application < Rails::Application config.authz = netids.split if netids config.alma = config_for(:alma).with_indifferent_access + config.autoloader = :zeitwerk end end diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index ac033bf9d..bdfa2cbd0 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,16 +1,4 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format. Inflections -# are locale specific, and you may define rules for as many different -# locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end +ActiveSupport::Inflector.inflections do |inflect| + inflect.acronym 'IIIF' + inflect.acronym 'URI' +end diff --git a/spec/models/electronic_locations/ark_location_spec.rb b/spec/models/electronic_locations/ark_location_spec.rb deleted file mode 100644 index 8c789c3e5..000000000 --- a/spec/models/electronic_locations/ark_location_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'rails_helper' - -RSpec.describe ElectronicLocations::ARKLocation, type: :model do - subject(:holding) { described_class.new(value: 'http://arks.princeton.edu/ark:/88435/5m60qr98h') } - describe '#value' do - it 'accesses the location value as an ARK' do - expect(holding.value).to be_a URI::ARK - expect(holding.value.to_s).to eq 'http://arks.princeton.edu:80/ark:/88435/5m60qr98h' - end - end -end