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 CHANGED
@@ -1,3 +1,6 @@
1
+ Version 0.2.2 (erik-s-chang)
2
+ * fix handling of :iface for LWES::Emitter.new
3
+
1
4
  Version 0.2.1 (erik-s-chang)
2
5
  * Emitter#<< for structs
3
6
  * fix full installs OSX
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
- if (TYPE(iface) != T_STRING)
342
- rb_raise(rb_eTypeError, ":iface must be a string");
343
- _iface = RSTRING_PTR(address);
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
@@ -1,5 +1,7 @@
1
1
  module LWES
2
- VERSION = "0.2.1"
2
+ # version of our library, currently 0.2.2
3
+ VERSION = "0.2.2"
4
+
3
5
  autoload :TypeDB, "lwes/type_db"
4
6
  autoload :Struct, "lwes/struct"
5
7
  autoload :Emitter, "lwes/emitter"
data/lwes.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{lwes}
3
- s.version = "0.2.1"
3
+ s.version = "0.2.2"
4
4
  s.date = Time.now
5
5
  s.authors = ["Erik S. Chang", "Frank Maritato"]
6
6
  s.email = %q{lwes-devel@lists.sourceforge.net}
@@ -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.1
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-09 00:00:00 +00:00
13
+ date: 2009-12-14 00:00:00 +00:00
14
14
  default_executable:
15
15
  dependencies: []
16
16