Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UuidManagement and Callable #1

Merged
merged 44 commits into from
Jan 31, 2024

Conversation

benjaminoakes
Copy link
Contributor

@benjaminoakes benjaminoakes commented Jan 31, 2024

Starting TrackBallast with two commonly used modules: UuidManagement and Callable

The intention is to start using these versions internally. All commits have been crafted with the intention of being made public, open source code.

# include TrackBallast::UuidManagement
# end
#
module UuidManagement
Copy link
Contributor Author

@benjaminoakes benjaminoakes Jan 31, 2024

Choose a reason for hiding this comment

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

What this is expected to look like on https://www.rubydoc.info/

Screenshot 2024-01-30 at 16 27 09

Copy link

@jeffgran-dox jeffgran-dox left a comment

Choose a reason for hiding this comment

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

lgtm

@benjaminoakes benjaminoakes merged commit 5b2436a into master Jan 31, 2024
@benjaminoakes benjaminoakes deleted the benjaminoakes/add-uuid-management-and-callable branch January 31, 2024 18:30
require "track_ballast/version"

module TrackBallast
class Error < StandardError; end
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to start with a logger as well.

Copy link
Member

Choose a reason for hiding this comment

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

I think you meant to use the lib/track_ballast/error.rb class?

Copy link
Contributor Author

@benjaminoakes benjaminoakes Jan 31, 2024

Choose a reason for hiding this comment

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

I think you meant to use the lib/track_ballast/error.rb class?

You're right, I did! Will follow up on that

# This will short-circuit to be `@logger` on future runs
@logger = Rails.logger
else
raise NoLoggerError, "TrackBallast.logger is not configured"
Copy link
Member

Choose a reason for hiding this comment

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

Consider making this logger core to the TrackBallast module instead of raising here.

Copy link
Contributor Author

@benjaminoakes benjaminoakes Jan 31, 2024

Choose a reason for hiding this comment

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

Ah, this is perhaps something that could stand to be clarified in the README.

This method will raise because the TrackBallast.logger method could not locate a suitable logger to use. Typically, it will default to Rails.logger, but it could also be whatever the client of this gem decides is best. (For example, the client application could choose to route all TrackBallast logs elsewhere.) My thinking is that it's not appropriate to completely set up a logger within this library because we don't know the circumstances in which the code is run (besides running tests, of course).

Hopefully I'm understanding your comments correctly. 😄 If I'm not, let's circle up on DMs to discuss.

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