Created
September 23, 2011 18:32
-
-
Save coreypurcell/1238111 to your computer and use it in GitHub Desktop.
Revisions
-
coreypurcell revised this gist
Sep 23, 2011 . No changes.There are no files selected for viewing
-
coreypurcell revised this gist
Sep 23, 2011 . 1 changed file with 1 addition and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,13 +13,9 @@ end b.run Tempfile.new('testing_circuit.ps') do |file| DotWriter.write(b, file.path) file.size.should > 0 end end -
coreypurcell revised this gist
Sep 23, 2011 . 1 changed file with 8 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,10 +13,14 @@ end b.run file = Tempfile.new('testing_circuit.ps') begin DotWriter.write(b, file.path) file.size.should > 0 ensure file.close file.unlink end end end -
coreypurcell revised this gist
Sep 23, 2011 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,4 +19,16 @@ end end class DotWriter def self.write(board, filename) g = Graph.new(board) IO.popen("dot -Tps -o #{filename}", 'r+') do |dot| dot.write(g.to_dot) end end end -
coreypurcell created this gist
Sep 23, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ require 'circuitizer' describe DotWriter do it "writes a board to a file" do b = Board.new do source 's1', true source 's2', true and_gate 'AND' reading 'OUT' trace 's1', 'AND' trace 's2', 'AND' trace 'AND', 'OUT' end b.run DotWriter.write(b, 'circuit.ps') File.exists?('circuit.ps').should be_true end end