rrudb 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rudb/rudb.cpp +20 -2
- data/lib/rudb/version.rb +1 -1
- data/lib/rudb.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68b985de38c600da033bd457d4b1eb7f666aa93ce7e5ab629739a5a235923221
|
4
|
+
data.tar.gz: 1981b6a50f49bd7aba204725afc8b5e5556eb3261439c3525bdcbe773cf6d64b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec718c5f4ab0ec65b9bb4b72ea7fa9681be8f7cc09da0029bbbcadaeab0b975b4e350771aa399b9cd7085b6971f048d98e7036273701d623efd6f1e3e53e42e2
|
7
|
+
data.tar.gz: abbc5a916c3daabd1d158487bc3d81f286bf2736430e44e89c056a902627bb89e6e74297b39c3afa6b755b664a2ecb07c1e5beb43ea851a565ad60b5fa7edae1
|
data/ext/rudb/rudb.cpp
CHANGED
@@ -23,12 +23,28 @@ VALUE ec2obj(nudb::error_code* ec){
|
|
23
23
|
return Data_Wrap_Struct(cRuDB_ec, 0, ec_free, ec);
|
24
24
|
}
|
25
25
|
|
26
|
+
static VALUE ec_alloc(VALUE klass){
|
27
|
+
nudb::error_code* ec_pointer = ALLOC(nudb::error_code);
|
28
|
+
return Data_Wrap_Struct(klass, 0, ec_free, ec_pointer);
|
29
|
+
}
|
30
|
+
|
26
31
|
VALUE rudb_ec_value(VALUE _self){
|
27
32
|
nudb::error_code* ec_pointer;
|
28
33
|
Data_Get_Struct(_self, nudb::error_code , ec_pointer);
|
29
34
|
return INT2NUM(ec_pointer->value());
|
30
35
|
}
|
31
36
|
|
37
|
+
VALUE rudb_ec_value_eq(VALUE _self, VALUE _val){
|
38
|
+
Check_Type(_val, T_FIXNUM);
|
39
|
+
int _vali = NUM2INT(_val);
|
40
|
+
|
41
|
+
nudb::error_code* ec_pointer;
|
42
|
+
Data_Get_Struct(_self, nudb::error_code , ec_pointer);
|
43
|
+
ec_pointer->assign(_vali, ec_pointer->category());
|
44
|
+
|
45
|
+
return INT2NUM(ec_pointer->value());
|
46
|
+
}
|
47
|
+
|
32
48
|
VALUE rudb_ec_message(VALUE _self){
|
33
49
|
nudb::error_code* ec_pointer;
|
34
50
|
Data_Get_Struct(_self, nudb::error_code , ec_pointer);
|
@@ -247,7 +263,9 @@ extern "C"{
|
|
247
263
|
rb_define_method(cRuDB_store, "close", (METHOD)rudb_store_close, 0);
|
248
264
|
|
249
265
|
cRuDB_ec = rb_define_class_under(mRuDB, "ErrorCode", rb_cObject);
|
250
|
-
|
251
|
-
rb_define_method(cRuDB_ec, "
|
266
|
+
rb_define_alloc_func(cRuDB_ec, ec_alloc);
|
267
|
+
rb_define_method(cRuDB_ec, "value", (METHOD)rudb_ec_value, 0);
|
268
|
+
rb_define_method(cRuDB_ec, "value=", (METHOD)rudb_ec_value_eq, 1);
|
269
|
+
rb_define_method(cRuDB_ec, "message", (METHOD)rudb_ec_message, 0);
|
252
270
|
}
|
253
271
|
}
|
data/lib/rudb/version.rb
CHANGED
data/lib/rudb.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rrudb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dev Null Productions
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby NuDB Wrapper
|
14
14
|
email:
|