Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ad71a3
commit d743c58
Showing
10 changed files
with
47 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,7 +1,11 @@ | |||
.*.swp | .*.swp | ||
*.tmproj | *.tmproj | ||
*.o | |||
*.bundle | |||
*.log | |||
vendor/zmq-0.3/ | vendor/zmq-0.3/ | ||
vendor/bin/ | vendor/bin/ | ||
vendor/include/ | vendor/include/ | ||
vendor/lib/ | vendor/lib/ | ||
ext/quail/Makefile | |||
tags | tags |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,10 +1,10 @@ | |||
#include <native.h> | #include <native.h> | ||
|
|
||
VALUE mQuail; | |||
|
|||
void Init_native() | void Init_native() | ||
{ | { | ||
mQuail = rb_define_module("Quail"); | VALUE mQuail = rb_define_module("Quail"); | ||
rb_const_set(mQuail, rb_intern("LOCAL"), INT2NUM(CZMQ_SCOPE_LOCAL)); | rb_const_set(mQuail, rb_intern("LOCAL"), INT2NUM(CZMQ_SCOPE_LOCAL)); | ||
rb_const_set(mQuail, rb_intern("GLOBAL"), INT2NUM(CZMQ_SCOPE_GLOBAL)); | rb_const_set(mQuail, rb_intern("GLOBAL"), INT2NUM(CZMQ_SCOPE_GLOBAL)); | ||
|
|||
Init_Quail_Handle(mQuail); | |||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,18 @@ | |||
#include <quail_handle.h> | |||
|
|||
static void dealloc(void * handle) | |||
{ | |||
czmq_destroy(handle); | |||
} | |||
|
|||
static VALUE new(VALUE klass, VALUE host) | |||
{ | |||
void * handle = czmq_create(StringValuePtr(host)); | |||
return Data_Wrap_Struct(klass, NULL, dealloc, handle); | |||
} | |||
|
|||
void Init_Quail_Handle(VALUE mQuail) | |||
{ | |||
VALUE cQuailHandle = rb_define_class_under(mQuail, "Handle", rb_cObject); | |||
rb_define_singleton_method(cQuailHandle, "new", new, 1); | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,8 @@ | |||
#ifndef QUAIL_HANDLE | |||
#define QUAIL_HANDLE | |||
|
|||
#include <native.h> | |||
|
|||
void Init_Quail_Handle(VALUE mQuail); | |||
|
|||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
require File.expand_path(File.join(File.dirname(__FILE__), "..", "helper")) | |||
|
|||
module Quail | |||
class TestHandle < Quail::TestCase | |||
def test_initialize | |||
assert_nothing_raised { | |||
Quail::Handle.new('localhost.local') | |||
} | |||
end | |||
end | |||
end |