Add Badge class for fetching status badges from Cronitor API#33
Open
jwaldermo wants to merge 1 commit intocronitorio:masterfrom
Open
Add Badge class for fetching status badges from Cronitor API#33jwaldermo wants to merge 1 commit intocronitorio:masterfrom
jwaldermo wants to merge 1 commit intocronitorio:masterfrom
Conversation
Add support for fetching status badges via the Cronitor Badges API. Badges are indexed by tag and can be used to display monitor health status in dashboards and other interfaces. New features: - Cronitor::Badge.all - Fetch all badges, returns Hash<tag, Badge> - Badge#key - Extract badge key from SVG URL for building embed URLs - Supports both standard and detailed badge URL formats Includes comprehensive test coverage and README documentation. Bumps version to 5.4.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for fetching status badges via the Cronitor Badges API. This allows users to programmatically retrieve badge information for displaying monitor health status in dashboards and other interfaces.
New Features
Cronitor::Badge.all- Fetch all badges from the API, returns a Hash indexed by tag nameBadge#tag- The tag name associated with the badgeBadge#svg_url- Direct URL to the badge SVG imageBadge#url- Alternative URL for the badgeBadge#key- Extract the badge key from the SVG URL (useful for constructing embed URLs)Usage
Changes
lib/cronitor/badge.rb- New Badge classlib/cronitor.rb- Added require for badge modulelib/cronitor/version.rb- Bumped version to 5.4.0spec/cronitor_spec.rb- Added 16 comprehensive testsREADME.md- Added documentation for badge fetchingTest Plan