diff options
| author | Paul Buetow <paul@buetow.org> | 2025-02-14 22:21:00 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-02-14 22:21:00 +0200 |
| commit | c7697dbd7d26bc6c62031e0d4d530b3b5987d9ee (patch) | |
| tree | 232890d0ff7913b34982b53ca41b4b5ec5fde7b0 /lib | |
| parent | a2edd9ec657dca835ce1a73807a86a9c44fdfec8 (diff) | |
more tests
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dsl.rb | 16 | ||||
| -rw-r--r-- | lib/dslkeywords/file.rb | 2 |
2 files changed, 11 insertions, 7 deletions
@@ -10,15 +10,19 @@ module RCM class DSL attr_reader :id - # TODO: Replace @@ with @ class variables - @@rcm_counter = -1 - @@objs = {} + def self.reset! + @@rcm_counter = -1 + @@objs = {} + end + + reset! include Config include Options include Log - def initialize + def initialize(reset) + DSL.reset! if reset @id = "#{self.class}(#{@@rcm_counter += 1})" @conds_met = true @scheduled = [] @@ -35,8 +39,8 @@ module RCM end end -def configure(&block) - RCM::DSL.new do |rcm| +def configure(reset: false, &block) + RCM::DSL.new(reset) do |rcm| rcm.info('Configuring...') rcm.instance_eval(&block) rcm.evaluate! diff --git a/lib/dslkeywords/file.rb b/lib/dslkeywords/file.rb index 58d7a47..8c4deca 100644 --- a/lib/dslkeywords/file.rb +++ b/lib/dslkeywords/file.rb @@ -62,7 +62,7 @@ module RCM dirname = ::File.dirname(@path) return unless !::File.directory?(dirname) && @create_parent - info "Creating parent directory #{parent}" + info "Creating parent directory #{dirname}" FileUtils.mkdir_p(dirname) end |
