clipsruby 0.0.28 → 0.0.29
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 +12 -0
- data/ext/clipsruby/clipsruby.c +24 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 305eb61d4442d705a0e3cf576056151266170cd5a3c8e67d2c2d01efe65ed540
|
4
|
+
data.tar.gz: 2de8f8f91cfc7c529239f1fbbd8f7701bfc08ff24e7576a162ab4d4bd3111f18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 271deb181e3aea58a76b104ac876e6130be561e56261175bcb9ef0ddb334a7ebbeda13a3e2d964c0291fe4b47d2f3f806c83d09dae90efe50bd57aca718bc41e
|
7
|
+
data.tar.gz: 64a925ca77540df3b8b77ce15004369f478431909fcb6a7ffc4fd4f9f516e67362ddd5b4a0012832cf3e64ba54051fca16b870a37784ce01cf3cdcf66e4a4653
|
data/README.md
CHANGED
@@ -611,6 +611,18 @@ CLIPS::Environment::Deftemplate.is_deletable(deftemplate)
|
|
611
611
|
deftemplate.is_deletable
|
612
612
|
```
|
613
613
|
|
614
|
+
### `CLIPS::Environment::Deftemplate.is_implied`
|
615
|
+
### `CLIPS::Environment::Deftemplate#is_implied`
|
616
|
+
|
617
|
+
Returns a boolean whether the Deftemplate is implied or not.
|
618
|
+
If the fact is an ordered fact, the Deftemplate is implied.
|
619
|
+
Otherwise, the Deftemplate is considered explicitly defined.
|
620
|
+
|
621
|
+
```ruby
|
622
|
+
CLIPS::Environment::Deftemplate.is_implied(deftemplate)
|
623
|
+
deftemplate.is_implied
|
624
|
+
```
|
625
|
+
|
614
626
|
### `CLIPS::Environment::Deftemplate.slot_allowed_values`
|
615
627
|
### `CLIPS::Environment::Deftemplate#slot_allowed_values`
|
616
628
|
|
data/ext/clipsruby/clipsruby.c
CHANGED
@@ -188,6 +188,10 @@ static VALUE clips_environment_assert_string(VALUE self, VALUE string)
|
|
188
188
|
|
189
189
|
Fact *fact = AssertString(env, StringValueCStr(string));
|
190
190
|
|
191
|
+
if (fact == NULL) {
|
192
|
+
return Qnil;
|
193
|
+
}
|
194
|
+
|
191
195
|
VALUE rb_fact =
|
192
196
|
TypedData_Wrap_Struct(rb_const_get(CLASS_OF(self), rb_intern("Fact")), &Fact_type, fact);
|
193
197
|
|
@@ -2110,6 +2114,24 @@ static VALUE clips_environment_deftemplate_static_is_deletable(VALUE self, VALUE
|
|
2110
2114
|
return clips_environment_deftemplate_is_deletable(rbDeftemplate);
|
2111
2115
|
}
|
2112
2116
|
|
2117
|
+
static VALUE clips_environment_deftemplate_is_implied(VALUE self)
|
2118
|
+
{
|
2119
|
+
Deftemplate *deftemplate;
|
2120
|
+
|
2121
|
+
TypedData_Get_Struct(self, Deftemplate, &Deftemplate_type, deftemplate);
|
2122
|
+
|
2123
|
+
if (deftemplate->implied) {
|
2124
|
+
return Qtrue;
|
2125
|
+
} else {
|
2126
|
+
return Qfalse;
|
2127
|
+
}
|
2128
|
+
}
|
2129
|
+
|
2130
|
+
static VALUE clips_environment_deftemplate_static_is_implied(VALUE self, VALUE rbDeftemplate)
|
2131
|
+
{
|
2132
|
+
return clips_environment_deftemplate_is_implied(rbDeftemplate);
|
2133
|
+
}
|
2134
|
+
|
2113
2135
|
static VALUE clips_environment_deftemplate_slot_existp(VALUE self, VALUE slot_name)
|
2114
2136
|
{
|
2115
2137
|
Deftemplate *deftemplate;
|
@@ -3099,6 +3121,8 @@ void Init_clipsruby(void)
|
|
3099
3121
|
rb_define_method(rbDeftemplate, "slot_multip", clips_environment_deftemplate_slot_multip, 1);
|
3100
3122
|
rb_define_singleton_method(rbDeftemplate, "slot_defaultp", clips_environment_deftemplate_static_slot_defaultp, 2);
|
3101
3123
|
rb_define_method(rbDeftemplate, "slot_defaultp", clips_environment_deftemplate_slot_defaultp, 1);
|
3124
|
+
rb_define_singleton_method(rbDeftemplate, "is_implied", clips_environment_deftemplate_static_is_implied, 1);
|
3125
|
+
rb_define_method(rbDeftemplate, "is_implied", clips_environment_deftemplate_is_implied, 0);
|
3102
3126
|
|
3103
3127
|
VALUE rbDefmodule = rb_define_class_under(rbEnvironment, "Defmodule", rb_cObject);
|
3104
3128
|
rb_define_alloc_func(rbDefmodule, defmodule_alloc);
|
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.29
|
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-23 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
|
@@ -385,7 +385,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
385
385
|
- !ruby/object:Gem::Version
|
386
386
|
version: '0'
|
387
387
|
requirements: []
|
388
|
-
rubygems_version: 3.5.
|
388
|
+
rubygems_version: 3.5.16
|
389
389
|
signing_key:
|
390
390
|
specification_version: 4
|
391
391
|
summary: Calling CLIPS from within Ruby
|