isomorfeus-data 1.0.0.zeta1 → 1.0.0.zeta2
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/lib/isomorfeus-data.rb +1 -1
- data/lib/isomorfeus/data/version.rb +1 -1
- data/lib/lucid_array/mixin.rb +1 -1
- data/lib/lucid_collection/mixin.rb +1 -1
- data/lib/lucid_graph/mixin.rb +1 -1
- data/lib/lucid_hash/mixin.rb +1 -1
- metadata +8 -9
- data/lib/isomorfeus/data/prop_declaration.rb +0 -58
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c5f29c76957ad252efd2510a30747df75bbf7ef711f2c21fca922685918198b2
|
|
4
|
+
data.tar.gz: fee6f1fc0e92e8c238ea315cd6155ca1a21c47543d5dd2880ff67265167bc894
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9ea25f3e4ca511b747bf2f2d930c14bf05d5d00a1b5b05b1ff0001fb13f16527e81875f71e612d5ddd9f8e3e8b956e1ec3a63e0bad99e27af020cf05866d206
|
|
7
|
+
data.tar.gz: 95b82e958f0e91647822ef4db30c36b6fbbdab9c14b643d29a23b713d935aaa21a10f343c5c120d0a1dc707f6b107217a25be336a99eeac34d65ecaffd72b014
|
data/lib/isomorfeus-data.rb
CHANGED
|
@@ -2,11 +2,11 @@ require 'opal'
|
|
|
2
2
|
require 'opal-autoloader'
|
|
3
3
|
require 'opal-activesupport'
|
|
4
4
|
require 'isomorfeus-redux'
|
|
5
|
+
require 'isomorfeus-react'
|
|
5
6
|
require 'isomorfeus-transport'
|
|
6
7
|
|
|
7
8
|
require 'isomorfeus/data/config'
|
|
8
9
|
require 'isomorfeus/data/props'
|
|
9
|
-
require 'isomorfeus/data/prop_declaration'
|
|
10
10
|
require 'lucid_node/mixin'
|
|
11
11
|
require 'lucid_node/base'
|
|
12
12
|
require 'lucid_edge/mixin'
|
data/lib/lucid_array/mixin.rb
CHANGED
|
@@ -5,7 +5,7 @@ module LucidCollection
|
|
|
5
5
|
Isomorfeus.add_valid_collection_class(base) unless base == LucidCollection::Base
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
-
base.extend(
|
|
8
|
+
base.extend(LucidPropDeclaration::Mixin)
|
|
9
9
|
|
|
10
10
|
def find_node(attribute_hash = nil, &block)
|
|
11
11
|
if block_given?
|
data/lib/lucid_graph/mixin.rb
CHANGED
data/lib/lucid_hash/mixin.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: isomorfeus-data
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.0.
|
|
4
|
+
version: 1.0.0.zeta2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jan Biedermann
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-08-
|
|
11
|
+
date: 2019-08-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -86,14 +86,14 @@ dependencies:
|
|
|
86
86
|
requirements:
|
|
87
87
|
- - ">="
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: 16.9.
|
|
89
|
+
version: 16.9.13
|
|
90
90
|
type: :runtime
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
94
|
- - ">="
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 16.9.
|
|
96
|
+
version: 16.9.13
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
98
|
name: isomorfeus-redux
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -114,28 +114,28 @@ dependencies:
|
|
|
114
114
|
requirements:
|
|
115
115
|
- - '='
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: 1.0.0.
|
|
117
|
+
version: 1.0.0.zeta2
|
|
118
118
|
type: :runtime
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
122
|
- - '='
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: 1.0.0.
|
|
124
|
+
version: 1.0.0.zeta2
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
126
|
name: isomorfeus-installer
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
|
128
128
|
requirements:
|
|
129
129
|
- - '='
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: 1.0.0.
|
|
131
|
+
version: 1.0.0.zeta2
|
|
132
132
|
type: :development
|
|
133
133
|
prerelease: false
|
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
|
136
136
|
- - '='
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: 1.0.0.
|
|
138
|
+
version: 1.0.0.zeta2
|
|
139
139
|
- !ruby/object:Gem::Dependency
|
|
140
140
|
name: opal-webpack-loader
|
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -194,7 +194,6 @@ files:
|
|
|
194
194
|
- lib/isomorfeus/data/handler/collection_load_handler.rb
|
|
195
195
|
- lib/isomorfeus/data/handler/graph_load_handler.rb
|
|
196
196
|
- lib/isomorfeus/data/handler/hash_load_handler.rb
|
|
197
|
-
- lib/isomorfeus/data/prop_declaration.rb
|
|
198
197
|
- lib/isomorfeus/data/props.rb
|
|
199
198
|
- lib/isomorfeus/data/reducer.rb
|
|
200
199
|
- lib/isomorfeus/data/version.rb
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
module Isomorfeus
|
|
2
|
-
module Data
|
|
3
|
-
module PropDeclaration
|
|
4
|
-
# props, very similar to Components:
|
|
5
|
-
# prop :text, class: String # a required prop of class String, class must match exactly
|
|
6
|
-
# prop :other, is_a: Enumerable # a required prop, which can be a Array for example, but at least must be a Enumerable
|
|
7
|
-
# prop :cool, default: 'yet some more text' # a optional prop with a default value
|
|
8
|
-
# prop :even_cooler, class: String, required: false
|
|
9
|
-
def prop(prop_name, options_hash = {})
|
|
10
|
-
declared_props[prop_name.to_sym] = options_hash
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def declared_props
|
|
14
|
-
@declared_props ||= {}
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def validate_props(props_hash)
|
|
18
|
-
p = declared_props
|
|
19
|
-
|
|
20
|
-
props = Isomorfeus::Data::Props.new(props_hash)
|
|
21
|
-
|
|
22
|
-
raise "#{self}: Wrong or to many props given!" if (props.keys - p.keys).size > 0
|
|
23
|
-
|
|
24
|
-
# validation
|
|
25
|
-
p.each_key do |key|
|
|
26
|
-
# determine if prop is required
|
|
27
|
-
required = if p[key].key?(:required)
|
|
28
|
-
p[key][:required]
|
|
29
|
-
elsif p[key].key?(:default)
|
|
30
|
-
false
|
|
31
|
-
else
|
|
32
|
-
true
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# assign value
|
|
36
|
-
value = if props.key?(key)
|
|
37
|
-
props[key]
|
|
38
|
-
elsif p[key].key?(:default)
|
|
39
|
-
props_hash[key] = p[key][:default].dup
|
|
40
|
-
else
|
|
41
|
-
raise "#{self}: Required prop not given: #{key}!" if required
|
|
42
|
-
nil
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# check if passed value is of correct type
|
|
46
|
-
if props_hash.key?(key)
|
|
47
|
-
if p[key].key?(:class) && value.class != (p[key][:class])
|
|
48
|
-
raise "#{self}: #{key} value is not of class #{p[key][:class]} but instead a #{value.class}!"
|
|
49
|
-
end
|
|
50
|
-
if p[key].key?(:is_a) && !value.is_a?(p[key][:is_a])
|
|
51
|
-
raise "#{self}: #{key} value is not a #{p[key][:is_a]}!"
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
end
|