lwes 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ Version 0.1.2 (erik-s-chang)
2
+ * TypeDB.new raises ArgumentError on non-String args
3
+ * extra test for empty Event definitions (MetaEventInfo-only)
4
+ * export LWES::VERSION constant
5
+
1
6
  Version 0.1.1 (erik-s-chang)
2
7
  * add support for namespaced ESFs
3
8
 
@@ -26,6 +26,9 @@ static VALUE tdb_init(VALUE self, VALUE path)
26
26
  {
27
27
  struct _tdb *tdb;
28
28
 
29
+ if (TYPE(path) != T_STRING)
30
+ rb_raise(rb_eArgError, "path must be a string");
31
+
29
32
  Data_Get_Struct(self, struct _tdb, tdb);
30
33
  if (tdb->db)
31
34
  rb_raise(rb_eRuntimeError, "ESF already initialized");
@@ -1,4 +1,5 @@
1
1
  module LWES
2
+ VERSION = "0.1.2"
2
3
  autoload :TypeDB, "lwes/type_db"
3
4
  autoload :Struct, "lwes/struct"
4
5
  autoload :Emitter, "lwes/emitter"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{lwes}
3
- s.version = "0.1.1"
3
+ s.version = "0.1.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}
@@ -70,4 +70,17 @@ class TestTypeDB < Test::Unit::TestCase
70
70
  assert_equal expect, classes.map { |i| i.to_s }
71
71
  end
72
72
 
73
+ def test_invalid_file_arg_error
74
+ assert_raises(ArgumentError) { LWES::TypeDB.new(nil) }
75
+ end
76
+
77
+ def test_empty_struct_ok
78
+ # even with LWES 0.22.3, the "ERROR" message is non-fatal
79
+ # the next version (as of lwes trunk r344) will no longer
80
+ # spew a non-fatal "ERROR" message.
81
+ tdb = LWES::TypeDB.new("#{File.dirname(__FILE__)}/meta_only.esf")
82
+ classes = tdb.create_classes!
83
+ assert_equal %w(Meta::Info::Only), classes.map { |x| x.to_s }
84
+ end
85
+
73
86
  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.1.1
4
+ version: 0.1.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-11-25 00:00:00 +00:00
13
+ date: 2009-12-01 00:00:00 +00:00
14
14
  default_executable:
15
15
  dependencies: []
16
16