Socket
Book a DemoInstallSign in
Socket

gitmoji-regex

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitmoji-regex

1.0.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

The Gitmoji Logo by Carlos Cuesta, MIT The Regular Expression OOjs UI Icon by GOJU, MIT via Wikimedia Commons gitmoji-regex Logo by Aboling0, CC BY-SA 4.0 ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5 Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0

😜 Gitmoji::Regex

Version License: MIT Downloads Rank Open Source Helpers Coveralls Test Coverage CodeCov Test Coverage QLTY Test Coverage QLTY Maintainability CI Heads CI Current CI Truffle Ruby CI JRuby Deps Locked Deps Unlocked CI Supported CI Legacy CI Unsupported CI Ancient CI Test Coverage CI Style

If ☝️ ci_badges.map(&:color).detect { it != "green" } let me know, as I may have missed the discord notification.

OTOH, if ci_badges.map(&:color).all? { it == "green" } 👇️ send money so I can do more of this. FLOSS is now my full-time job.

Liberapay Goal Progress Sponsor Me on Github Buy me a coffee Donate on Polar Donate to my FLOSS or refugee efforts at ko-fi.com Donate to my FLOSS or refugee efforts using Patreon

🌻 Synopsis

This gem provides a regex that allows Ruby code to test a string for a Gitmoji character. Gitmoji is a subset of the Unicode Emoji character set. This gem is not a fork of, but was inspired by, the wonderful emoji_regex gem.

You can use this regular expression to validate commit messages or extract leading gitmoji from strings.

# character at position 0 is a Gitmoji!
"🔥" =~ Gitmoji::Regex::REGEX # => 0

# (0 is the index of the match, so it means valid!)
(Gitmoji::Regex::REGEX =~ "✨ Add feature").zero? #=> true

# Scan for Gitmoji
"✨ Fix bug 🐛".scan(Gitmoji::Regex::REGEX) #=> ["✨", "🐛"]
🚚 Amazing test matrix was brought to you by🔎 appraisal2 🔎
👟 Check it out!github.com/appraisal-rb/appraisal2

💡 Info you can shake a stick at

Federated DVCS

Find this repo on other forges (Coming soon!)
Federated DVCS RepositoryStatusIssuesPRsWikiCIDiscussions
🧪 galtzo-floss/gitmoji-regex on GitLabThe Truth💚💚💚🏀 Tiny Matrix
🧊 galtzo-floss/gitmoji-regex on CodeBergAn Ethical Mirror (Donate)💚💚⭕️ No Matrix
🐙 galtzo-floss/gitmoji-regex on GitHubA Dirty Mirror💚💚💯 Full Matrix💚
🎮️ Discord ServerLive Chat on DiscordLet'stalkaboutthislibrary!

Enterprise Support Tidelift

Need enterprise-level guarantees?

Get help from me on Tidelift

  • 💡Subscribe for support guarantees covering all FLOSS dependencies
  • 💡Tidelift is part of Sonar
  • 💡Tidelift pays maintainers to maintain the software you depend on!
    📊@Pointy Haired Boss: An enterprise support subscription is "never gonna let you down", and supports open source maintainers

Alternatively:

  • Live Chat on Discord
  • Get help from me on Upwork
  • Get help from me on Codementor
Tokens to RememberGem name Gem namespace
Works with JRubyJRuby 9.1 Compat JRuby 9.2 Compat
JRuby 9.3 Compat JRuby 9.4 Compat JRuby 10.0 Compat JRuby HEAD Compat
Works with Truffle RubyTruffle Ruby 22.3 Compat
Truffle Ruby 23.0 Compat Truffle Ruby 23.1 Compat Truffle Ruby 24.1 Compat
Works with MRI Ruby 3Ruby 3.0 Compat Ruby 3.1 Compat Ruby 3.2 Compat Ruby 3.3 Compat Ruby 3.4 Compat Ruby HEAD Compat
Works with MRI Ruby 2Ruby 2.3 Compat Ruby 2.4 Compat Ruby 2.5 Compat Ruby 2.6 Compat Ruby 2.7 Compat
SourceSource on GitLab.com Source on CodeBerg.org Source on Github.com The best SHA: dQw4w9WgXcQ!
DocumentationCurrent release on RubyDoc.info YARD on Galtzo.com Maintainer Blog Wiki
ComplianceLicense: MIT 📄ilo-declaration-img Security Policy Contributor Covenant 2.1 SemVer 2.0.0
StyleEnforced Code Style Linter Keep-A-Changelog 1.0.0 Gitmoji Commits Compatibility appraised by: appraisal2
SupportLive Chat on Discord Get help from me on Upwork Get help from me on Codementor
Maintainer 🎖️Follow Me on LinkedIn Follow Me on Ruby.Social Follow Me on Bluesky Contact Maintainer My technical writing
... 💖Find Me on WellFound: Find Me on CrunchBase My LinkTree More About Me 🧊 🐙 🛖 🧪

✨ Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add gitmoji-regex

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install gitmoji-regex

🔒 Secure Installation

For Medium or High Security Installations

This gem is cryptographically signed, and has verifiable SHA-256 and SHA-512 checksums by stone_checksums. Be sure the gem you install hasn’t been tampered with by following the instructions below.

Add my public key (if you haven’t already, expires 2045-04-29) as a trusted certificate:

gem cert --add <(curl -Ls https://raw.github.com/galtzo-floss/certs/main/pboling.pem)

You only need to do that once. Then proceed to install with:

gem install gitmoji-regex -P HighSecurity

The HighSecurity trust profile will verify signed gems, and not allow the installation of unsigned dependencies.

If you want to up your security game full-time:

bundle config set --global trust-policy MediumSecurity

MediumSecurity instead of HighSecurity is necessary if not all the gems you use are signed.

NOTE: Be prepared to track down certs for signed gems and add them the same way you added mine.

⚙️ Configuration

Not needed.

🔧 Basic Usage

Usage

"🔥" =~ Gitmoji::Regex::REGEX
# => 0 # character at position 0 is a Gitmoji!

"fire" =~ Gitmoji::Regex::REGEX
# => nil

(Gitmoji::Regex::REGEX =~ "✨ Add feature")
# => 0

"✨ Fix bug 🐛".scan(Gitmoji::Regex::REGEX)
# => ["✨", "🐛"]

I use this gem to validate gitmoji at the first character of each commit message in a git pre-commit-hook. I blogged about the pattern I follow. Although that post was before I adopted Gitmoji for commits, it should be obvious how to integrate it. I'll write a new blog post soon with my current commit hooks. If you can't wait, you can find what I currently use in this repo: .git-hooks.

🦷 FLOSS Funding

How wonderful it is that nobody need wait a single moment before starting to improve the world.
—Anne Frank

I’m driven by a passion to foster a thriving open-source community – a space where people can tackle complex problems, no matter how small. Revitalizing libraries that have fallen into disrepair, and building new libraries focused on solving real-world challenges, are my passions — totaling 79 hours of FLOSS coding over just the past seven days, a pretty regular week for me. I was recently affected by layoffs, and the tech jobs market is unwelcoming. I’m reaching out here because your support would significantly aid my efforts to provide for my family, and my farm (11 🐔 chickens, 2 🐶 dogs, 3 🐰 rabbits, 8 🐈‍ cats).

If you work at a company that uses my work, please encourage them to support me as a corporate sponsor. My work on gems you use might show up in bundle fund.

I’m developing a new library, floss_funding, designed to empower open-source developers like myself to get paid for the work we do, in a sustainable way. Please give it a look.

Floss-Funding.dev: 👉️ No network calls. 👉️ No tracking. 👉️ No oversight. 👉️ Minimal crypto hashing. 💡 Easily disabled nags

Liberapay Goal Progress Donate on PayPal Sponsor Me on Github Buy me a coffee Donate on Polar Donate to my FLOSS or refugee efforts at ko-fi.com Donate to my FLOSS or refugee efforts using Patreon

🔐 Security

See SECURITY.md.

🤝 Contributing

If you need some ideas of where to help, you could work on adding more code coverage, or if it is already 💯 (see below) check reek, issues, or PRs, or use the gem and think about how it could be better.

We Keep A Changelog so if you make changes, remember to update it.

See CONTRIBUTING.md for more detailed instructions.

🚀 Release Instructions

See CONTRIBUTING.md.

Code Coverage

Coverage Graph

Coveralls Test Coverage

QLTY Test Coverage

🪇 Code of Conduct

Everyone interacting with this project's codebases, issue trackers, chat rooms and mailing lists agrees to follow the Contributor Covenant 2.1.

🌈 Contributors

Contributors

Made with contributors-img.

Also see GitLab Contributors: https://gitlab.com/galtzo-floss/gitmoji-regex/-/graphs/main

⭐️ Star History Star History Chart

📌 Versioning

This Library adheres to Semantic Versioning 2.0.0. Violations of this scheme should be reported as bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, a new version should be immediately released that restores compatibility. Breaking changes to the public API will only be introduced with new major versions.

dropping support for a platform is both obviously and objectively a breaking change
—Jordan Harband (@ljharb, maintainer of SemVer) in SemVer issue 716

I understand that policy doesn't work universally ("exceptions to every rule!"), but it is the policy here. As such, in many cases it is good to specify a dependency on this library using the Pessimistic Version Constraint with two digits of precision.

For example:

spec.add_dependency("gitmoji-regex", "~> 1.0")
📌 Is "Platform Support" part of the public API? More details inside.

SemVer should, but doesn't explicitly, say that dropping support for specific Platforms is a breaking change to an API. It is obvious to many, but not all, and since the spec is silent, the bike shedding is endless.

To get a better understanding of how SemVer is intended to work over a project's lifetime, read this article from the creator of SemVer:

See CHANGELOG.md for a list of releases.

📄 License

The gem is available as open source under the terms of the MIT License License: MIT. See LICENSE.txt for the official Copyright Notice.

🤑 A request for help

Maintainers have teeth, and need to pay their dentists. After getting laid off in an RIF in March, and filled with many dozens of rejections, I'm now spending ~80 hours a week building open source tools. I'm hoping to be able to pay for my kids' health insurance this month, so if you value the work I am doing, please help. I need your support. Please consider sponsoring me.

Sponsor me on GitHub Sponsors 💌 Sponsor me on Liberapay 💌 Donate on PayPal

To say "thanks for maintaining such a great tool" 👇️ Join the Discord or ☝️ send money.

To join the community or get help 👇️ Join the Discord.

Live Chat on Discord

Thanks for RTFM. ☺️

FAQs

Package last updated on 20 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.