- Ruby 72.8%
- Ragel 22.2%
- C++ 4.9%
- Dockerfile 0.1%
| bin | ||
| ext/dtext | ||
| lib | ||
| test | ||
| .devcontainer.json | ||
| .dockerignore | ||
| .gitattributes | ||
| .gitignore | ||
| Dockerfile | ||
| dtext_rb.gemspec | ||
| Gemfile | ||
| Gemfile.lock | ||
| Rakefile | ||
| README.md | ||
Important
DText was moved to the FemboyFans repository in commit e192f34. See lib/dtext_rb in the FemboyFans repo.
About
Uses the ragel state machine to generate the dtext parsing capabilities of FemboyFans.
Getting started
Most of the changes will only need to touch dtext.rl, the rest of the files will be generated for you by running either rake compile or rake test. Take a look at this unofficial quickstart guide or the complete official documentation if you want to know more about how ragel works.
Releasing a new version for use
Commit the changes to dtext.cpp.rl and the resuling changes in dtext.cpp. Bump the version number in lib/dtext/version.rb. After that is all done you can bundle lock in the FemboyFans repository. It should pick up on the increased version.
To test these changes locally commit them and update the Gemfiles dtext entry. Specifying the commit hash allows you to rebuild the container without having to also increment the version number every time. Don't forget to bundle lock before rebuilding.
gem "dtext_rb", git: "https://github.com/YOUR_FORK/dtext_rb.git", ref: "YOUR_COMMIT_HASH"
Usage
ruby -Ilib -rdtext -e 'puts DText.parse("hello world")'
# => <p>hello world</p>
Installation
sudo apt-get install ruby ruby-dev g++ libc-dev make patch xz-utils
bin/rake install
Development
bin/rake compile
bin/rake test
To build in debug mode:
bin/rake clean
DTEXT_DEBUG=true bin/rake compile
To build with Clang:
MAKE="make --environment-overrides" CXX="/usr/bin/clang++" bin/rake