require 'set' require File.dirname(__FILE__) + "/dsl" require File.dirname(__FILE__) + "/feature_filters" require File.dirname(__FILE__) + "/sso_filters" module CQL QUERY_VALUES = %w(name uri line description type steps id tags examples) class MapReduce CQL::QUERY_VALUES.each do |property| define_singleton_method(property) do |input| input = [input] if input.class != Array input.map { |a| a[property] } end end %w(all everything complete).each do |method_name| define_singleton_method(method_name) { |input| input } end def self.step_lines input input = [input] if input.class != Array steps(input).map do |scen| scen.map { |line| line['keyword'] + line['name'] } end end def self.feature_children input, args results = [] input = filter_features(input, 'feature'=>args['feature']) if args.has_key?('feature') input.each do |feature| feature['elements'].each do |element| results.push element if element['type'] == args['what'] end end results end end end