Sha256: 7a1518892218f105723b26599b9f6607f1f670a96b6568820924b865ff4b1e30
Contents?: true
Size: 806 Bytes
Versions: 9
Compression:
Stored size: 806 Bytes
Contents
module Prospectus ## # Define list object that contains items class List def initialize(params = {}) @options = params end def items @items ||= [] end def check all, good_only = @options.values_at(:all, :good_only) items.select do |x| match = x.actual =~ x.expected true if all || (!match ^ good_only) end end end ## # DSL for wrapping eval of list files class ListDSL def initialize(list, params) @list = list @options = params end def item(&block) item = Item.new(@options) dsl = ItemDSL.new(item, @options) dsl.instance_eval(&block) @list.items << item item.list.items.each do |x| x.prefix item.name @list.items << x end end end end
Version data entries
9 entries across 9 versions & 1 rubygems