lib/dotremap/dsl/root.rb in dotremap-0.0.6 vs lib/dotremap/dsl/root.rb in dotremap-0.0.7

- old
+ new

@@ -1,16 +1,20 @@ +require "dotremap/namespace" require "dotremap/appdef" -require "dotremap/dsl" require "dotremap/item" +require "dotremap/group" +require "dotremap/dsl/group" module Dotremap::DSL::Root - def item(name = nil, options = {}, &block) - item = Dotremap::Item.new(name, options) - item.instance_exec(&block) - childs << item + include Dotremap::DSL::Group + + def group(name, &block) + group = Dotremap::Group.new(name) + group.instance_exec(&block) + add_child(group) end def appdef(appname = '', options = {}) appdef = Dotremap::Appdef.new(appname, options) - childs << appdef + add_child(appdef) end end