Skip to content

Commit

Permalink
Merge pull request #2156 from sul-dlss/remove-xml-parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
mjgiarlo committed May 28, 2024
2 parents 4cabd16 + 5f5c7f6 commit b971206
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 546 deletions.
37 changes: 16 additions & 21 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,27 @@ name: CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['3.2', '3.3']
ruby: ["3.2", "3.3"]
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Run tests (with XML)
run: bin/rake
env:
RAILS_ENV: test
- name: Run tests (with Cocina)
run: bin/rake
env:
SETTINGS__ENABLED_FEATURES__COCINA: true
RAILS_ENV: test
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Run tests
run: bin/rake
env:
RAILS_ENV: test
6 changes: 1 addition & 5 deletions app/models/embed/purl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@ def attributes=(hash)

# @param [String] druid a druid without a namespace (e.g. "sx925dc9385")
def self.find(druid)
loader = loader_class.new(druid)
loader = PurlJsonLoader.new(druid)
new(etag: loader.etag, last_modified: loader.last_modified, **loader.load)
end

def self.loader_class
Settings.enabled_features.cocina ? PurlJsonLoader : PurlXmlLoader
end

# @returns [Bool] does this have any resources that can be embeded?
def valid?
contents.any?
Expand Down
169 changes: 0 additions & 169 deletions app/models/embed/purl_xml_loader.rb

This file was deleted.

26 changes: 13 additions & 13 deletions config/settings.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
purl_url: 'https://purl.stanford.edu'
purl_url: "https://purl.stanford.edu"
# timeouts specified in seconds
purl_read_timeout: 20
purl_conn_timeout: 2
purl_feedback_email: 'some-email-address@distribution-list-host.stanford.edu'
stacks_url: 'https://stacks.stanford.edu'
iiif_info_url: 'https://library.stanford.edu/iiif/viewers'
purl_feedback_email: "some-email-address@distribution-list-host.stanford.edu"
stacks_url: "https://stacks.stanford.edu"
iiif_info_url: "https://library.stanford.edu/iiif/viewers"
enable_media_viewer?: <%= true %>
geo_external_url: 'https://earthworks.stanford.edu/catalog/stanford-'
geo_wms_url: 'https://geowebservices.stanford.edu/geoserver/wms/'
geo_external_url: "https://earthworks.stanford.edu/catalog/stanford-"
geo_wms_url: "https://geowebservices.stanford.edu/geoserver/wms/"
resource_types_that_contain_thumbnails:
- audio
- file
Expand All @@ -30,11 +30,11 @@ stream:
url: sul-mediaserver.stanford.edu/stacks/_definst_
# Mapping from file extensions to Wowza streaming prefixes
streaming_prefix:
mov: 'mp4'
mp4: 'mp4'
mpeg: 'mp4'
m4a: 'mp4'
mp3: 'mp3'
mov: "mp4"
mp4: "mp4"
mpeg: "mp4"
m4a: "mp4"
mp3: "mp3"

collections_to_show_attribution:
- dc876nn4469
Expand All @@ -44,7 +44,7 @@ analytics_debug: true
min_files_to_search_default: 10
enabled_features:
legacy_pdf_viewer: true # true shows the PDF.js based PDF viewer, false uses <object> tag for browser PDF rendering
cocina: false

language_subtag_registry:
path: vendor/data/language-subtag-registry
url: 'https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry'
url: "https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry"
Loading

0 comments on commit b971206

Please sign in to comment.