clipsruby 0.0.35 → 0.0.36
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.
- checksums.yaml +4 -4
- data/README.md +31 -5
- data/ext/clipsruby/clipsruby.c +97 -5
- 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: 50cc209eb6a473cd3a980b8d551079a4db6632f86afbc43bff8a582a89efb2cf
|
4
|
+
data.tar.gz: 2e2dd6648850df2dc496111334e68aebb9048fb2f823a6b6ddd865449cb34254
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bf9b814174620c68ee826d8051f09bb4d3e989537f4dcce642ba84a651b9dcdfa5acb403378865e05429b1dd03019e07568163c121a58e05368bc664ebd96e4
|
7
|
+
data.tar.gz: e3690e9f5b2f28203366e75d845d06dc3ad22173db4ed0a0cdb0ff7246cb0b31f804fc60fde0b6e2be58b29b074f3692ade5f3da6c4f947a2acfc40b1ab1ae21
|
data/README.md
CHANGED
@@ -454,14 +454,14 @@ CLIPS::Environment::Instance.pp_form(instance)
|
|
454
454
|
instance.pp_form
|
455
455
|
```
|
456
456
|
|
457
|
-
### `CLIPS::Environment::Instance.
|
458
|
-
### `CLIPS::Environment::Instance#
|
457
|
+
### `CLIPS::Environment::Instance.defclass`
|
458
|
+
### `CLIPS::Environment::Instance#defclass`
|
459
459
|
|
460
460
|
Returns the Defclass of an Instance
|
461
461
|
|
462
462
|
```ruby
|
463
|
-
CLIPS::Environment::Instance.
|
464
|
-
instance.
|
463
|
+
CLIPS::Environment::Instance.defclass(instance)
|
464
|
+
instance.defclass
|
465
465
|
```
|
466
466
|
|
467
467
|
### `CLIPS::Environment::Defclass.name`
|
@@ -498,7 +498,7 @@ defclass.defmodule_name
|
|
498
498
|
### `CLIPS::Environment::Defclass#get_instance_list`
|
499
499
|
|
500
500
|
Return an array of Instances of the Defclass.
|
501
|
-
Pass `true` as
|
501
|
+
Pass `true` as an argument to include instances of subclasses
|
502
502
|
of this Defclass.
|
503
503
|
|
504
504
|
```ruby
|
@@ -508,6 +508,32 @@ defclass.get_instance_list
|
|
508
508
|
defclass.get_instance_list(true)
|
509
509
|
```
|
510
510
|
|
511
|
+
### `CLIPS::Environment::Defclass.superclasses`
|
512
|
+
### `CLIPS::Environment::Defclass#superclasses`
|
513
|
+
|
514
|
+
Return an array of superclasses of the Defclass.
|
515
|
+
Pass `true` as an argument to include inherited superclasses.
|
516
|
+
|
517
|
+
```ruby
|
518
|
+
CLIPS::Environment::Defclass.superclasses(defclass)
|
519
|
+
CLIPS::Environment::Defclass.superclasses(defclass, true)
|
520
|
+
defclass.superclasses
|
521
|
+
defclass.superclasses(true)
|
522
|
+
```
|
523
|
+
|
524
|
+
### `CLIPS::Environment::Defclass.subclasses`
|
525
|
+
### `CLIPS::Environment::Defclass#subclasses`
|
526
|
+
|
527
|
+
Return an array of subclasses of the Defclass.
|
528
|
+
Pass `true` as an argument to include inherited subclasses.
|
529
|
+
|
530
|
+
```ruby
|
531
|
+
CLIPS::Environment::Defclass.subclasses(defclass)
|
532
|
+
CLIPS::Environment::Defclass.subclasses(defclass, true)
|
533
|
+
defclass.subclasses
|
534
|
+
defclass.subclasses(true)
|
535
|
+
```
|
536
|
+
|
511
537
|
### `CLIPS::Environment.find_defrule`
|
512
538
|
### `CLIPS::Environment#find_defrule`
|
513
539
|
|
data/ext/clipsruby/clipsruby.c
CHANGED
@@ -379,6 +379,7 @@ static VALUE clips_environment_defclass_static_get_instance_list(int argc, VALUE
|
|
379
379
|
return returnArray;
|
380
380
|
}
|
381
381
|
|
382
|
+
|
382
383
|
static VALUE clips_environment_make_instance(VALUE self, VALUE string)
|
383
384
|
{
|
384
385
|
Environment *env;
|
@@ -466,7 +467,7 @@ static VALUE clips_environment_instance_static_delete(VALUE self, VALUE rbInstan
|
|
466
467
|
return clips_environment_instance_delete(rbInstance);
|
467
468
|
}
|
468
469
|
|
469
|
-
static VALUE
|
470
|
+
static VALUE clips_environment_instance_defclass(VALUE self)
|
470
471
|
{
|
471
472
|
Defclass *defclass;
|
472
473
|
Instance *instance;
|
@@ -486,9 +487,9 @@ static VALUE clips_environment_instance_class(VALUE self)
|
|
486
487
|
return rb_defclass;
|
487
488
|
}
|
488
489
|
|
489
|
-
static VALUE
|
490
|
+
static VALUE clips_environment_instance_static_defclass(VALUE self, VALUE rbInstance)
|
490
491
|
{
|
491
|
-
return
|
492
|
+
return clips_environment_instance_defclass(rbInstance);
|
492
493
|
}
|
493
494
|
|
494
495
|
static VALUE clips_environment_instance_name(VALUE self)
|
@@ -1114,6 +1115,93 @@ static VALUE clips_environment_deftemplate_static_slot_names(VALUE self, VALUE r
|
|
1114
1115
|
return clips_environment_deftemplate_slot_names(rbDeftemplate);
|
1115
1116
|
}
|
1116
1117
|
|
1118
|
+
static VALUE clips_environment_defclass_superclasses(int argc, VALUE *argv, VALUE rbDefclass)
|
1119
|
+
{
|
1120
|
+
VALUE rbEnvironment, inherit;
|
1121
|
+
Defclass *defclass;
|
1122
|
+
CLIPSValue value;
|
1123
|
+
VALUE out;
|
1124
|
+
|
1125
|
+
rbEnvironment = rb_iv_get(rbDefclass, "@environment");
|
1126
|
+
|
1127
|
+
rb_scan_args(argc, argv, "01", &inherit);
|
1128
|
+
|
1129
|
+
if (NIL_P(inherit)) {
|
1130
|
+
inherit = Qfalse;
|
1131
|
+
}
|
1132
|
+
|
1133
|
+
TypedData_Get_Struct(rbDefclass, Defclass, &Defclass_type, defclass);
|
1134
|
+
|
1135
|
+
ClassSuperclasses(defclass, &value, RTEST(inherit));
|
1136
|
+
|
1137
|
+
CLIPSValue_to_VALUE(&value, &out, &rbEnvironment);
|
1138
|
+
|
1139
|
+
return out;
|
1140
|
+
}
|
1141
|
+
|
1142
|
+
static VALUE clips_environment_defclass_static_superclasses(int argc, VALUE *argv, VALUE klass)
|
1143
|
+
{
|
1144
|
+
VALUE rbEnvironment, inherit, rbDefclass;
|
1145
|
+
Defclass *defclass;
|
1146
|
+
CLIPSValue value;
|
1147
|
+
VALUE out;
|
1148
|
+
|
1149
|
+
rb_scan_args(argc, argv, "11", &rbDefclass, &inherit);
|
1150
|
+
|
1151
|
+
TypedData_Get_Struct(rbDefclass, Defclass, &Defclass_type, defclass);
|
1152
|
+
|
1153
|
+
rbEnvironment = rb_iv_get(rbDefclass, "@environment");
|
1154
|
+
|
1155
|
+
ClassSuperclasses(defclass, &value, RTEST(inherit));
|
1156
|
+
|
1157
|
+
CLIPSValue_to_VALUE(&value, &out, &rbEnvironment);
|
1158
|
+
|
1159
|
+
return out;
|
1160
|
+
}
|
1161
|
+
|
1162
|
+
static VALUE clips_environment_defclass_subclasses(int argc, VALUE *argv, VALUE rbDefclass)
|
1163
|
+
{
|
1164
|
+
VALUE rbEnvironment, inherit;
|
1165
|
+
Defclass *defclass;
|
1166
|
+
CLIPSValue value;
|
1167
|
+
VALUE out;
|
1168
|
+
|
1169
|
+
rbEnvironment = rb_iv_get(rbDefclass, "@environment");
|
1170
|
+
|
1171
|
+
rb_scan_args(argc, argv, "01", &inherit);
|
1172
|
+
|
1173
|
+
if (NIL_P(inherit)) {
|
1174
|
+
inherit = Qfalse;
|
1175
|
+
}
|
1176
|
+
|
1177
|
+
TypedData_Get_Struct(rbDefclass, Defclass, &Defclass_type, defclass);
|
1178
|
+
|
1179
|
+
ClassSubclasses(defclass, &value, RTEST(inherit));
|
1180
|
+
|
1181
|
+
CLIPSValue_to_VALUE(&value, &out, &rbEnvironment);
|
1182
|
+
|
1183
|
+
return out;
|
1184
|
+
}
|
1185
|
+
|
1186
|
+
static VALUE clips_environment_defclass_static_subclasses(int argc, VALUE *argv, VALUE klass)
|
1187
|
+
{
|
1188
|
+
VALUE rbEnvironment, inherit, rbDefclass;
|
1189
|
+
Defclass *defclass;
|
1190
|
+
CLIPSValue value;
|
1191
|
+
VALUE out;
|
1192
|
+
|
1193
|
+
rb_scan_args(argc, argv, "11", &rbDefclass, &inherit);
|
1194
|
+
|
1195
|
+
TypedData_Get_Struct(rbDefclass, Defclass, &Defclass_type, defclass);
|
1196
|
+
|
1197
|
+
rbEnvironment = rb_iv_get(rbDefclass, "@environment");
|
1198
|
+
|
1199
|
+
ClassSubclasses(defclass, &value, RTEST(inherit));
|
1200
|
+
|
1201
|
+
CLIPSValue_to_VALUE(&value, &out, &rbEnvironment);
|
1202
|
+
|
1203
|
+
return out;
|
1204
|
+
}
|
1117
1205
|
|
1118
1206
|
static VALUE clips_environment_run(int argc, VALUE *argv, VALUE environment) {
|
1119
1207
|
VALUE integer;
|
@@ -4201,6 +4289,10 @@ void Init_clipsruby(void)
|
|
4201
4289
|
rb_define_method(rbDefclass, "pp_form", clips_environment_defclass_pp_form, 0);
|
4202
4290
|
rb_define_singleton_method(rbDefclass, "get_instance_list", clips_environment_defclass_static_get_instance_list, -1);
|
4203
4291
|
rb_define_method(rbDefclass, "get_instance_list", clips_environment_defclass_get_instance_list, -1);
|
4292
|
+
rb_define_singleton_method(rbDefclass, "superclasses", clips_environment_defclass_static_superclasses, -1);
|
4293
|
+
rb_define_method(rbDefclass, "superclasses", clips_environment_defclass_superclasses, -1);
|
4294
|
+
rb_define_singleton_method(rbDefclass, "subclasses", clips_environment_defclass_static_subclasses, -1);
|
4295
|
+
rb_define_method(rbDefclass, "subclasses", clips_environment_defclass_subclasses, -1);
|
4204
4296
|
|
4205
4297
|
VALUE rbInstance = rb_define_class_under(rbEnvironment, "Instance", rb_cObject);
|
4206
4298
|
rb_define_alloc_func(rbInstance, instance_alloc);
|
@@ -4208,8 +4300,8 @@ void Init_clipsruby(void)
|
|
4208
4300
|
rb_define_method(rbInstance, "unmake", clips_environment_instance_unmake, 0);
|
4209
4301
|
rb_define_singleton_method(rbInstance, "delete", clips_environment_instance_static_delete, 1);
|
4210
4302
|
rb_define_method(rbInstance, "delete", clips_environment_instance_delete, 0);
|
4211
|
-
rb_define_singleton_method(rbInstance, "
|
4212
|
-
rb_define_method(rbInstance, "
|
4303
|
+
rb_define_singleton_method(rbInstance, "defclass", clips_environment_instance_static_defclass, 1);
|
4304
|
+
rb_define_method(rbInstance, "defclass", clips_environment_instance_defclass, 0);
|
4213
4305
|
rb_define_singleton_method(rbInstance, "name", clips_environment_instance_static_name, 1);
|
4214
4306
|
rb_define_method(rbInstance, "name", clips_environment_instance_name, 0);
|
4215
4307
|
rb_define_singleton_method(rbInstance, "pp_form", clips_environment_instance_static_pp_form, 1);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clipsruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Johnston
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Calling the CLIPS programming language from within Ruby
|
14
14
|
email: mrryanjohnston@gmail.com
|