lwes 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +3 -0
- data/ext/lwes/emitter.c +10 -3
- data/lib/lwes.rb +3 -1
- data/lwes.gemspec +1 -1
- data/test/unit/test_emitter.rb +5 -0
- metadata +2 -2
data/ChangeLog
CHANGED
data/ext/lwes/emitter.c
CHANGED
@@ -338,9 +338,16 @@ static VALUE _create(VALUE self, VALUE options)
|
|
338
338
|
_address = RSTRING_PTR(address);
|
339
339
|
|
340
340
|
iface = rb_hash_aref(options, ID2SYM(rb_intern("iface")));
|
341
|
-
|
342
|
-
|
343
|
-
|
341
|
+
switch (TYPE(iface)) {
|
342
|
+
case T_NIL:
|
343
|
+
_iface = NULL;
|
344
|
+
break;
|
345
|
+
case T_STRING:
|
346
|
+
_iface = RSTRING_PTR(iface);
|
347
|
+
break;
|
348
|
+
default:
|
349
|
+
rb_raise(rb_eTypeError, ":iface must be a String or nil");
|
350
|
+
}
|
344
351
|
|
345
352
|
port = rb_hash_aref(options, ID2SYM(rb_intern("port")));
|
346
353
|
if (TYPE(port) != T_FIXNUM)
|
data/lib/lwes.rb
CHANGED
data/lwes.gemspec
CHANGED
data/test/unit/test_emitter.rb
CHANGED
@@ -11,6 +11,11 @@ class TestEmitter < Test::Unit::TestCase
|
|
11
11
|
@options = LISTENER_DEFAULTS.dup
|
12
12
|
end
|
13
13
|
|
14
|
+
def test_nil_iface
|
15
|
+
@options.delete(:iface)
|
16
|
+
assert_instance_of LWES::Emitter, LWES::Emitter.new(@options)
|
17
|
+
end
|
18
|
+
|
14
19
|
def test_initialize
|
15
20
|
assert_instance_of LWES::Emitter, LWES::Emitter.new(@options)
|
16
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lwes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik S. Chang
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-12-
|
13
|
+
date: 2009-12-14 00:00:00 +00:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|