Skip to content

Conversation

@danny-beton-lrn
Copy link
Contributor

This PR adds a UUID generation utility (Learnosity::Sdk::Uuid.generate()) to the Ruby SDK, achieving feature parity with the Python and other SDKs. While the implementation is a lightweight wrapper around Ruby's existing SecureRandom.uuid, it provides consistency across Learnosity SDKs, allowing developers to use the same API patterns regardless of language. All documentation and examples have been updated to use the new SDK utility instead of requiring the external securerandom package directly. This is a non-breaking, purely additive change that simplifies the developer experience for new users following tutorials while maintaining backward compatibility for existing implementations. All tests pass.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a UUID generation utility (Learnosity::Sdk::Uuid.generate()) to the Ruby SDK, providing feature parity with other Learnosity SDKs. The implementation wraps Ruby's SecureRandom.uuid in a consistent API pattern, simplifying the developer experience while maintaining backward compatibility.

Key changes:

  • Added Learnosity::Sdk::Utils::Uuid class with generate() method
  • Updated all documentation and examples to use the new SDK utility
  • Comprehensive test coverage for the UUID utility

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/learnosity/sdk/utils/uuid.rb New UUID utility class wrapping SecureRandom.uuid
lib/learnosity/sdk.rb Exports Uuid utility for convenient access as Learnosity::Sdk::Uuid
spec/learnosity/sdk/utils/uuid_spec.rb Comprehensive test suite for UUID generation and uniqueness
examples/simple/uuid_example.rb Example demonstrating UUID utility usage
docs/quickstart/lrn-sdk-rails/app/controllers/*.rb Updated controllers to use SDK UUID utility instead of SecureRandom directly
REFERENCE.md Updated documentation to feature SDK UUID utility with SecureRandom as alternative
README.md Updated quickstart guide to reference new UUID utility
ChangeLog.md Documents the new UUID utility feature and documentation updates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@anthony-murphy-lrn anthony-murphy-lrn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the failing test cases

@danny-beton-lrn danny-beton-lrn merged commit b0ecd43 into master Jan 7, 2026
3 checks passed
@danny-beton-lrn danny-beton-lrn deleted the LRN-49157/feature/ruby_uuid_util branch January 7, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants