diff options
| author | Paul Buetow <paul@buetow.org> | 2025-02-17 00:16:47 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-02-17 00:16:47 +0200 |
| commit | a8d7029846faff9db5a99dbe011b3765a1350ee4 (patch) | |
| tree | 3be8cd74e1acac91fd12bab473812feea1fc60b3 | |
| parent | ed8cf0c0c285abab24479b7af3bc73f2c7340822 (diff) | |
sugar
| -rw-r--r-- | TODO.md | 1 | ||||
| -rw-r--r-- | lib/dslkeywords/resource.rb | 3 |
2 files changed, 1 insertions, 3 deletions
@@ -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!) |
