activefacts-api 1.9.12 → 1.9.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/activefacts-api.gemspec +2 -2
- data/lib/activefacts/api/constellation.rb +1 -1
- data/lib/activefacts/api/entity.rb +1 -1
- data/lib/activefacts/api/instance.rb +8 -0
- data/lib/activefacts/api/numeric.rb +3 -1
- data/lib/activefacts/api/role_values.rb +5 -5
- data/lib/activefacts/api/value.rb +1 -1
- data/lib/activefacts/api/version.rb +1 -1
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8c3ae722ceb4f264e163be7c166507f6ab3ab328cea1513ff0599ea0c54a3270
|
4
|
+
data.tar.gz: '096701429372fe651503a58c4631c0f6090f21493555a3c2705ec2cbd71c1f04'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbb093b3faaa2c8f31e5c9f33c6afd076e3d72e803beb57272eb6769e6a44af9a98c909f9643c5d08da3f9fe0e0815ed76b90cecd9de524a6453497485d79346
|
7
|
+
data.tar.gz: 8f349dca05234d1b24c2408eb81ee5fbc3d0a3458021c099374cf4da6118c349d7dbc32c5e82a86c462da06acb878f6de8ab1f43a8de58cdcced608ec8b79979
|
data/activefacts-api.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = ActiveFacts::API::VERSION
|
9
9
|
spec.authors = ["Clifford Heath"]
|
10
10
|
spec.email = ["clifford.heath@gmail.com"]
|
11
|
-
spec.date
|
11
|
+
spec.date = "2022-06-15"
|
12
12
|
|
13
13
|
spec.summary = "A fact-based data model DSL and API"
|
14
14
|
spec.description = %q{
|
@@ -35,7 +35,7 @@ over the fact population.
|
|
35
35
|
spec.add_runtime_dependency 'tracing', ["~> 2", ">= 2.0.4"]
|
36
36
|
|
37
37
|
spec.add_development_dependency "bundler", ">= 1.10"
|
38
|
-
spec.add_development_dependency "rake", "
|
38
|
+
spec.add_development_dependency "rake", ">= 10"
|
39
39
|
spec.add_development_dependency "rspec", "~> 3.3"
|
40
40
|
end
|
41
41
|
|
@@ -65,7 +65,7 @@ module ActiveFacts
|
|
65
65
|
# With no parameters, return the collection of all instances of that object_type.
|
66
66
|
# With parameters, assert an instance of the object_type identified by the values passed as args.
|
67
67
|
def method_missing(m, *args, &b)
|
68
|
-
klass = @vocabulary.const_get(m)
|
68
|
+
klass = @vocabulary.const_get(m) rescue nil # Catch missing lower-case names (wrong constant) and use super
|
69
69
|
if invalid_object_type klass
|
70
70
|
super
|
71
71
|
else
|
@@ -466,7 +466,7 @@ module ActiveFacts
|
|
466
466
|
|
467
467
|
def other.new_instance constellation, *args
|
468
468
|
instance = allocate
|
469
|
-
instance.instance_variable_set(
|
469
|
+
instance.instance_variable_set(constellation_variable_name, constellation)
|
470
470
|
instance.send(:initialize, *args)
|
471
471
|
instance
|
472
472
|
end
|
@@ -26,6 +26,10 @@ module ActiveFacts
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
def constellation_variable_name
|
30
|
+
@@constellation_variable_name ||= "@constellation"
|
31
|
+
end
|
32
|
+
|
29
33
|
def is_a? klass
|
30
34
|
super || self.class.supertypes_transitive.include?(klass)
|
31
35
|
end
|
@@ -158,6 +162,10 @@ module ActiveFacts
|
|
158
162
|
module ClassMethods #:nodoc:
|
159
163
|
include ObjectType
|
160
164
|
# Add Instance class methods here
|
165
|
+
|
166
|
+
def constellation_variable_name
|
167
|
+
@@constellation_variable_name ||= "@constellation"
|
168
|
+
end
|
161
169
|
end
|
162
170
|
end
|
163
171
|
end
|
@@ -62,7 +62,9 @@ class Decimal < SimpleDelegator #:nodoc:
|
|
62
62
|
include ActiveFacts::API::SimpleDelegation
|
63
63
|
|
64
64
|
def delegate_new(v)
|
65
|
-
if
|
65
|
+
if RUBY_VERSION >= "3"
|
66
|
+
BigDecimal(v)
|
67
|
+
elsif v.is_a?(BigDecimal) || v.is_a?(Integer)
|
66
68
|
BigDecimal.new(v.to_s)
|
67
69
|
else
|
68
70
|
BigDecimal.new(v)
|
@@ -144,16 +144,16 @@ module ActiveFacts
|
|
144
144
|
def_single_delegator :@a, :empty?
|
145
145
|
def_single_delegator :@a, :include?
|
146
146
|
def_single_delegator :@a, :inject, 2
|
147
|
-
def_single_delegator :@a, :select, -
|
148
|
-
def_single_delegator :@a, :reject, -
|
147
|
+
def_single_delegator :@a, :select, -2, 1
|
148
|
+
def_single_delegator :@a, :reject, -2, 1
|
149
149
|
def_single_delegator :@a, :size
|
150
|
-
def_single_delegator :@a, :sort_by, -
|
150
|
+
def_single_delegator :@a, :sort_by, -2, 1
|
151
151
|
def_single_delegator :@a, :to_a
|
152
152
|
def_single_delegator :@a, :-
|
153
153
|
# These delegators allow a negative arity in RSpec because the tests test it (to make sure the code doesn't pass too many args)
|
154
|
-
def_single_delegator :@a, :each, *([-
|
154
|
+
def_single_delegator :@a, :each, *([-2, 1] + Array(defined?(::RSpec) ? -2 : nil))
|
155
155
|
def_single_delegator :@a, :detect, 1, *([-1, 1] + Array(defined?(::RSpec) ? -2 : nil))
|
156
|
-
def_single_delegator :@a, :map, -
|
156
|
+
def_single_delegator :@a, :map, -2, 1
|
157
157
|
end
|
158
158
|
end
|
159
159
|
end
|
@@ -155,7 +155,7 @@ module ActiveFacts
|
|
155
155
|
class << klass
|
156
156
|
def new_instance constellation, *args
|
157
157
|
instance = allocate
|
158
|
-
instance.instance_variable_set(
|
158
|
+
instance.instance_variable_set(constellation_variable_name, constellation)
|
159
159
|
instance.send(:initialize, *args)
|
160
160
|
instance
|
161
161
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activefacts-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clifford Heath
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbtree-pure
|
@@ -68,14 +68,14 @@ dependencies:
|
|
68
68
|
name: rake
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
|
-
- - "
|
71
|
+
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '10'
|
74
74
|
type: :development
|
75
75
|
prerelease: false
|
76
76
|
version_requirements: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
|
-
- - "
|
78
|
+
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '10'
|
81
81
|
- !ruby/object:Gem::Dependency
|
@@ -139,7 +139,7 @@ homepage: https://github.com/cjheath/activefacts-api
|
|
139
139
|
licenses:
|
140
140
|
- MIT
|
141
141
|
metadata: {}
|
142
|
-
post_install_message:
|
142
|
+
post_install_message:
|
143
143
|
rdoc_options: []
|
144
144
|
require_paths:
|
145
145
|
- lib
|
@@ -154,9 +154,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
|
-
|
158
|
-
|
159
|
-
signing_key:
|
157
|
+
rubygems_version: 3.2.22
|
158
|
+
signing_key:
|
160
159
|
specification_version: 4
|
161
160
|
summary: A fact-based data model DSL and API
|
162
161
|
test_files: []
|