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
|
# File 'lib/glue_gun/dsl.rb', line 52
def initialize(attrs = {})
attrs ||= {}
attrs = attrs.symbolize_keys
dependency_attributes = {}
normal_attributes = {}
attrs.each do |key, value|
if self.class.dependency_definitions.key?(key)
dependency_attributes[key] = value
else
normal_attributes[key] = value
end
end
if attribute_definitions.keys.include?(:root_dir) && attribute_definitions.dig(:root_dir, :options,
:default).nil?
normal_attributes.reverse_merge!(root_dir: detect_root_dir)
end
super(normal_attributes)
initialize_dependencies(dependency_attributes)
@initialized = true
end
|