From 5164f11c951c2447d244a0ada40dec7d39528d27 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Sat, 21 Oct 2023 13:16:29 +0900 Subject: [PATCH] Add odgi.cpp --- .gitignore | 3 --- ext/odgi/odgi.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 ext/odgi/odgi.cpp diff --git a/.gitignore b/.gitignore index 06c0b1d..3907ae9 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,3 @@ *.lock mkmf.log -/ext/odgi/*.cpp -/ext/odgi/*.h - diff --git a/ext/odgi/odgi.cpp b/ext/odgi/odgi.cpp new file mode 100644 index 0000000..fc2c1ad --- /dev/null +++ b/ext/odgi/odgi.cpp @@ -0,0 +1,39 @@ +#include +#include + +#include "version.hpp" + +using namespace Rice; + +// version.hpp + +String get_version() +{ + return String(odgi::Version::get_version()); +} + +String get_release() +{ + return String(odgi::Version::get_release()); +} + +String get_codename() +{ + return String(odgi::Version::get_codename()); +} + +String get_short() +{ + return String(odgi::Version::get_short()); +} + +// odgi.hpp + +extern "C" void Init_odgi(void) +{ + define_module("Odgi") + .define_module_function("get_version", &get_version) + .define_module_function("get_release", &get_release) + .define_module_function("get_codename", &get_codename) + .define_module_function("get_short", &get_short); +}