crystal-ruby_exts

Writing ruby extensions in Crystal

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
Repository

crystal-ruby_exts

Owner
Statistic
  • 5
  • 1
  • 0
  • 0
  • 0
  • almost 8 years ago
  • December 4, 2016
License

MIT License

Links
Synced at

Sun, 17 Nov 2024 17:39:51 GMT

Languages