Skip to content

Latest commit

 

History

History
39 lines (23 loc) · 718 Bytes

README.md

File metadata and controls

39 lines (23 loc) · 718 Bytes

Crystal Gem Template

A working* demo Ruby gem, written in Crystal.

Usage:

# Gemfile
gem "crystal_gem_template", git: "https://github.com/johansenja/crystal_gem_template.git"

then

bundle install

then

# app.rb
require 'crystal_gem_template'

include CrystalGemTemplate

hello('world') # => "hello world"

then

bundle exec ruby app.rb # => hello world

Not a lot going on here, clearly, but this opens the door for performant code written in Crystal, then used in Ruby apps, going via Ruby's C API.

Example as a functional gem:

levenshtein_str


*note: tested and used on MacOS, so probably doesn't work on Linux! (yet)