en14960 0.4.0 → 0.4.2

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: fda15828cb9885998e0aa06bb8cff2621e0dd3cbdd5ed5a717a102988f04ecb9
4
- data.tar.gz: c9d0d2184b17fad322ca86a7ac19e978c7918ef1d2d412881072feb1ee995491
3
+ metadata.gz: 3220910f74f8d578db2a99f5900e5d4bdc4aa800b54098ea1c69a26d1de72f04
4
+ data.tar.gz: 22add5465f6d3769afbc8863976626f1b2b162b58a7474246214329871110197
5
5
  SHA512:
6
- metadata.gz: bf879fdb5e594c2078c14959a2d2c1040afcefe051edfa42156b623fc0d66583ee48c8baf2ca81f91894cacbfee840deb4c7f4863cceb9260c927305a9332ed8
7
- data.tar.gz: 73699ce3ae6651564d4641b6746e8819b57c3a0c8938990bd11b4783156bfa5f0fd339281eb00518d3abe23f2284b56f1a61de11612b6692e0d2b32fea3ffa1c
6
+ metadata.gz: 63ec6ca760d7e4c6503e6e867ec8c1ae01781713e5e0fdb3757f119d93b33ebeb4ca3f172c492b4d1bd9c9c9b861dfb4f06ece491f3320468487e1dce5f35eb4
7
+ data.tar.gz: eb1ffc995d295e01457a6aa81006219bfd5fc2ca3c9714fd0936d83f952acf247c95ff1b931ea1316177ee2a71e2cd6ea7a9b65f094c726b4f93d1bedbae85b2
data/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.1] - 2025-08-16
11
+
12
+ ### Fixed
13
+ - Fixed TypeError when `calculate_wall_height` is called with platform_height < 0.6m
14
+ - Method now correctly returns Float 0.0 instead of Integer 0
15
+ - Added test coverage for the "no walls required" edge case
16
+
17
+ ## [0.4.0] - Previous Release
18
+
10
19
  ### Added
11
20
  - Full Sorbet type signatures for all public APIs
12
21
  - Runtime type checking with sorbet-runtime
@@ -33,7 +33,7 @@ module EN14960
33
33
  # highest platform (measured from ground level), with an absolute minimum of 300mm
34
34
  # Line 936: If a stop-wall is installed at the runout's end, an additional
35
35
  # 50cm must be added to the total runout length
36
- return CalculatorResponse.new(value: 0, value_suffix: "m", breakdown: []) if platform_height <= 0
36
+ return CalculatorResponse.new(value: 0.0, value_suffix: "m", breakdown: []) if platform_height <= 0
37
37
 
38
38
  # Get constants
39
39
  height_ratio = Constants::RUNOUT_CALCULATION_CONSTANTS[:platform_height_ratio]
@@ -113,7 +113,7 @@ module EN14960
113
113
  sig { params(platform_height: Float, user_height: Float, has_permanent_roof: T.nilable(T::Boolean)).returns(CalculatorResponse) }
114
114
  def calculate_wall_height_requirements(platform_height, user_height, has_permanent_roof = nil)
115
115
  # EN 14960-1:2019 Section 4.2.9 (Lines 854-887) - Containment requirements
116
- return CalculatorResponse.new(value: 0, value_suffix: "m", breakdown: []) if platform_height <= 0 || user_height <= 0
116
+ return CalculatorResponse.new(value: 0.0, value_suffix: "m", breakdown: []) if platform_height <= 0 || user_height <= 0
117
117
 
118
118
  # Get requirement details and breakdown
119
119
  requirement_details = get_wall_height_requirement_details(platform_height, user_height, has_permanent_roof)
@@ -261,14 +261,14 @@ module EN14960
261
261
 
262
262
  case platform_height
263
263
  when 0..thresholds[:no_walls_required]
264
- 0 # No walls required
264
+ 0.0 # No walls required
265
265
  when (thresholds[:no_walls_required]..thresholds[:basic_walls])
266
266
  user_height # Equal to user height
267
267
  when (thresholds[:basic_walls]..thresholds[:enhanced_walls]),
268
268
  (thresholds[:enhanced_walls]..thresholds[:max_safe_height])
269
269
  (user_height * enhanced_multiplier).round(2) # 1.25× user height
270
270
  else
271
- 0 # Exceeds safe limits
271
+ 0.0 # Exceeds safe limits
272
272
  end
273
273
  end
274
274
  end
@@ -2,5 +2,5 @@
2
2
  # typed: strict
3
3
 
4
4
  module EN14960
5
- VERSION = "0.4.0"
5
+ VERSION = "0.4.2"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: en14960
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chobble.com
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-08-16 00:00:00.000000000 Z
11
+ date: 2025-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-runtime