lib/cukedep/feature-model.rb in cukedep-0.1.04 vs lib/cukedep/feature-model.rb in cukedep-0.1.05

- old
+ new

@@ -12,11 +12,11 @@ # Dependencies: use topological sort # TSort module http://ruby-doc.org/stdlib-1.9.3/libdoc/tsort/rdoc/TSort.html # See also: Is this topological sort in Ruby flawed? class FeatureModel -FeatureDependencies = Struct.new(:dependee, :dependents) + FeatureDependencies = Struct.new(:dependee, :dependents) # Helper class used internally by FeatureModel class. # Purpose: to try to create a valid dependency graph and perform a # topological sort of the nodes. class DepGraph @@ -162,11 +162,11 @@ anIO.write heading end # Output the nodes as graph vertices + their edges with parent node def emit_body(anIO) - anIO.puts <<-EOS + anIO.puts <<-EOS subgraph island { node [shape = box, style=filled, color=lightgray]; EOS feature_files.each_with_index do |ff, i| draw_node(anIO, ff, i) if ff.feature.anonymous? @@ -241,10 +241,11 @@ File.open(rakefile, 'w') { |f| f.write(file_source) } end protected + def validated_model(theFeatureFiles) return theFeatureFiles end # Build the mapping: feature identifier => feature @@ -277,10 +278,10 @@ # Complain when dependency tag refers to an unknown feature dependents = dep_tags.map do |a_tag| unless aMapping.include?(a_tag) msg_p1 = "Feature with identifier '#{its_id}'" msg_p2 = " depends on unknown feature '#{a_tag}'" - fail(StandardError, msg_p1 = msg_p2) + fail(StandardError, msg_p1, msg_p2) end aMapping[a_tag] end @dependencies << FeatureDependencies.new(feature_file, dependents)