40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'foobara-0.1.7/projects/domain/src/is_manifestable.rb', line 40
def foobara_manifest
to_include = TypeDeclarations.foobara_manifest_context_to_include || Set.new
include_processors = TypeDeclarations.include_processors?
h = {
scoped_path:,
scoped_name:,
scoped_short_name:,
scoped_prefix:,
scoped_full_path:,
scoped_full_name:,
scoped_category:,
reference: foobara_manifest_reference,
domain: foobara_domain&.foobara_manifest_reference,
organization: foobara_organization&.foobara_manifest_reference
}
candidate = scoped_namespace
parent = nil
while candidate
parent_category = Namespace.global.foobara_category_symbol_for(candidate)
break unless parent_category
if parent_category
if include_processors || (parent_category != :processor && parent_category != :processor_class)
parent = if candidate == Foobara::Value
GlobalDomain
else
candidate
end
break
end
end
candidate = candidate.scoped_namespace
end
if parent == GlobalDomain
h[:scoped_path] = scoped_full_path
h[:scoped_name] = scoped_full_name
h[:scoped_prefix] = scoped_full_path[..-2]
h[:domain] = parent.foobara_manifest_reference
h[:organization] = parent.foobara_organization.foobara_manifest_reference
end
if parent
to_include << parent
h[:parent] = [parent_category, parent.foobara_manifest_reference]
end
h
end
|