Gitmoji::Regex
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.
Project | bundle add gitmoji-regex | |
---|---|---|
1️⃣ | name, license, docs, standards | <!----> |
2️⃣ | version & activity | <!----> |
3️⃣ | maintenance & linting | |
4️⃣ | testing | |
5️⃣ | coverage & security | |
6️⃣ | resources | |
7️⃣ | spread 💖 | 🌏 👼 |
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
Usage
"🔥" =~ Gitmoji::Regex::REGEX
# => 0 # character at position 0 is a Gitmoji!
"fire" =~ Gitmoji::Regex::REGEX
# => nil
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
To update the cached src/gitmojis.json
load the console with bin/console
, and run:
Gitmoji::Regex::Reference.instance.write_json
Contributing
See CONTRIBUTING.md
Contributors
Made with contributors-img.
License
The gem is available as open source under the terms of the MIT License . See LICENSE for the official Copyright Notice.
- Copyright (c) 2022 Peter H. Boling of Rails Bling
NOTE: the gitmoji project is also MIT Licensed, and the file src/gitmojis.json
comes from that project.
Code of Conduct
Everyone interacting in the Gitmoji::Regex project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
Versioning
This library aims to adhere 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.
As a result of this policy, you can (and should) specify a dependency on this gem using the Pessimistic Version Constraint with two digits of precision.
For example:
spec.add_dependency "gitmoji-regex", "~> 1.0"
Security
See SECURITY.md.