inferno_core 0.4.44 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c185042b4e2042dc69fc734d9ecec9ee77ff98c9fe1dfd8204b9f1c648220433
4
- data.tar.gz: 85dd03b14c444415be44ef24f4d7999465639806343845841808c80fc4d502bd
3
+ metadata.gz: 5c6ddae6726754b2036409f6765ffd3746e88a2238226655905332ac9083a907
4
+ data.tar.gz: a7f8fe7d9eedd5213bd9d825fc32075b00abf69953c29ab550c45b66fc0147b6
5
5
  SHA512:
6
- metadata.gz: ff47ba5db1e469fdb79eb2136d43c05eb339766fe99f8ad88c32750faf65812903230a64b758e3a676cc2e6b281fffc36ad585ef9ec58573293b2a9d381bdb28
7
- data.tar.gz: 5ffb96cda09467091258b9dc9851141470d97ad4e9e026bd198aa5a8f1253d79793dbc092c5c6ecf5e275d19d50e7660172fc0c2d7f01cc9c9357bea00507553
6
+ metadata.gz: bfbb7ef6d15895b029349446501d739b7e676cff8e0ea369c1f781ee29151187eaba602f4485cee34a19c9a492d1cdbe2e4db3454db5f33a8f7b578586c53685
7
+ data.tar.gz: 14cb75b1bbaa2dcca319348f9914cf2af5d40d36a23ab7de3d212e43555466dc5f7c6d1af9a570fcca977e16353df80bc76f891616b32f0d91a593cfb9378730
@@ -181,7 +181,7 @@ module Inferno
181
181
  .map { |header_name, value| Header.new(name: header_name.downcase, value:, type: 'response') }
182
182
 
183
183
  new(
184
- verb: response.env.method,
184
+ verb: response.env.method.downcase,
185
185
  url: response.env.url.to_s,
186
186
  direction:,
187
187
  name:,
@@ -210,7 +210,7 @@ module Inferno
210
210
  end
211
211
 
212
212
  new(
213
- verb: request[:method],
213
+ verb: request[:method].downcase,
214
214
  url: request[:url],
215
215
  direction:,
216
216
  name:,
@@ -119,5 +119,11 @@ module Inferno
119
119
  super("ID '#{id}' exceeds the maximum id length of 255 characters")
120
120
  end
121
121
  end
122
+
123
+ class DuplicateEntityIdException < StandardError
124
+ def initialize(id)
125
+ super("ID '#{id}' already exists. Ensure the uniqueness of the IDs.")
126
+ end
127
+ end
122
128
  end
123
129
  end
@@ -1,4 +1,5 @@
1
1
  require 'forwardable'
2
+ require_relative '../exceptions'
2
3
 
3
4
  module Inferno
4
5
  module Repositories
@@ -8,7 +9,10 @@ module Inferno
8
9
  def_delegators 'self.class', :all, :all_by_id
9
10
 
10
11
  def insert(entity)
12
+ raise Exceptions::DuplicateEntityIdException, entity.id if exists?(entity.id)
13
+
11
14
  all << entity
15
+ all_by_id[entity.id.to_s] = entity
12
16
  entity
13
17
  end
14
18
 
@@ -17,7 +21,7 @@ module Inferno
17
21
  end
18
22
 
19
23
  def exists?(id)
20
- all_by_id.include? id
24
+ all_by_id.key?(id.to_s)
21
25
  end
22
26
 
23
27
  class << self
@@ -28,13 +32,6 @@ module Inferno
28
32
  # @private
29
33
  def all_by_id
30
34
  @all_by_id ||= {}
31
- @all_by_id.length == all.length ? @all_by_id : index_by_id
32
- end
33
-
34
- def index_by_id
35
- @all_by_id = {}
36
- all.each { |klass| @all_by_id[klass.id] = klass }
37
- @all_by_id
38
35
  end
39
36
  end
40
37
  end
@@ -1,4 +1,4 @@
1
1
  module Inferno
2
2
  # Standard patterns for gem versions: https://guides.rubygems.org/patterns/
3
- VERSION = '0.4.44'.freeze
3
+ VERSION = '0.5.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inferno_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.44
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen MacVicar
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-10-29 00:00:00.000000000 Z
13
+ date: 2024-11-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -541,7 +541,6 @@ files:
541
541
  - lib/inferno/jobs/invoke_validator_session.rb
542
542
  - lib/inferno/jobs/resume_test_run.rb
543
543
  - lib/inferno/public/0e0b993fd6ff351f435ff1c2938daf2d.png
544
- - lib/inferno/public/175.bundle.js
545
544
  - lib/inferno/public/217.bundle.js
546
545
  - lib/inferno/public/237.bundle.js
547
546
  - lib/inferno/public/a5cd39450ab0336db73c5e57228b649d.png
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkinferno_web_app=self.webpackChunkinferno_web_app||[]).push([[175],{9175:(t,e,n)=>{n.r(e),n.d(e,{getCLS:()=>d,getFCP:()=>m,getFID:()=>v,getLCP:()=>h,getTTFB:()=>S});var i,a,r=function(t){return{name:t,value:arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,delta:0,entries:[],id:"".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),isFinal:!1}},o=function(t,e){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((function(t){return t.getEntries().map(e)}));return n.observe({type:t,buffered:!0}),n}}catch(t){}},s=!1,u=!1,c=function(t){s=!t.persisted},p=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u||(addEventListener("pagehide",c),addEventListener("beforeunload",(function(){})),u=!0),addEventListener("visibilitychange",(function(e){var n=e.timeStamp;"hidden"===document.visibilityState&&t({timeStamp:n,isUnloading:s})}),{capture:!0,once:e})},l=function(t,e,n,i){var a;return function(){n&&e.isFinal&&n.disconnect(),e.value>=0&&(i||e.isFinal||"hidden"===document.visibilityState)&&(e.delta=e.value-(a||0),(e.delta||e.isFinal||void 0===a)&&(t(e),a=e.value))}},d=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=r("CLS",0),a=function(t){t.hadRecentInput||(i.value+=t.value,i.entries.push(t),e())},s=o("layout-shift",a);s&&(e=l(t,i,s,n),p((function(t){var n=t.isUnloading;s.takeRecords().map(a),n&&(i.isFinal=!0),e()})))},f=function(){return void 0===i&&(i="hidden"===document.visibilityState?0:1/0,p((function(t){var e=t.timeStamp;return i=e}),!0)),{get timeStamp(){return i}}},m=function(t){var e,n=r("FCP"),i=f(),a=o("paint",(function(t){"first-contentful-paint"===t.name&&t.startTime<i.timeStamp&&(n.value=t.startTime,n.isFinal=!0,n.entries.push(t),e())}));a&&(e=l(t,n,a))},v=function(t){var e=r("FID"),n=f(),i=function(t){t.startTime<n.timeStamp&&(e.value=t.processingStart-t.startTime,e.entries.push(t),e.isFinal=!0,s())},a=o("first-input",i),s=l(t,e,a);a?p((function(){a.takeRecords().map(i),a.disconnect()}),!0):window.perfMetrics&&window.perfMetrics.onFirstInputDelay&&window.perfMetrics.onFirstInputDelay((function(t,i){i.timeStamp<n.timeStamp&&(e.value=t,e.isFinal=!0,e.entries=[{entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+t}],s())}))},g=function(){return a||(a=new Promise((function(t){return["scroll","keydown","pointerdown"].map((function(e){addEventListener(e,t,{once:!0,passive:!0,capture:!0})}))}))),a},h=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=r("LCP"),a=f(),s=function(t){var n=t.startTime;n<a.timeStamp?(i.value=n,i.entries.push(t)):i.isFinal=!0,e()},u=o("largest-contentful-paint",s);if(u){e=l(t,i,u,n);var c=function(){i.isFinal||(u.takeRecords().map(s),i.isFinal=!0,e())};g().then(c),p(c,!0)}},S=function(t){var e,n=r("TTFB");e=function(){try{var e=performance.getEntriesByType("navigation")[0]||function(){var t=performance.timing,e={entryType:"navigation",startTime:0};for(var n in t)"navigationStart"!==n&&"toJSON"!==n&&(e[n]=Math.max(t[n]-t.navigationStart,0));return e}();n.value=n.delta=e.responseStart,n.entries=[e],n.isFinal=!0,t(n)}catch(t){}},"complete"===document.readyState?setTimeout(e,0):addEventListener("pageshow",e)}}}]);