dataflow-rb 0.10.1 → 0.10.2
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/dataflow/version.rb +1 -1
- data/lib/dataflow-rb.rb +23 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27b271c3e39d4e3ead1ef50ba784ad127270fb36
|
4
|
+
data.tar.gz: 9fcccbc62f7714b61a58dee11cdc823da6ff00f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d44eee8bd3a364e25582d6710e3aaf9adbf8be9c247b99d7e8b7ecfbf91b702959ad455986306285f8ce50aba4debddc93a228e01d9c8e9c0d4eda3c779a543b
|
7
|
+
data.tar.gz: 64e4c5fb8c4dedce76e7234cc3ce3d0c0460a7191ecb0222534d3025dc26b9046e4f00b6f08509fadbec0bdc8570523efd510174f6751a0dc693d903ee0ccd79
|
data/lib/dataflow/version.rb
CHANGED
data/lib/dataflow-rb.rb
CHANGED
@@ -70,3 +70,26 @@ module Dataflow
|
|
70
70
|
Dataflow::Nodes::ComputeNode.find_by(name: id)
|
71
71
|
end
|
72
72
|
end
|
73
|
+
|
74
|
+
|
75
|
+
###############################################################################
|
76
|
+
# Override the #constantize in active_support/inflector/methods.rb
|
77
|
+
# to rescue from Dataflow::Nodes::... name errors.
|
78
|
+
# In such cases, we return a generic Dataflow::Nodes::DataNode instead.
|
79
|
+
# This is used within mongoid to instance the correct node types.
|
80
|
+
module Dataflow
|
81
|
+
module ConstantizePatch
|
82
|
+
def constantize(*args)
|
83
|
+
super
|
84
|
+
rescue NameError => e
|
85
|
+
raise e unless e.message =~ /Dataflow::Nodes/
|
86
|
+
p "Warning -- Node class not found. #{e}"
|
87
|
+
Dataflow::Nodes::ComputeNode
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
ActiveSupport::Inflector.module_eval do
|
93
|
+
extend Dataflow::ConstantizePatch
|
94
|
+
end
|
95
|
+
###############################################################################
|