ruby_exts

Version, currently master branch1 version
  • master branchlatestDec 4, 2016

github.com/spalladino/crystal-ruby_exts

Writing ruby extensions in Crystal

5 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  ruby_exts:
    github: spalladino/crystal-ruby_exts
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
0.20.0
License
MIT
Author
Santiago Palladino

Dependencies

This version declares no dependencies.

README

ruby_exts

Write Ruby extensions in Crystal. Built from this gist, based upon manastech/crystal_ruby.

Works with Crystal 0.20.0 and Ruby 2.3.1 on OSX El Capitan, though might work for other versions.

Work in progress.

Installation

Add this to your application's shard.yml:

dependencies:
  ruby_exts:
    github: spalladino/ruby_exts

Sample

Run an irb with the contents of samples/sample.cr with make irb:

$ make irb
irb(main):001:0> coco = Coco.new("3")
=> #<Coco:0x007ff0b3039840>
irb(main):002:0> coco.size
=> 3
irb(main):003:0> get "https://raw.githubusercontent.com/manastech/crystal_ruby/master/README.md"
=> "crystal_ruby\n============\n\nWrite Ruby extensions in Crystal. This is just a [Proof of Concept](http://en.wikipedia.org/wiki/Proof_of_concept).\n"

Usage

Coming soon.

TODO

  • [ ] Write usage documentation
  • [ ] Define macros for writing Ruby classes
  • [ ] Handle inheritance and Crystal generics when being exposing as Ruby classes
  • [ ] Handle Crystal exceptions and rethrow them as Ruby exceptions
  • [ ] Support multiple versions of Ruby
  • [ ] Linux support
  • [ ] Handle invocations from a non-main Ruby thread

Contributing

  1. Fork it ( https://github.com/spalladino/ruby_exts/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • spalladino Santiago Palladino - creator, maintainer