openactive-dataset_site 0.1.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 06c3edb6feeae3a16036a6cc50150d5b7da364b0
4
- data.tar.gz: c01bacae3dc20e6fdd5103e4e9549add20d648ac
2
+ SHA256:
3
+ metadata.gz: dfb043291daab358f768329f6311fbb0b57a6c4319d0942c046c3aad08d4cdc0
4
+ data.tar.gz: 166637b71a34034a6b78de8aa5a27e7a3814a528f9a2ea10718007c60192d19b
5
5
  SHA512:
6
- metadata.gz: c5b93fe8bf15a3e9e8557905e802c19a5e995466710ba5913a278a1c4650cd95f3973e7c5027bcde087af04bf6d19fe07387bd9aed3ffafebf737eccc9c0ddb2
7
- data.tar.gz: 49aeee97614d863c02fed3340d802819a8ba746e500ea7c6c6f409d114c319a7c72098985ac5ca139e32adf1785551750ec8c82cb9485ea0a9fd9dd5abcd6762
6
+ metadata.gz: 121509a0550e74c56656f32da17a8d84bf885546504337abaa0dadb102c58dee6f5f5b586eee102bc2d2187778261172d04a3d31c94ba714907911b6cf820815
7
+ data.tar.gz: d659df7dfb8242304c8653ad7f9ca61b693900767a251fbf336e2243190c8fe7d21c89abf04f48db84015b0ffbe66c1fd395ae79e3c924d38279e4d2ac9a5897
@@ -0,0 +1,63 @@
1
+ name: Update Dataset Site Template
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ repository_dispatch:
6
+ types: [dataset-site-template-update]
7
+
8
+ jobs:
9
+ generate:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v2
15
+ with:
16
+ ref: master
17
+
18
+ - name: Setup Node.js 14.x
19
+ uses: actions/setup-node@v1
20
+ with:
21
+ node-version: 14.x
22
+
23
+ - name: Update dataset site template to latest version
24
+ run: npx @openactive/dataset-site-template@latest --raw "./lib/openactive/dataset_site/"
25
+ working-directory: ./
26
+
27
+ - name: git stash if material changes have not been made
28
+ # When considering whether it's worth making a PR, ignore the following:
29
+ # - The dataset-site-template minor or patch version number updating within the template in datasetsite.mustache and datasetsite-csp.mustache (affects one line)
30
+ # - Any updates to datasetsite-csp.static.zip
31
+ # git stashing if no material changes allows the next step to close the PR if one is already open
32
+ run: if [ "$(git diff --numstat | grep -vc '^1\s.*datasetsite\.mustache\|1\s.*datasetsite-csp\.mustache\|.*datasetsite-csp\.static\.zip$')" -eq "0" ]; then git stash; else echo "Material changes found"; fi
33
+ working-directory: ./
34
+
35
+ - name: Create Pull Request
36
+ id: cpr
37
+ uses: peter-evans/create-pull-request@v3
38
+ with:
39
+ path: ./
40
+ token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
41
+ commit-message: Update dataset site template
42
+ committer: openactive-bot <openactive-bot@users.noreply.github.com>
43
+ author: openactive-bot <openactive-bot@users.noreply.github.com>
44
+ signoff: false
45
+ branch: ci/update-data-models
46
+ delete-branch: true
47
+ title: 'Update dataset site template'
48
+ body: |
49
+ Update to the latest version of the [Dataset Site Template](https://github.com/openactive/dataset-site-template)
50
+
51
+ **Reviewer note:** Major 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. Hence this PR, once merged, should be released with a major version bump to match its contents.
52
+
53
+ labels: |
54
+ automated pr
55
+ team-reviewers: |
56
+ owners
57
+ maintainers
58
+ draft: false
59
+
60
+ - name: Check outputs
61
+ run: |
62
+ echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
63
+ echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
@@ -0,0 +1,39 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ release:
8
+
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - name: Checkout
13
+ uses: actions/checkout@v2
14
+ with:
15
+ token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
16
+
17
+ - name: Identify
18
+ run: |
19
+ git config user.name OpenActive Bot
20
+ git config user.email hello@openactive.io
21
+
22
+ - name: Set up Ruby
23
+ uses: ruby/setup-ruby@v1
24
+ with:
25
+ ruby-version: 2.7
26
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
27
+
28
+ - name: Run tests
29
+ run: bundle exec rspec
30
+
31
+ - name: Publish to RubyGems
32
+ run: |
33
+ mkdir -p $HOME/.gem
34
+ touch $HOME/.gem/credentials
35
+ chmod 0600 $HOME/.gem/credentials
36
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
37
+ bundle exec rake release
38
+ env:
39
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
@@ -0,0 +1,66 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ ruby-version: ['2.6', '2.7']
16
+
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: ${{ matrix.ruby-version }}
23
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
24
+
25
+ - name: Run tests
26
+ run: bundle exec rspec
27
+
28
+ - name: Create output directory
29
+ run: mkdir -p ./output/
30
+
31
+ - name: Output rendering basic_example as an artifact
32
+ run: ruby examples/basic_example.rb > ./output/basic_example.html
33
+
34
+ - name: Output rendering basic_example_with_booking as an artifact
35
+ run: ruby examples/basic_example_with_booking.rb > ./output/basic_example_with_booking.html
36
+
37
+ - name: Output rendering basic_example_with_booking_minimal as an artifact
38
+ run: ruby examples/basic_example_with_booking_minimal.rb > ./output/basic_example_with_booking_minimal.html
39
+
40
+ - name: Output rendering basic_csp_example_with_booking as an artifact
41
+ run: ruby examples/basic_csp_example_with_booking.rb > ./output/basic_csp_example_with_booking.html
42
+
43
+ - name: Output rendering dataset_example as an artifact
44
+ run: ruby examples/dataset_example.rb > ./output/dataset_example.html
45
+
46
+ - name: Output rendering dataset_example_with_booking as an artifact
47
+ run: ruby examples/dataset_example_with_booking.rb > ./output/dataset_example_with_booking.html
48
+
49
+ - name: Output rendering dataset_csp_example_with_booking as an artifact
50
+ run: ruby examples/dataset_csp_example_with_booking.rb > ./output/dataset_csp_example_with_booking.html
51
+
52
+ - name: Output rendering dataset_patch as an artifact
53
+ run: ruby examples/dataset_patch.rb > ./output/dataset_patch.html
54
+
55
+ - name: Output rendering specific_feed_override_example as an artifact
56
+ run: ruby examples/specific_feed_override_example.rb > ./output/specific_feed_override_example.html
57
+
58
+ - name: Output rendering specific_feed_override_example2 as an artifact
59
+ run: ruby examples/specific_feed_override_example2.rb > ./output/specific_feed_override_example2.html
60
+
61
+ - name: Upload example renderings
62
+ uses: actions/upload-artifact@v2
63
+ if: ${{ success() || failure() }}
64
+ with:
65
+ name: example-rendering-ruby-${{ matrix.ruby-version }}
66
+ path: ./output/
data/README.md CHANGED
@@ -34,13 +34,21 @@ renderer = OpenActive::DatasetSite::TemplateRenderer.new(settings)
34
34
  puts renderer.render
35
35
  ```
36
36
 
37
+ Or 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:
38
+ ```ruby
39
+
40
+ # Render compiled CSP-compatible template with data
41
+ renderer = OpenActive::DatasetSite::TemplateRenderer.new(settings, "./path/to/assets")
42
+ puts renderer.render
43
+ ```
44
+
37
45
  Where `settings` could be defined like the following (as an example):
38
46
  ```ruby
39
47
  settings = OpenActive::DatasetSite::Settings.new(
40
48
  open_data_feed_base_url: "https://customer.example.com/feed/",
41
49
  dataset_site_url: "https://halo-odi.legendonlineservices.co.uk/openactive/",
42
50
  dataset_discussion_url: "https://github.com/gll-better/opendata",
43
- dataset_documentation_url: "https://docs.acmebooker.example.com/",
51
+ dataset_documentation_url: "https://permalink.openactive.io/dataset-site/open-data-documentation",
44
52
  dataset_languages: ["en-GB"],
45
53
  organisation_name: "Better",
46
54
  organisation_url: "https://www.better.org.uk/",
@@ -53,6 +61,12 @@ settings = OpenActive::DatasetSite::Settings.new(
53
61
  platform_software_version: "2.0",
54
62
  background_image_url: "https://data.better.org.uk/images/bg.jpg",
55
63
  date_first_published: "2019-10-28",
64
+ open_booking_api_base_url: "https://reference-implementation.openactive.io/api/openbooking",
65
+ open_booking_api_authentication_authority_url: "https://auth.reference-implementation.openactive.io",
66
+ open_booking_api_documentation_url: "https://permalink.openactive.io/dataset-site/open-booking-api-documentation",
67
+ open_booking_api_terms_service_url: "https://example.com/api-terms-page",
68
+ open_booking_api_registration_url: "https://example.com/api-landing-page",
69
+ test_suite_certificate_url: "https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/",
56
70
  data_feed_types: [
57
71
  OpenActive::DatasetSite::FeedType::FACILITY_USE,
58
72
  OpenActive::DatasetSite::FeedType::SCHEDULED_SESSION,
@@ -62,6 +76,158 @@ settings = OpenActive::DatasetSite::Settings.new(
62
76
  )
63
77
  ```
64
78
 
79
+
80
+ ### Feed-level customisation
81
+ If you need to do feed specific overrides, then you may do this by overriding the method.
82
+ ```ruby
83
+ settings = Class.new(OpenActive::DatasetSite::Settings) do
84
+ def data_download(feed_type)
85
+ val = super(feed_type)
86
+
87
+ case feed_type
88
+ when OpenActive::DatasetSite::FeedType::SESSION_SERIES
89
+ val.content_url = open_data_feed_base_url + "session_series"
90
+ end
91
+
92
+ val
93
+ end
94
+ end.new(
95
+ data_feed_types: [
96
+ OpenActive::DatasetSite::FeedType::FACILITY_USE,
97
+ OpenActive::DatasetSite::FeedType::SCHEDULED_SESSION,
98
+ OpenActive::DatasetSite::FeedType::SESSION_SERIES,
99
+ OpenActive::DatasetSite::FeedType::SLOT,
100
+ ],
101
+ # rest of your settings here.
102
+ )
103
+ ```
104
+
105
+ To 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):
106
+ ```ruby
107
+ settings = OpenActive::DatasetSite::Settings.new(
108
+ # your settings here,
109
+ data_feed_types: [
110
+ OpenActive::DatasetSite::FeedType::SESSION_SERIES,
111
+ ],
112
+ data_downloads: [
113
+ OpenActive::Models::DataDownload.new(
114
+ name: "SessionSeries",
115
+ additional_type: "https://openactive.io/SessionSeries",
116
+ encoding_format: OpenActive::DatasetSite::Meta.RPDE_MEDIA_TYPE,
117
+ content_url: open_data_feed_base_url + "session-series",
118
+ )
119
+ ]
120
+ )
121
+ ```
122
+
123
+ ### Dataset
124
+ ```ruby
125
+ dataset = OpenActive::Models::Dataset.new(
126
+ id: "http://example.com/dataset/",
127
+ url: "http://example.com/dataset/",
128
+ description:
129
+ "Near real-time availability and rich descriptions relating to the facilities and sessions available from Simpleweb",
130
+ access_service:
131
+ OpenActive::Models::WebAPI.new(
132
+ name: 'Open Booking API',
133
+ description: "API that allows for seamless booking experiences to be created for facilities and sessions available from Simpleweb",
134
+ documentation: "https://permalink.openactive.io/dataset-site/open-booking-api-documentation",
135
+ terms_of_service: "https://example.com/api-terms-page",
136
+ endpoint_url: "https://reference-implementation.openactive.io/api/openbooking",
137
+ authentication_authority: "https://auth.reference-implementation.openactive.io",
138
+ conforms_to: ["https://openactive.io/open-booking-api/EditorsDraft/"],
139
+ endpoint_description: "https://www.openactive.io/open-booking-api/EditorsDraft/swagger.json",
140
+ landing_page: "https://example.com/api-landing-page"
141
+ ),
142
+ dateModified: "2019-12-09T15:36:15+00:00",
143
+ keywords:
144
+ ["Facilities",
145
+ "Sessions",
146
+ "Activities",
147
+ "Sports",
148
+ "Physical Activity",
149
+ "OpenActive"],
150
+ schemaVersion: "https://www.openactive.io/modelling-opportunity-data/2.0/",
151
+ license: "https://creativecommons.org/licenses/by/4.0/",
152
+ publisher:
153
+ OpenActive::Models::Organization.new(
154
+ name: "Simpleweb",
155
+ description:
156
+ "Simpleweb is a purpose driven software company that specialises in new technologies, product development, and human interaction.",
157
+ url: "https://www.simpleweb.co.uk/",
158
+ legalName: "Simpleweb Ltd",
159
+ logo:
160
+ OpenActive::Models::ImageObject.new(
161
+ url:
162
+ "https://simpleweb.co.uk/wp-content/uploads/2015/07/facebook-default.png",
163
+ ),
164
+ email: "spam@simpleweb.co.uk",
165
+ ),
166
+ discussionUrl: "https://github.com/simpleweb/sw-oa-php-test-site",
167
+ datePublished: "2019-11-05T00:00:00+00:00",
168
+ inLanguage: ["en-GB"],
169
+ distribution:
170
+ [OpenActive::Models::DataDownload.new(
171
+ name: "FacilityUse",
172
+ additionalType: "https://openactive.io/FacilityUse",
173
+ encodingFormat: "application/vnd.openactive.rpde+json; version=1",
174
+ contentUrl: "http://example.com/feed/facility-uses",
175
+ ),
176
+ OpenActive::Models::DataDownload.new(
177
+ name: "ScheduledSession",
178
+ additionalType: "https://openactive.io/ScheduledSession",
179
+ encodingFormat: "application/vnd.openactive.rpde+json; version=1",
180
+ contentUrl: "http://example.com/feed/scheduled-sessions",
181
+ ),
182
+ OpenActive::Models::DataDownload.new(
183
+ name: "SessionSeries",
184
+ additionalType: "https://openactive.io/SessionSeries",
185
+ encodingFormat: "application/vnd.openactive.rpde+json; version=1",
186
+ contentUrl: "http://example.com/feed/session_series",
187
+ ),
188
+ OpenActive::Models::DataDownload.new(
189
+ name: "Slot",
190
+ additionalType: "https://openactive.io/Slot",
191
+ encodingFormat: "application/vnd.openactive.rpde+json; version=1",
192
+ contentUrl: "http://example.com/feed/slots",
193
+ )],
194
+ backgroundImage:
195
+ OpenActive::Models::ImageObject.new(
196
+ url:
197
+ "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
198
+ ),
199
+ documentation: "https://permalink.openactive.io/dataset-site/open-data-documentation",
200
+ name: "Simpleweb Facilities and Sessions",
201
+ booking_service:
202
+ OpenActive::Models::BookingService.new(
203
+ name: "SimpleWeb Booking",
204
+ url: "https://www.example.com/",
205
+ has_credential: "https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/",
206
+ )
207
+ )
208
+
209
+ renderer = OpenActive::DatasetSite::TemplateRenderer.new(dataset)
210
+
211
+ puts renderer.render
212
+ ```
213
+
214
+ ### Dataset patching
215
+ The dataset generation should already be good for most purposes, if needing to change just a couple of fields then
216
+ you may be better of patching just those fields.
217
+ ```ruby
218
+ settings = OpenActive::DatasetSite::Settings.new(
219
+ # your settings here
220
+ )
221
+
222
+ dataset = settings.to_dataset
223
+
224
+ dataset.description = "Some better non-generated description here."
225
+
226
+ renderer = OpenActive::DatasetSite::TemplateRenderer.new(dataset)
227
+
228
+ puts renderer.render
229
+ ```
230
+
65
231
  ### API
66
232
 
67
233
  #### OpenActive::DatasetSite::Settings
@@ -69,35 +235,43 @@ Accepts a config hash containing the following keys:
69
235
 
70
236
  ##### Settings
71
237
 
72
- | Key | Type | Description |
73
- | --------------------------------------- | ----------- | ----------- |
74
- | `open_data_feed_base_url` | `string` | The the base URL for the open data feeds |
75
- | `dataset_site_url` | `string` | The URL where this dataset site is displayed (the page's own URL) |
76
- | `dataset_discussion_url` | `string` | The GitHub issues page for the dataset |
77
- | `dataset_documentation_url` | `string` | Any documentation specific to the dataset. Defaults to https://developer.openactive.io/ if not provided, which should be used if no documentation is available. |
78
- | `dataset_languages` | `string[]` | The languages available in the dataset, following the IETF BCP 47 standard. Defaults to `array("en-GB")`. |
79
- | `organisation_name` | `string` | The publishing organisation's name |
80
- | `organisation_url` | `string` | The publishing organisation's URL |
81
- | `organisation_legal_entity` | `string` | The legal name of the publishing organisation of this dataset |
82
- | `organisation_plain_text_description` | `string` | A plain text description of this organisation |
83
- | `organisation_logo_url` | `string` | An image URL of the publishing organisation's logo, ideally in PNG format |
84
- | `organisation_email` | `string` | The contact email of the publishing organisation of this dataset |
85
- | `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. |
86
- | `platform_url` | `string` | The software platform's website |
87
- | `platform_software_version` | `string` | The software platform's software version |
88
- | `background_image_url` | `string` | The background image to show on the Dataset Site page |
89
- | `date_first_published` | `string` | The date the dataset was first published |
90
- | `data_feed_types` | `FeedType[]`| A list of supported DataFeed types |
238
+ | Key | Type | Description |
239
+ | ----------------------------------------------- | ----------- | ----------- |
240
+ | `open_data_feed_base_url` | `string` | The the base URL for the open data feeds |
241
+ | `dataset_site_url` | `string` | The URL where this dataset site is displayed (the page's own URL) |
242
+ | `dataset_discussion_url` | `string` | The GitHub issues page for the dataset |
243
+ | `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. |
244
+ | `dataset_languages` | `string[]` | The languages available in the dataset, following the IETF BCP 47 standard. Defaults to `array("en-GB")`. |
245
+ | `organisation_name` | `string` | The publishing organisation's name |
246
+ | `organisation_url` | `string` | The publishing organisation's URL |
247
+ | `organisation_legal_entity` | `string` | The legal name of the publishing organisation of this dataset |
248
+ | `organisation_plain_text_description` | `string` | A plain text description of this organisation |
249
+ | `organisation_logo_url` | `string` | An image URL of the publishing organisation's logo, ideally in PNG format |
250
+ | `organisation_email` | `string` | The contact email of the publishing organisation of this dataset |
251
+ | `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. |
252
+ | `platform_url` | `string` | The software platform's website |
253
+ | `platform_software_version` | `string` | The software platform's software version |
254
+ | `background_image_url` | `string` | The background image to show on the Dataset Site page |
255
+ | `date_first_published` | `string` | The date the dataset was first published |
256
+ | `open_booking_api_base_url` | `string` | The Base URI of this implementation of the Open Booking API |
257
+ | `open_booking_api_authentication_authority_url` | `string` | The location of the OpenID Provider that must be used to access the API |
258
+ | `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. |
259
+ | `open_booking_api_terms_service_url` | `string` | The URL of terms of service related to the use of this API |
260
+ | `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 |
261
+ | `test_suite_certificate_url` | `string` | The URL of the OpenActive Test Suite certificate for this booking system |
262
+ | `data_feed_types` | `FeedType[]`| A list of supported DataFeed types |
91
263
 
92
264
  And `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)
93
265
 
94
- #### OpenActive::DatasetSite::TemplateRenderer.new(settings)
266
+ #### OpenActive::DatasetSite::TemplateRenderer.new(settings, static_assets_path_url = nil)
267
+
268
+ Accepts a [`settings`](#settings) or [`DataSet`](#dataset) object. This is a Mustache engine.
95
269
 
96
- Accepts a settings or a DataSet object. This is a Mustache engine.
270
+ If `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.
97
271
 
98
272
  ##### .render
99
273
 
100
- Returns a string corresponding to the compiled HTML, based on the `datasetsite.mustache`, the provided [`settings`](#settings)
274
+ Returns a string corresponding to the compiled HTML, based on the `datasetsite.mustache`, and the provided [`settings`](#settings) or [`DataSet`](#dataset) object
101
275
 
102
276
  #### `FeedType`
103
277
 
@@ -115,3 +289,9 @@ A class containing the supported distribution types:
115
289
  | `SCHEDULED_SESSION` | `ScheduledSession` |
116
290
  | `SESSION_SERIES` | `SessionSeries` |
117
291
  | `SLOT` | `Slot` |
292
+
293
+ ## Contribution
294
+
295
+ ### Release
296
+
297
+ Major 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.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
@@ -0,0 +1,41 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require "openactive/dataset_site"
5
+
6
+ feed_types = [
7
+ OpenActive::DatasetSite::FeedType::FACILITY_USE,
8
+ OpenActive::DatasetSite::FeedType::SCHEDULED_SESSION,
9
+ OpenActive::DatasetSite::FeedType::SESSION_SERIES,
10
+ OpenActive::DatasetSite::FeedType::SLOT,
11
+ ]
12
+
13
+ settings = OpenActive::DatasetSite::Settings.new(
14
+ open_data_feed_base_url: "http://example.com/feed/",
15
+ dataset_site_url: "http://example.com/dataset/",
16
+ dataset_discussion_url: "https://github.com/simpleweb/sw-oa-php-test-site",
17
+ dataset_documentation_url: "https://permalink.openactive.io/dataset-site/open-data-documentation",
18
+ dataset_languages: ["en-GB"],
19
+ organisation_name: "Simpleweb",
20
+ organisation_url: "https://www.simpleweb.co.uk/",
21
+ organisation_legal_entity: "Simpleweb Ltd",
22
+ organisation_plain_text_description: "Simpleweb is a purpose driven software company that specialises in new "\
23
+ "technologies, product development, and human interaction.",
24
+ organisation_logo_url: "https://simpleweb.co.uk/wp-content/uploads/2015/07/facebook-default.png",
25
+ organisation_email: "spam@simpleweb.co.uk",
26
+ background_image_url: "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
27
+ date_first_published: "2019-11-05",
28
+ platform_name: "AcmeBooker",
29
+ platform_url: "https://acmebooker.example.com/",
30
+ open_booking_api_base_url: "https://reference-implementation.openactive.io/api/openbooking",
31
+ open_booking_api_authentication_authority_url: "https://auth.reference-implementation.openactive.io",
32
+ open_booking_api_documentation_url: "https://permalink.openactive.io/dataset-site/open-booking-api-documentation",
33
+ open_booking_api_terms_service_url: "https://example.com/api-terms-page",
34
+ open_booking_api_registration_url: "https://example.com/api-landing-page",
35
+ test_suite_certificate_url: "https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/",
36
+ data_feed_types: feed_types,
37
+ )
38
+
39
+ renderer = OpenActive::DatasetSite::TemplateRenderer.new(settings, "./path/to/assets")
40
+
41
+ puts renderer.render
@@ -14,7 +14,7 @@ settings = OpenActive::DatasetSite::Settings.new(
14
14
  open_data_feed_base_url: "http://example.com/feed/",
15
15
  dataset_site_url: "http://example.com/dataset/",
16
16
  dataset_discussion_url: "https://github.com/simpleweb/sw-oa-php-test-site",
17
- dataset_documentation_url: "https://developer.openactive.io/",
17
+ dataset_documentation_url: "https://permalink.openactive.io/dataset-site/open-data-documentation",
18
18
  dataset_languages: ["en-GB"],
19
19
  organisation_name: "Simpleweb",
20
20
  organisation_url: "https://www.simpleweb.co.uk/",
@@ -24,7 +24,7 @@ settings = OpenActive::DatasetSite::Settings.new(
24
24
  organisation_logo_url: "https://simpleweb.co.uk/wp-content/uploads/2015/07/facebook-default.png",
25
25
  organisation_email: "spam@simpleweb.co.uk",
26
26
  background_image_url: "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
27
- date_first_published: "2019-11-05", # remember, remember the fifth of November...
27
+ date_first_published: "2019-11-05",
28
28
  data_feed_types: feed_types,
29
29
  )
30
30
 
@@ -0,0 +1,41 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require "openactive/dataset_site"
5
+
6
+ feed_types = [
7
+ OpenActive::DatasetSite::FeedType::FACILITY_USE,
8
+ OpenActive::DatasetSite::FeedType::SCHEDULED_SESSION,
9
+ OpenActive::DatasetSite::FeedType::SESSION_SERIES,
10
+ OpenActive::DatasetSite::FeedType::SLOT,
11
+ ]
12
+
13
+ settings = OpenActive::DatasetSite::Settings.new(
14
+ open_data_feed_base_url: "http://example.com/feed/",
15
+ dataset_site_url: "http://example.com/dataset/",
16
+ dataset_discussion_url: "https://github.com/simpleweb/sw-oa-php-test-site",
17
+ dataset_documentation_url: "https://permalink.openactive.io/dataset-site/open-data-documentation",
18
+ dataset_languages: ["en-GB"],
19
+ organisation_name: "Simpleweb",
20
+ organisation_url: "https://www.simpleweb.co.uk/",
21
+ organisation_legal_entity: "Simpleweb Ltd",
22
+ organisation_plain_text_description: "Simpleweb is a purpose driven software company that specialises in new "\
23
+ "technologies, product development, and human interaction.",
24
+ organisation_logo_url: "https://simpleweb.co.uk/wp-content/uploads/2015/07/facebook-default.png",
25
+ organisation_email: "spam@simpleweb.co.uk",
26
+ background_image_url: "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
27
+ date_first_published: "2019-11-05",
28
+ platform_name: "AcmeBooker",
29
+ platform_url: "https://acmebooker.example.com/",
30
+ open_booking_api_base_url: "https://reference-implementation.openactive.io/api/openbooking",
31
+ open_booking_api_authentication_authority_url: "https://auth.reference-implementation.openactive.io",
32
+ open_booking_api_documentation_url: "https://permalink.openactive.io/dataset-site/open-booking-api-documentation",
33
+ open_booking_api_terms_service_url: "https://example.com/api-terms-page",
34
+ open_booking_api_registration_url: "https://example.com/api-landing-page",
35
+ test_suite_certificate_url: "https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/",
36
+ data_feed_types: feed_types,
37
+ )
38
+
39
+ renderer = OpenActive::DatasetSite::TemplateRenderer.new(settings)
40
+
41
+ puts renderer.render
@@ -0,0 +1,37 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require "openactive/dataset_site"
5
+
6
+ feed_types = [
7
+ OpenActive::DatasetSite::FeedType::FACILITY_USE,
8
+ OpenActive::DatasetSite::FeedType::SCHEDULED_SESSION,
9
+ OpenActive::DatasetSite::FeedType::SESSION_SERIES,
10
+ OpenActive::DatasetSite::FeedType::SLOT,
11
+ ]
12
+
13
+ settings = OpenActive::DatasetSite::Settings.new(
14
+ open_data_feed_base_url: "http://example.com/feed/",
15
+ dataset_site_url: "http://example.com/dataset/",
16
+ dataset_discussion_url: "https://github.com/simpleweb/sw-oa-php-test-site",
17
+ dataset_documentation_url: "https://permalink.openactive.io/dataset-site/open-data-documentation",
18
+ dataset_languages: ["en-GB"],
19
+ organisation_name: "Simpleweb",
20
+ organisation_url: "https://www.simpleweb.co.uk/",
21
+ organisation_legal_entity: "Simpleweb Ltd",
22
+ organisation_plain_text_description: "Simpleweb is a purpose driven software company that specialises in new "\
23
+ "technologies, product development, and human interaction.",
24
+ organisation_logo_url: "https://simpleweb.co.uk/wp-content/uploads/2015/07/facebook-default.png",
25
+ organisation_email: "spam@simpleweb.co.uk",
26
+ background_image_url: "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
27
+ date_first_published: "2019-11-05",
28
+ open_booking_api_base_url: "https://reference-implementation.openactive.io/api/openbooking",
29
+ open_booking_api_documentation_url: "https://permalink.openactive.io/dataset-site/open-booking-api-documentation",
30
+ open_booking_api_registration_url: "https://example.com/api-landing-page",
31
+ test_suite_certificate_url: "https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/",
32
+ data_feed_types: feed_types,
33
+ )
34
+
35
+ renderer = OpenActive::DatasetSite::TemplateRenderer.new(settings)
36
+
37
+ puts renderer.render