lwes 0.1.1 → 0.1.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 +5 -0
- data/ext/lwes/type_db.c +3 -0
- data/lib/lwes.rb +1 -0
- data/lwes.gemspec +1 -1
- data/test/unit/test_type_db.rb +13 -0
- metadata +2 -2
data/ChangeLog
CHANGED
data/ext/lwes/type_db.c
CHANGED
@@ -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");
|
data/lib/lwes.rb
CHANGED
data/lwes.gemspec
CHANGED
data/test/unit/test_type_db.rb
CHANGED
@@ -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.
|
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-
|
13
|
+
date: 2009-12-01 00:00:00 +00:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|