summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO.md1
-rw-r--r--lib/dslkeywords/resource.rb3
2 files changed, 1 insertions, 3 deletions
diff --git a/TODO.md b/TODO.md
index ad66ca3..1f83cad 100644
--- a/TODO.md
+++ b/TODO.md
@@ -16,7 +16,6 @@
* Binary installation support (file copy from source to dest)
* Local file system
* scp? git? http/s?
-* Object dependencies / ensuring correct order of evaluation
* Manage services (start, stop, restart (subscribe))
* Manage packages (install, update, deinstall)
* Fedora
diff --git a/lib/dslkeywords/resource.rb b/lib/dslkeywords/resource.rb
index 2320077..29824e9 100644
--- a/lib/dslkeywords/resource.rb
+++ b/lib/dslkeywords/resource.rb
@@ -7,6 +7,7 @@ module RCM
module ResourceDependencies
def initialize(...)
super(...)
+ @depends_on = {}
@valid_resources = Set.new
ObjectSpace.each_object(Class).each do |klass|
@valid_resources << klass.to_s.sub('RCM::', '').downcase.to_sym if klass < Resource
@@ -24,7 +25,6 @@ module RCM
def respond_to_missing? = true
def depends_on(*others)
- @depends_on = {} if @depends_on.nil?
return @depends_on if others.empty?
others.flatten.each do |other|
@@ -49,7 +49,6 @@ module RCM
raise DependencyLoop, "Dependency loop detected for #{id}" if @loop_detection
@loop_detection = true
- @depends_on = {} if @depends_on.nil?
# Try to evaluate all dependencies recursively.
@depends_on.each_key.map { Resource.find(_1) }.each(&:evaluate!)