Permalink
Browse files

exporting to another folder now works

  • Loading branch information...
1 parent 0be7697 commit b3bd0512fad2833ce916b58aaae791d3e921c7e9 @runemadsen committed Mar 29, 2013
View
@@ -15,4 +15,5 @@ spec/reports
test/tmp
test/version_tmp
tmp
-.DS_Store
+.DS_Store
+test/*/build
View
@@ -4,11 +4,12 @@ class Sketch
def initialize(sketch_folder, output_folder = nil)
@sketch_folder = sketch_folder
- @output_folder = File.join(sketch_folder, "build") if output_folder.nil?
+ @output_folder = output_folder || File.join(sketch_folder, "build")
end
def run
- Headless.ly do
+ puts @output_folder
+ Headless.ly do
`#{gem_root}/bin/processing/processing-java --sketch=#{@sketch_folder} --output=#{@output_folder} --force --run`
end
end
View
@@ -10,4 +10,9 @@ def test_run_sketch
File.delete("test/test_sketch/grab.png")
end
+ def test_run_sketch_other_folder
+ sketch = P5::Sketch.new("#{File.dirname(__FILE__)}/test_sketch", "#{File.dirname(__FILE__)}/abuildfolder")
+ sketch.run
+ end
+
end
@@ -1,31 +0,0 @@
-import processing.core.*;
-import processing.data.*;
-import processing.event.*;
-import processing.opengl.*;
-
-import java.util.HashMap;
-import java.util.ArrayList;
-import java.io.BufferedReader;
-import java.io.PrintWriter;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.IOException;
-
-public class test_sketch extends PApplet {
-
-public void setup()
-{
- size(100, 100);
- ellipse(50, 50, 25, 25);
- saveFrame("grab.png");
- exit();
-}
- static public void main(String[] passedArgs) {
- String[] appletArgs = new String[] { "test_sketch" };
- if (passedArgs != null) {
- PApplet.main(concat(appletArgs, passedArgs));
- } else {
- PApplet.main(appletArgs);
- }
- }
-}
Binary file not shown.
@@ -2,6 +2,6 @@ void setup()
{
size(100, 100);
ellipse(50, 50, 25, 25);
- saveFrame("grab.png");
+ saveFrame("/vagrant/test/test_sketch/grab.png");
exit();
}

0 comments on commit b3bd051

Please sign in to comment.