ftr_ruby 0.1.11 → 0.1.13

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: be4cb2cd61574feb95c0359b6d3c1534ae2bd13090c9cc77c874e7efeda209f2
4
- data.tar.gz: 1b20953f8acffa00d4ef3b6af4658a5eb05e657728f3c55bdf7230311ecccd9d
3
+ metadata.gz: 1f01bdc7760b54fbe420367a78c59e4b8539073b99e321f46f277aa1b6695600
4
+ data.tar.gz: 2dda7ed64ce4ca85a77f34a863da866cef94cba75bce18f4701169b671d564a1
5
5
  SHA512:
6
- metadata.gz: '0983e92af3a5199f1ba54a9023edb50bacbde94cb46805ae1c913a9110beabdc2c9da6d2a2968677b506f2cde1c7c41171f9143b1689fa3222c4b43f70f6d932'
7
- data.tar.gz: 3f2853d3956422992ca5d640c92113b34eb0336633724e039f2f70689d79758a32f5e46e7841ee6ee7ba12e14b6f74ebcb9ce34ed08f7687fee1b14ff75e07a5
6
+ metadata.gz: b1d0aa5cee43240b3a2536841b9709b4b61e8d9adbe84ee3720b8366f5a12f589f4b90efe1714ff99475d51635e90b17f4c067f28d42236a339646fc3f875ab3
7
+ data.tar.gz: 87b71b41d91fe24b8e96674cb9fbbefbd10c2e888cc959ccd24edb4613f0320b14bf2f4bdc5d44898a4c55ece0a19da98c6468007062c38ea398e442ebe0ec83
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.13] - 2026-06-11
4
+
5
+ ### Fixed
6
+ - `Output#initialize`: replaced aggressive `gsub(%r{[:/]}, "")` stripping on `protocol`, `host`, and `basePath` with holistic URL component normalization — strips scheme prefix from `host`, extracts only the scheme name from `protocol` (downcased), strips leading/trailing slashes from `basePath` while preserving internal path separators, and strips leading slashes from `testid` in `softwareid` construction; previously, a `basePath` like `/path/to/test` would be corrupted to `pathtotest` and port numbers in `host` would be destroyed
7
+
8
+ ## [0.1.12] - 2026-05-27
9
+
10
+ ### Fixed
11
+ - `Output#createEvaluationResponse`: `score = "fail"` inside the `rescue` block and `summary = ...` inside the `if` block both introduced local variables that shadowed the `attr_accessor` methods for the entire method scope; replaced all references with `@score` and `@summary` to read and write the instance variables directly — this was causing `prov:value` to always be serialized as `nil` regardless of what callers set on `output.score`
12
+
3
13
  ## [0.1.11] - 2026-05-26
4
14
 
5
15
  ### Changed
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FtrRuby
4
- VERSION = "0.1.11"
4
+ VERSION = "0.1.13"
5
5
  end
data/lib/output.rb CHANGED
@@ -48,10 +48,11 @@ module FtrRuby
48
48
  @comments = []
49
49
  @guidance = meta.fetch(:guidance, [])
50
50
  @creator = meta[:creator]
51
- @protocol = meta[:protocol].gsub(%r{[:/]}, "")
52
- @host = meta[:host].gsub(%r{[:/]}, "")
53
- @basePath = meta[:basePath].gsub(%r{[:/]}, "")
54
- @softwareid = "#{@protocol}://#{@host}/#{@basePath}/#{meta[:testid]}"
51
+ @protocol = meta[:protocol].to_s.split(%r{://}).first.to_s.strip.downcase
52
+ @host = meta[:host].to_s.sub(%r{\A[a-zA-Z][a-zA-Z0-9+\-.]*://}, "").split("/").first.to_s.strip
53
+ @basePath = meta[:basePath].to_s.sub(%r{\A[a-zA-Z][a-zA-Z0-9+\-.]*://[^/]*/}, "").gsub(%r{\A/+|/+\z}, "")
54
+ testid = meta[:testid].to_s.sub(%r{\A/+}, "")
55
+ @softwareid = "#{@protocol}://#{@host}/#{[@basePath, testid].reject(&:empty?).join("/")}"
55
56
  @api = "#{@softwareid}/api"
56
57
  end
57
58
 
@@ -80,9 +81,9 @@ module FtrRuby
80
81
 
81
82
  add_newline_to_comments
82
83
 
83
- if summary =~ /^Summary$/
84
- summary = "Summary of test results: #{comments[-1]}"
85
- summary ||= "Summary of test results: #{comments[-2]}"
84
+ if @summary =~ /^Summary$/
85
+ @summary = "Summary of test results: #{comments[-1]}"
86
+ @summary ||= "Summary of test results: #{comments[-2]}"
86
87
  end
87
88
 
88
89
  executionid = "urn:ostrails:testexecutionactivity:" + SecureRandom.uuid
@@ -99,7 +100,7 @@ module FtrRuby
99
100
  triplify(uniqueid, dct.title, "#{name} OUTPUT", g)
100
101
  triplify(uniqueid, dct.description, "OUTPUT OF #{description}", g)
101
102
  triplify(uniqueid, dct.license, license, g)
102
- triplify(uniqueid, prov.value, score, g)
103
+ triplify(uniqueid, prov.value, @score, g)
103
104
  triplify(uniqueid, ftr.summary, summary, g)
104
105
  triplify(uniqueid, RDF::Vocab::PROV.generatedAtTime, dt, g)
105
106
  triplify(uniqueid, ftr.log, comments.join, g)
@@ -134,10 +135,10 @@ module FtrRuby
134
135
  rescue StandardError
135
136
  triplify(uniqueid, ftr.assessmentTarget, "not a URI", g)
136
137
  triplify(executionid, prov.used, "not a URI", g)
137
- score = "fail"
138
+ @score = "fail"
138
139
  end
139
140
 
140
- unless score == "pass"
141
+ unless @score == "pass"
141
142
  guidance.each do |advice, label|
142
143
  adviceid = "urn:ostrails:testexecutionactivity:advice:" + SecureRandom.uuid
143
144
  triplify(uniqueid, ftr.suggestion, adviceid, g)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ftr_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - markwilkinson