summaryrefslogtreecommitdiff
path: root/lib/rcm.rb
blob: 0c3d028d0ff194cd29ecc30f3532a7f1a985399c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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