I have Rails 4 application. I created simple C extension with Ruby C API
This extension convert file from data
folder and returns output based on that file(some_file.f
)
|-- data
| |--some_file.f
|-- ext
| `-- my_ext
| |-- extconf.rb
| |-- some_lib.c
| `-- my_ext.c
|-- lib
Right now when I want to use that extension I need to run following commands in my_ext
dir
ruby extconf.rb
make
Then I have additional .o
.bundle
complied files. I also created initialiser with require 'my_ext/my_ext'
Where should I move these files? Into
lib/my_ext
?Is there a way to improve that compile process and better organise complied files? In future I would like to add also tests and run them after extension compiled. Maybe I should create a gem from that extension? Or rake task?
I read http://tenderlovemaking.com/2009/12/18/writing-ruby-c-extensions-part-1.html this tutorial but how to implement that in Rails application? Where to put Rakefile?