5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/base/graph.rb', line 5
def self.create(graph)
fail "Graph should have graph to execute. You defined \"#{graph}\"" if graph[:path].blank?
if(!URI.parse(graph[:path].to_s).absolute?)
{
:inputs => [],
:outputs => []
}.merge(graph).merge({
:path => Pathname(graph[:path]),
:name => Pathname(graph[:path]).basename.to_s,
:type => :graph
})
else
{
:inputs => [],
:outputs => []
}.merge(graph).merge({
:path => URI(graph[:path]),
:name => URI(graph[:path]),
:type => :graph
})
end
end
|