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.4 or greater)
- bundler gem
Clone the repository
$ git clone [email protected]: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.
You can pull data from the stage stacks mount by running the fixture loader:
bin/rails runner 'FixtureLoader.load("bn208cc3480", machine: "purl-fetcher-stage")'Or you can do this manually:
- Create a local "stacks" folder in the root of the PURL rails app on your laptop.
- Create druid tree folders (e.g.
stacks/xk/755/gc/8675, just like they would be on stacks) and putcocinaandpublicXML files there. You can get examples from thespec/fixtures/stacksor production Stacks. Note that thestacksfolder is already in.gitignoreso any content copied there will not be added to git. An easy solution would be to runln -s spec/fixtures/stacks .. - Create a
config/settings.local.ymlfile (if you don't have one already) and add the following:
stacks:
root: stacks
We use Herb to lint ERB templates. You can run it manually with:
npx @herb-tools/linterWhen the Rails server is run using bin/dev, you can start up a debugger session in a separate terminal via:
rdbg -ATo drop into the debugger, add debugger statements where needed in the code and have fun navigating the stack in your debugger session terminal.
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
kinit
bin/rails update_metadata
Then run tests to see if anything needs to be updated. Commit the changes to the fixtures.
Deployment is handled automatically via Jenkins when a release is published to GitHub.
Data is stored in a pair-tree structure starting at /stacks. In each pair-tree is a file called cocina.json which is the public representation of the current version of the object. There is also a meta.json file that holds information about where this object is released to. The meta.json is not versionable data. Additionally there is an XML file called public which has a representation of the object that was derived from cocina.json.
Only items with "PURL sitemap" release tag (in meta.json) 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.