PURL service is a URL resolver that translates a reference to a digital object (in the form of a druid
), into a full content representation of that object as available in public access environment
- Ruby (3.2 or greater)
- bundler gem
Clone the repository
$ git clone git@github.com:sul-dlss/purl.git
Move into the app and install dependencies
$ cd purl
$ bundle install
Start the development server
$ bin/dev
Configuration is handled through the RailsConfig settings.yml files.
The defaults in config/settings.yml
should work on a locally run installation.
By default, local development will use production XML from PURL, so that you can hit any valid object when testing locally. If you want to use local XML for testing, which can be useful if you want to alter data and see the results, do this:
- Create a local "document_cache" folder in the root of the PURL rails app on your laptop.
- Create druid tree folders (e.g.
document_cache/xk/755/gc/8675
, just like they would be on stacks) and putmods
andpublic
XML files there. You can get examples from thespec/fixtures/document_cache
or production PURL. Note that thedocument_cache
folder is already in.gitignore
so any content copied there will not be added to git. - Create a
config/settings.local.yml
file (if you don't have one already) and add the following:
# Comment out for lookup to production PURL
purl_resource:
public_xml: "<%= File.join(Rails.root, "document_cache") %>/%{druid_tree}/public"
cocina: "<%= File.join(Rails.root, "document_cache") %>/%{druid_tree}/cocina.json"
If you leave this config uncommented, the local app will find content in the local document_cache. If you comment it out, it will revert to the default behavior (look up content on PURL).
The test suite (with RuboCop style enforcement) will be run with the default rake task (also run on travis)
$ rake
The specs can be run without RuboCop style enforcement
$ rake spec
The RuboCop style enforcement can be run without running the tests
$ rake rubocop
Deployment is handled automatically via Jenkins when a release is published to GitHub.
Only items with "PURL sitemap" release tag are included in the sitemap and all other items have a "noindex" meta tag.
Structured metadata in the form of schema.org markup is generated to enhance discoverability of datasets and videos. More info about schema.org markup.