Skip to content

Release 1.6.0#61

Merged
0jonjo merged 1 commit intomainfrom
release/1.6.0
Oct 12, 2025
Merged

Release 1.6.0#61
0jonjo merged 1 commit intomainfrom
release/1.6.0

Conversation

@0jonjo
Copy link
Owner

@0jonjo 0jonjo commented Oct 12, 2025

This pull request introduces several improvements and updates to the calcpace gem, focusing on enhanced input validation, expanded and more flexible unit conversion functionality, improved documentation, and updated dependencies. The most significant changes are grouped below.

Unit Conversion Enhancements:

  • The convert and constant methods in lib/calcpace/converter.rb now accept both symbol and string unit formats (e.g., :km_to_mi or 'km to mi'). A new format_unit method normalizes string inputs, and the converter now supports 42 units. The list_all, list_speed, and list_distance methods now return hashes mapping unit keys to human-readable descriptions instead of arrays. [1] [2]
  • The test suite in test/calcpace/test_converter.rb has been updated to test string-based unit conversions, verify the new hash output of list methods, and check the content of the returned hashes.

Input Validation Improvements:

  • Validation methods in lib/calcpace/calculator.rb now pass argument names to validate_positive, which in turn calls check_positive with descriptive names. This results in more informative error messages, e.g., "Distance must be a positive number". [1] [2] [3] [4] [5]
  • The check_positive method in lib/calcpace/checker.rb now accepts an argument name and uses it in error messages.

Documentation Updates:

  • The README.md has been updated to reflect the new version (1.6.0), expanded unit support, new input formats for conversion, updated examples, and clarified return values for listing methods. Error message documentation has also been updated for accuracy. [1] [2] [3] [4] [5]

Version and Dependency Updates:

  • The Ruby version is updated to 3.4.4 in .ruby-version and .tool-versions, and Node.js 24.1.0 is added to .tool-versions. [1] [2]
  • The gem version is bumped to 1.6.0 in both lib/calcpace/version.rb and README.md. The gemspec is updated to freeze string literals. [1] [2]

These changes collectively improve the usability, flexibility, and clarity of the calcpace gem for both developers and end users.

… README and tests. Convert with strings, and better handle errors (1.6.0)
@0jonjo 0jonjo self-assigned this Oct 12, 2025
@0jonjo 0jonjo added the enhancement New feature or request label Oct 12, 2025
@0jonjo 0jonjo merged commit 34cc4ed into main Oct 12, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant