{"id":23976008,"url":"https://github.com/ersync/string-magic","last_synced_at":"2026-06-15T08:31:14.440Z","repository":{"id":270611792,"uuid":"835045088","full_name":"ersync/string-magic","owner":"ersync","description":"A Ruby gem to supercharge string with enhanced formatting and utilities.","archived":false,"fork":false,"pushed_at":"2025-08-14T07:33:19.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-26T05:12:13.355Z","etag":null,"topics":["gem","ruby","string"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/string_magic","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ersync.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-29T03:44:26.000Z","updated_at":"2025-08-14T07:19:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"27a6e84e-97cf-4ca4-979d-1ec83249710a","html_url":"https://github.com/ersync/string-magic","commit_stats":null,"previous_names":["erscript/string-magic"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ersync/string-magic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersync%2Fstring-magic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersync%2Fstring-magic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersync%2Fstring-magic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersync%2Fstring-magic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ersync","download_url":"https://codeload.github.com/ersync/string-magic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersync%2Fstring-magic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34355157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gem","ruby","string"],"created_at":"2025-01-07T06:55:39.097Z","updated_at":"2026-06-15T08:31:14.423Z","avatar_url":"https://github.com/ersync.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StringMagic - v0.5.0\n[![Gem Version](https://badge.fury.io/rb/string_magic.svg)](https://badge.fury.io/rb/string_magic)\n[![Build Status](https://dl.circleci.com/status-badge/img/circleci/8MamMcAVAVNWTcUqkjQk7R/Sh2DQkMWqqCv4MFvAmYWDL/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/circleci/8MamMcAVAVNWTcUqkjQk7R/Sh2DQkMWqqCv4MFvAmYWDL/tree/main)\n[![License: MIT](https://img.shields.io/badge/License-MIT-lightgreen.svg)](LICENSE)\n\n**StringMagic** super-charges Ruby's `String` with batteries-included helpers for formatting, validation, analysis, transformation, and security all in one tidy gem.\n\n## Why StringMagic?\n- Zero dependencies – pure Ruby\n- Non-destructive: original strings are never mutated\n- Thread-safe \u0026 fully tested (160+ RSpec examples, ~98% coverage)\n- Drop-in: optionally auto-mixes into String, or use module methods (`StringMagic.to_slug(...)`)\n\n## Quickstart Cheatsheet\n\n```ruby\n# Formatting\n\"Hello world\".truncate_words(1)             # =\u003e \"Hello...\"\n\"user@domain.com\".mask_emails               # =\u003e \"u********@domain.com\"\n\"Ruby on Rails\".highlight('Ruby')           # =\u003e \"\u003cmark\u003eRuby\u003c/mark\u003e on Rails\"\n\n# Validation\n\"test@example.com\".email?                   # =\u003e true\n\"4111111111111111\".credit_card?             # =\u003e true\n\"racecar\".palindrome?                       # =\u003e true\n\n# Transformation\n\"CamelCase\".to_snake_case                   # =\u003e \"camel_case\"\n\"user input\".to_filename_safe               # =\u003e \"user_input\"\n\"second\".ordinalize                         # =\u003e \"2nd\"\n\n# Analysis\n\"Visit https://example.com\".extract_urls    # =\u003e [\"https://example.com\"]\n\"Great product!\".sentiment_indicators       # =\u003e {:positive=\u003e1.0, :negative=\u003e0.0, :neutral=\u003e0}\n```\n\n## Installation\n```bash\ngem install string_magic\n```\nOr add to your Gemfile:\n```ruby\ngem 'string_magic'\n```\n\n## Full Documentation\n\n### Core Operations\n- **Case conversion**: `to_snake_case`, `to_kebab_case`, `to_camel_case`, `to_pascal_case`, `to_title_case`\n- **Text manipulation**: `reverse_words`, `alternating_case`, `remove_duplicate_chars`, `remove_duplicate_words`\n- **HTML handling**: `remove_html_tags`, `escape_html`\n\n### Validation\n- Format checks: `email?`, `url?`, `phone?`, `credit_card?`\n- Text relations: `palindrome?`, `anagram_of?`\n- Password strength: `strong_password?`\n\n### Analysis\n- **Entity extraction**: `extract_emails`, `extract_urls`, `extract_phones`, `extract_dates`\n- **Text metrics**: `readability_score`, `word_frequency`, `sentiment_indicators`\n\n### Formatting\n- **Truncation**: `truncate_words`, `truncate_sentences`, `truncate_characters`, `smart_truncate`\n- **Highlighting**: `highlight`, `remove_highlights`, `highlight_urls`\n\n### Security\n- **Data masking**: `mask_sensitive_data`, `mask_credit_cards`, `mask_emails`, `mask_phones`\n- **Detection**: `contains_sensitive_data?`\n\n### Utilities\n- **Inflection**: `to_plural`, `to_singular`, `ordinalize`, `humanize`\n- **Slug generation**: `to_slug`, `to_url_slug`, `to_filename_safe`\n\n## Contributing\n1. Fork → `git checkout -b feature/awesome`\n2. Add specs for your change\n3. `bundle exec rspec`\n4. PR ✉️ – we love improvements!\n\n## License\nMIT - See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fersync%2Fstring-magic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fersync%2Fstring-magic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fersync%2Fstring-magic/lists"}