{"id":23009909,"url":"https://github.com/openactive/dataset-site-template-ruby","last_synced_at":"2026-02-28T15:01:15.606Z","repository":{"id":46262266,"uuid":"210652310","full_name":"openactive/dataset-site-template-ruby","owner":"openactive","description":"Ruby classes and resources supporting dataset site creation","archived":false,"fork":false,"pushed_at":"2025-05-12T09:41:26.000Z","size":230,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-30T07:40:31.263Z","etag":null,"topics":["implementation-support","pre-release","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Mustache","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openactive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-24T16:45:57.000Z","updated_at":"2025-05-12T09:41:28.000Z","dependencies_parsed_at":"2024-06-17T17:36:46.178Z","dependency_job_id":"7ca8f474-227e-4869-8170-318b791f4adf","html_url":"https://github.com/openactive/dataset-site-template-ruby","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/openactive/dataset-site-template-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openactive%2Fdataset-site-template-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openactive%2Fdataset-site-template-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openactive%2Fdataset-site-template-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openactive%2Fdataset-site-template-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openactive","download_url":"https://codeload.github.com/openactive/dataset-site-template-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openactive%2Fdataset-site-template-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29938962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:49:17.081Z","status":"ssl_error","status_checked_at":"2026-02-28T13:48:50.396Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["implementation-support","pre-release","ruby"],"created_at":"2024-12-15T09:16:30.496Z","updated_at":"2026-02-28T15:01:15.522Z","avatar_url":"https://github.com/openactive.png","language":"Mustache","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dataset-site-template-ruby\nRuby classes and resources supporting dataset site creation\n\nTools intended to simplify creation of dataset sites using templates.\n\nFor comparison, see the [.NET](https://github.com/openactive/dataset-site-template-example-dotnet) and [PHP](https://github.com/openactive/dataset-site-template-php) implementations.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'openactive-dataset_site'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install openactive-dataset_site\n    \n\n## Usage\n\nIf you are developing this package, go to the [Contribution](#contribution) section.\n\nWherever you want to render your Dataset page, include the following instructions:\n```ruby\n\n# Render compiled template with data\nrenderer = OpenActive::DatasetSite::TemplateRenderer.new(settings)\nputs renderer.render\n```\n\nOr to render a [CSP-compatible template](https://developer.openactive.io/publishing-data/dataset-sites#template-hosting-options), first ensure that you are serving the [CSP compatible static assets](/lib/openactive/dataset_site/datasetsite-csp.static.zip) from this version of the Ruby gem at a URL, and then including the following:\n```ruby\n\n# Render compiled CSP-compatible template with data\nrenderer = OpenActive::DatasetSite::TemplateRenderer.new(settings, \"./path/to/assets\")\nputs renderer.render\n```\n\nWhere `settings` could be defined like the following (as an example):\n```ruby\nsettings = OpenActive::DatasetSite::Settings.new(\n    open_data_feed_base_url: \"https://customer.example.com/feed/\",\n    dataset_site_url: \"https://halo-odi.legendonlineservices.co.uk/openactive/\",\n    dataset_discussion_url: \"https://github.com/gll-better/opendata\",\n    dataset_documentation_url: \"https://permalink.openactive.io/dataset-site/open-data-documentation\",\n    dataset_languages: [\"en-GB\"],\n    organisation_name: \"Better\",\n    organisation_url: \"https://www.better.org.uk/\",\n    organisation_legal_entity: \"GLL\",\n    organisation_plain_text_description: \"Established in 1993, GLL is the largest UK-based charitable social enterprise delivering leisure, health and community services. Under the consumer facing brand Better, we operate 258 public Sports and Leisure facilities, 88 libraries, 10 children’s centres and 5 adventure playgrounds in partnership with 50 local councils, public agencies and sporting organisations. Better leisure facilities enjoy 46 million visitors a year and have more than 650,000 members.\",\n    organisation_logo_url: \"http://data.better.org.uk/images/logo.png\",\n    organisation_email: \"info@better.org.uk\",\n    platform_name: \"AcmeBooker\",\n    platform_url: \"https://acmebooker.example.com/\",\n    platform_software_version: \"2.0.1\",\n    background_image_url: \"https://data.better.org.uk/images/bg.jpg\",\n    date_first_published: \"2019-10-28\",\n    open_booking_api_base_url: \"https://reference-implementation.openactive.io/api/openbooking\",\n    open_booking_api_authentication_authority_url: \"https://auth.reference-implementation.openactive.io\",\n    open_booking_api_documentation_url: \"https://permalink.openactive.io/dataset-site/open-booking-api-documentation\",\n    open_booking_api_terms_service_url: \"https://example.com/api-terms-page\",\n    open_booking_api_registration_url: \"https://example.com/api-landing-page\",\n    test_suite_certificate_url: \"https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/\",\n    data_feed_types: [\n      OpenActive::DatasetSite::FeedType::FACILITY_USE,\n      OpenActive::DatasetSite::FeedType::SCHEDULED_SESSION,\n      OpenActive::DatasetSite::FeedType::SESSION_SERIES,\n      OpenActive::DatasetSite::FeedType::SLOT,\n    ],\n)\n```\n\n\n### Feed-level customisation\nIf you need to do feed specific overrides, then you may do this by overriding the method.\n```ruby\nsettings = Class.new(OpenActive::DatasetSite::Settings) do\n  def data_download(feed_type)\n    val = super(feed_type)\n\n    case feed_type\n    when OpenActive::DatasetSite::FeedType::SESSION_SERIES\n      val.content_url = open_data_feed_base_url + \"session_series\"\n    end\n\n    val\n  end\nend.new(\n  data_feed_types: [\n    OpenActive::DatasetSite::FeedType::FACILITY_USE,\n    OpenActive::DatasetSite::FeedType::SCHEDULED_SESSION,\n    OpenActive::DatasetSite::FeedType::SESSION_SERIES,\n    OpenActive::DatasetSite::FeedType::SLOT,\n  ],\n  # rest of your settings here.\n)\n```\n\nTo match the PHP/.NET usage, you may alternatively use this approach, however it's less advised as there are more details to get right (and it risks a mismatch between the downloads and the advertised feed types):\n```ruby\nsettings = OpenActive::DatasetSite::Settings.new(\n    # your settings here,\n    data_feed_types: [\n      OpenActive::DatasetSite::FeedType::SESSION_SERIES,\n    ],\n    data_downloads: [\n        OpenActive::Models::DataDownload.new(\n          name: \"SessionSeries\",\n          additional_type: \"https://openactive.io/SessionSeries\",\n          encoding_format:  OpenActive::DatasetSite::Meta.RPDE_MEDIA_TYPE,\n          content_url: open_data_feed_base_url + \"session-series\",\n        )\n    ]\n)\n```\n\n### Dataset\n```ruby\ndataset = OpenActive::Models::Dataset.new(\n  id: \"http://example.com/dataset/\",\n  url: \"http://example.com/dataset/\",\n  description:\n    \"Near real-time availability and rich descriptions relating to the facilities and sessions available from Simpleweb\",\n  access_service:\n    OpenActive::Models::WebAPI.new(\n      name: 'Open Booking API',\n      description: \"API that allows for seamless booking experiences to be created for facilities and sessions available from Simpleweb\",\n      documentation: \"https://permalink.openactive.io/dataset-site/open-booking-api-documentation\",\n      terms_of_service: \"https://example.com/api-terms-page\",\n      endpoint_url: \"https://reference-implementation.openactive.io/api/openbooking\",\n      authentication_authority: \"https://auth.reference-implementation.openactive.io\",\n      conforms_to: [\"https://openactive.io/open-booking-api/EditorsDraft/\"],\n      endpoint_description: \"https://www.openactive.io/open-booking-api/EditorsDraft/swagger.json\",\n      landing_page: \"https://example.com/api-landing-page\"\n    ),\n  dateModified: \"2019-12-09T15:36:15+00:00\",\n  keywords:\n    [\"Facilities\",\n     \"Sessions\",\n     \"Activities\",\n     \"Sports\",\n     \"Physical Activity\",\n     \"OpenActive\"],\n  schemaVersion: \"https://www.openactive.io/modelling-opportunity-data/2.0/\",\n  license: \"https://creativecommons.org/licenses/by/4.0/\",\n  publisher:\n    OpenActive::Models::Organization.new(\n      name: \"Simpleweb\",\n      description:\n       \"Simpleweb is a purpose driven software company that specialises in new technologies, product development, and human interaction.\",\n      url: \"https://www.simpleweb.co.uk/\",\n      legalName: \"Simpleweb Ltd\",\n      logo:\n       OpenActive::Models::ImageObject.new(\n         url:\n           \"https://simpleweb.co.uk/wp-content/uploads/2015/07/facebook-default.png\",\n       ),\n      email: \"spam@simpleweb.co.uk\",\n    ),\n  discussionUrl: \"https://github.com/simpleweb/sw-oa-php-test-site\",\n  datePublished: \"2019-11-05T00:00:00+00:00\",\n  inLanguage: [\"en-GB\"],\n  distribution:\n    [OpenActive::Models::DataDownload.new(\n      name: \"FacilityUse\",\n      additionalType: \"https://openactive.io/FacilityUse\",\n      encodingFormat: \"application/vnd.openactive.rpde+json; version=1\",\n      contentUrl: \"http://example.com/feed/facility-uses\",\n    ),\n     OpenActive::Models::DataDownload.new(\n       name: \"ScheduledSession\",\n       additionalType: \"https://openactive.io/ScheduledSession\",\n       encodingFormat: \"application/vnd.openactive.rpde+json; version=1\",\n       contentUrl: \"http://example.com/feed/scheduled-sessions\",\n     ),\n     OpenActive::Models::DataDownload.new(\n       name: \"SessionSeries\",\n       additionalType: \"https://openactive.io/SessionSeries\",\n       encodingFormat: \"application/vnd.openactive.rpde+json; version=1\",\n       contentUrl: \"http://example.com/feed/session_series\",\n     ),\n     OpenActive::Models::DataDownload.new(\n       name: \"Slot\",\n       additionalType: \"https://openactive.io/Slot\",\n       encodingFormat: \"application/vnd.openactive.rpde+json; version=1\",\n       contentUrl: \"http://example.com/feed/slots\",\n     )],\n  backgroundImage:\n    OpenActive::Models::ImageObject.new(\n      url:\n        \"https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg\",\n    ),\n  documentation: \"https://permalink.openactive.io/dataset-site/open-data-documentation\",\n  name: \"Simpleweb Facilities and Sessions\",\n  booking_service:\n    OpenActive::Models::BookingService.new(\n      name: \"SimpleWeb Booking\",\n      url: \"https://www.example.com/\",\n      software_version: \"2.0.0\",\n      has_credential: \"https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/\",\n    )\n)\n\nrenderer = OpenActive::DatasetSite::TemplateRenderer.new(dataset)\n\nputs renderer.render\n```\n\n### Dataset patching\nThe dataset generation should already be good for most purposes, if needing to change just a couple of fields then\nyou may be better of patching just those fields.\n```ruby\nsettings = OpenActive::DatasetSite::Settings.new(\n  # your settings here\n)\n\ndataset = settings.to_dataset\n\ndataset.description = \"Some better non-generated description here.\"\n\nrenderer = OpenActive::DatasetSite::TemplateRenderer.new(dataset)\n\nputs renderer.render\n```\n\n### API\n\n#### OpenActive::DatasetSite::Settings\nAccepts a config hash containing the following keys:\n\n##### Settings\n\n| Key                                             | Type        | Description |\n| ----------------------------------------------- | ----------- | ----------- |\n| `open_data_feed_base_url`                       | `string`    | The the base URL for the open data feeds |\n| `dataset_site_url`                              | `string`    | The URL where this dataset site is displayed (the page's own URL) |\n| `dataset_discussion_url`                        | `string`    | The GitHub issues page for the dataset |\n| `dataset_documentation_url`                     | `string`    | Any documentation specific to the dataset. Defaults to https://permalink.openactive.io/dataset-site/open-data-documentation if not provided, which should be used if no documentation is available. |\n| `dataset_languages`                             | `string[]`  | The languages available in the dataset, following the IETF BCP 47 standard. Defaults to `array(\"en-GB\")`. |\n| `organisation_name`                             | `string`    | The publishing organisation's name |\n| `organisation_url`                              | `string`    | The publishing organisation's URL |\n| `organisation_legal_entity`                     | `string`    | The legal name of the publishing organisation of this dataset |\n| `organisation_plain_text_description`           | `string`    | A plain text description of this organisation |\n| `organisation_logo_url`                         | `string`    | An image URL of the publishing organisation's logo, ideally in PNG format |\n| `organisation_email`                            | `string`    | The contact email of the publishing organisation of this dataset |\n| `platform_name`                                 | `string`    | The software platform's name. Only set this if different from the publishing organisation, otherwise leave as null to exclude platform metadata. |\n| `platform_url`                                  | `string`    | The software platform's website |\n| `platform_software_version`                     | `string`    | The software platform's software version |\n| `background_image_url`                          | `string`    | The background image to show on the Dataset Site page |\n| `date_first_published`                          | `string`    | The date the dataset was first published |\n| `open_booking_api_base_url`                     | `string`    | The Base URI of this implementation of the Open Booking API |\n| `open_booking_api_authentication_authority_url` | `string`    | The location of the OpenID Provider that must be used to access the API |\n| `open_booking_api_documentation_url`            | `string`    | The URL of documentation related to how to use the Open Booking API. Defaults to https://permalink.openactive.io/dataset-site/open-booking-api-documentation if not provided, which should be used if no system-specific documentation is available. |\n| `open_booking_api_terms_service_url`            | `string`    | The URL of terms of service related to the use of this API |\n| `open_booking_api_registration_url`             | `string`    | The URL of a web page that the Broker may use to obtain access to the API, e.g. via a web form |\n| `test_suite_certificate_url`                    | `string`    | The URL of the OpenActive Test Suite certificate for this booking system |\n| `data_feed_types`                               | `FeedType[]`| A list of supported DataFeed types |\n\nAnd `data_feed_types` must be an array of `FeedType` constants, which auto-generates the metadata associated which each feed using best-practice values. See [available types](#feedtype)\n\n#### OpenActive::DatasetSite::TemplateRenderer.new(settings, static_assets_path_url = nil)\n\nAccepts a [`settings`](#settings) or [`DataSet`](#dataset) object. This is a Mustache engine.\n\nIf `static_assets_path_url` is provided, the [CSP-compatible template](https://developer.openactive.io/publishing-data/dataset-sites#template-hosting-options) is rendered. In this case you must ensure that you are serving the contents of the [CSP compatible static assets archive](/lib/openactive/dataset_site/datasetsite-csp.static.zip) at this location, using the assets archive in this version of the Ruby gem.\n\n##### .render\n\nReturns a string corresponding to the compiled HTML, based on the `datasetsite.mustache`, and the provided [`settings`](#settings) or [`DataSet`](#dataset) object\n\n#### `FeedType`\n\nA class containing the supported distribution types:\n\n| Constant                  | Name                    |\n| ------------------------- | ----------------------- |\n| `COURSE`                  | `Course`                |\n| `COURSE_INSTANCE`         | `CourseInstance`        |\n| `EVENT`                   | `Event`                 |\n| `EVENT_SERIES`            | `EventSeries`           |\n| `FACILITY_USE`            | `FacilityUse`           |\n| `HEADLINE_EVENT`          | `HeadlineEvent`         |\n| `INDIVIDUAL_FACILITY_USE` | `IndividualFacilityUse` |\n| `SCHEDULED_SESSION`       | `ScheduledSession`      |\n| `SESSION_SERIES`          | `SessionSeries`         |\n| `SLOT`                    | `Slot`                  |\n\n## Contribution\n\n### Release\n\nMajor version numbers of this library should match those of the `dataset-site-template` on which this library depends. Any updates to the dataset site template files or assets should always be a major version update in both libraries.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenactive%2Fdataset-site-template-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenactive%2Fdataset-site-template-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenactive%2Fdataset-site-template-ruby/lists"}