ftr_ruby 0.1.13 → 0.1.15

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
2
  SHA256:
3
- metadata.gz: 1f01bdc7760b54fbe420367a78c59e4b8539073b99e321f46f277aa1b6695600
4
- data.tar.gz: 2dda7ed64ce4ca85a77f34a863da866cef94cba75bce18f4701169b671d564a1
3
+ metadata.gz: 36fedccafa5cfc2d5c52b7ed6e67441a84f65f1cb78255f713d6b5a911228e20
4
+ data.tar.gz: 63398e934c32807fbfcfe4d5cd47bdde473b213bfadbc734936c7bcfb70c3132
5
5
  SHA512:
6
- metadata.gz: b1d0aa5cee43240b3a2536841b9709b4b61e8d9adbe84ee3720b8366f5a12f589f4b90efe1714ff99475d51635e90b17f4c067f28d42236a339646fc3f875ab3
7
- data.tar.gz: 87b71b41d91fe24b8e96674cb9fbbefbd10c2e888cc959ccd24edb4613f0320b14bf2f4bdc5d44898a4c55ece0a19da98c6468007062c38ea398e442ebe0ec83
6
+ metadata.gz: 66f1338361bf3d9c55df4bceddaa1672109002712d0977e7913a7f5f7702ec23910faabd4e7f3d0924b9ef4ea80bee014c6590f085c62b7ff5e5a246e33823be
7
+ data.tar.gz: 57bd37118cc69a3a9083f9322f4d2447d89f95f1f8bd0becf23475feb4ad8da1cb191f1232a071fe6979281729a538e589603358ee380a696810cd796e91bfbd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.14] - 2026-06-11
4
+
5
+ ### Added
6
+ - RSpec tests for all URL normalization cases in `Output#initialize`: scheme suffix in `protocol`, uppercase `protocol`, scheme prefix in `host`, port preservation in `host`, leading/trailing slashes in `basePath`, internal slashes in `basePath`, leading slash in `testid`, empty `basePath`, and a combined "all messy inputs" scenario
7
+
3
8
  ## [0.1.13] - 2026-06-11
4
9
 
5
10
  ### Fixed
data/lib/dcat_metadata.rb CHANGED
@@ -57,6 +57,9 @@ module FtrRuby
57
57
  # @option meta [String] :protocol Protocol (http/https)
58
58
  # @option meta [String] :host Hostname of the test service
59
59
  # @option meta [String] :basePath Base path of the test service
60
+ # @option meta [String] :endpoint_url URL of the test service (will be auto-generated if not supplied). Note that endpoint path is defined by the FTR spec to be assess/test, but this is not enforced
61
+ # @option meta [String] :endpoint_desc URL to the OpenAPI docs (will be auto-generated if not supplied)
62
+ # @option meta [String] :identifier Identifier of test (will be auto-generated from host, protocol, basepath, testid if not supplied)
60
63
  #
61
64
  # @note Several fields have sensible defaults (e.g. +dctype+, +supportedby+, +applicationarea+).
62
65
  # The +end_url+ and +identifier+ are automatically constructed from +protocol+, +host+,
@@ -72,8 +75,6 @@ module FtrRuby
72
75
  @keywords = meta[:keywords] || []
73
76
  @keywords = [@keywords] unless @keywords.is_a? Array
74
77
  @creator = meta[:creator]
75
- @end_desc = meta[:end_desc]
76
- @end_url = meta[:end_url]
77
78
  @dctype = meta[:dctype] || "http://edamontology.org/operation_2428"
78
79
  @supportedby = meta[:supportedby] || ["https://tools.ostrails.eu/champion"]
79
80
  @applicationarea = meta[:applicationarea] || ["http://www.fairsharing.org/ontology/subject/SRAO_0000401"]
@@ -87,15 +88,27 @@ module FtrRuby
87
88
  @protocol = meta[:protocol]
88
89
  @host = meta[:host]
89
90
  @basePath = meta[:basePath]
90
- cleanhost = @host.gsub("/", "")
91
- cleanpath = @basePath.gsub("/", "") # TODO: this needs to check only leading and trailing! NOt internal...
92
- endpointpath = "assess/test"
93
- @end_url = "#{protocol}://#{cleanhost}/#{cleanpath}/#{endpointpath}/#{testid}"
94
- @end_desc = "#{protocol}://#{cleanhost}/#{cleanpath}/#{testid}/api"
95
- @identifier = "#{protocol}://#{cleanhost}/#{cleanpath}/#{testid}"
96
91
  @definedby = meta[:definedby] || @identifier
97
92
  @landingpage = meta[:landingPage] || @identifier
98
93
 
94
+ cleanhost = @host.gsub(%r{/$}, "")
95
+ cleanpath = @basePath.gsub(%r{/$}, "")
96
+ endpointpath = "assess/test"
97
+
98
+ # The two overrides below are needed for FAIRsharing tests to ensure that the proper endpoint is shown in
99
+ # test output. Without this, endpoint URLs and descriptions pointing to non-existent URLs are generated.
100
+ @end_desc = meta[:end_desc]
101
+ @end_url = meta[:end_url]
102
+
103
+ # Override the endpoint URL if provided in the meta data.
104
+ @end_url = meta[:endpoint_url] || "#{protocol}://#{cleanhost}/#{cleanpath}/#{endpointpath}/#{testid}"
105
+
106
+ # Override the endpoint description if provided in the meta data.
107
+ @end_desc = meta[:endpoint_description] || "#{protocol}://#{cleanhost}/#{cleanpath}/#{testid}/api"
108
+
109
+ # Override the endpoint description if provided in the meta data.
110
+ @identifier = meta[:identifier] || "#{protocol}://#{cleanhost}/#{cleanpath}/#{testid}"
111
+
99
112
  unless @testid && @testname && @description && @creator && @end_desc && @end_url && @protocol && @host && @basePath
100
113
  warn "this record is invalid - it is missing one of testid testname description creator end_desc end_url protocol host basePath"
101
114
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FtrRuby
4
- VERSION = "0.1.13"
4
+ VERSION = "0.1.15"
5
5
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ftr_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - markwilkinson
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-07-08 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: base64
@@ -379,6 +380,7 @@ metadata:
379
380
  source_code_uri: https://github.com/markwilkinson/FTR-Ruby
380
381
  documentation_uri: https://rubydoc.info/gems/ftr_ruby
381
382
  bug_tracker_uri: https://github.com/markwilkinson/FTR-Ruby/issues
383
+ post_install_message:
382
384
  rdoc_options: []
383
385
  require_paths:
384
386
  - lib
@@ -393,7 +395,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
393
395
  - !ruby/object:Gem::Version
394
396
  version: '0'
395
397
  requirements: []
396
- rubygems_version: 4.0.9
398
+ rubygems_version: 3.4.19
399
+ signing_key:
397
400
  specification_version: 4
398
401
  summary: Libraries supporting the FTR Vocabulary.
399
402
  test_files: []