summaryrefslogtreecommitdiff
path: root/lib/rcm.rb
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-12-06 22:33:07 +0200
committerPaul Buetow <paul@buetow.org>2024-12-06 22:33:07 +0200
commitbfdcad7efca071374de0be3124dcc92deeab681e (patch)
tree6215f6fcf5287f69840d06ad8c009dab0945ef6d /lib/rcm.rb
parent4a3629e42cb3e1fbca4356cf789a8e79043cdc51 (diff)
auto require
Diffstat (limited to 'lib/rcm.rb')
-rw-r--r--lib/rcm.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/rcm.rb b/lib/rcm.rb
new file mode 100644
index 0000000..0c3d028
--- /dev/null
+++ b/lib/rcm.rb
@@ -0,0 +1,30 @@
+Dir["#{Dir.pwd}/lib/autorequire/*.rb"].each { |m| require m }
+
+# Ruby Configiration Management system
+module RCM
+
+ # Here all starts
+ class RCM
+ include Config
+ include Options
+
+ def initialize
+ @objs = []
+ @conds_met = true
+ end
+
+ def do!
+ @objs.each(&:do!)
+ end
+
+ def <<(obj)
+ @objs << obj
+ end
+ end
+end
+
+def make_it_so(&block)
+ rcm = RCM::RCM.new
+ rcm.instance_eval(&block)
+ rcm.do!
+end