Title: [675] trunk/rails-integration/src/main/java/org/jruby/webapp/ASTSerializerMain.java: Drop ASTSerializerMain as it is no longer used, and won't compile on JRuby-trunk
- Revision
- 675
- Author
- tantalon
- Date
- 2007-07-21 00:55:57 -0400 (Sat, 21 Jul 2007)
Log Message
Drop ASTSerializerMain as it is no longer used, and won't compile on JRuby-trunk
Removed Paths
Diff
Deleted: trunk/rails-integration/src/main/java/org/jruby/webapp/ASTSerializerMain.java (674 => 675)
--- trunk/rails-integration/src/main/java/org/jruby/webapp/ASTSerializerMain.java 2007-07-21 04:53:04 UTC (rev 674)
+++ trunk/rails-integration/src/main/java/org/jruby/webapp/ASTSerializerMain.java 2007-07-21 04:55:57 UTC (rev 675)
@@ -1,70 +0,0 @@
-package org.jruby.webapp;
-import org.jruby.main.ASTSerializer;
-import java.io.File;
-import java.io.IOException;
-/**
- * Allows AST serialization to be done from the command-line.
- * This should be added to ASTSerializer.
- *
- * @author Robert Egglestone
- */
-public class ASTSerializerMain {
-
- private static final String DEFAULT_SUFFIX = ".ast.ser";
- private boolean replace = false;
-
- public static void main(String[] args) {
- ASTSerializerMain main = new ASTSerializerMain();
- // usage
- int argIndex = 0;
- if (args.length == 0) usage();
-
- // replace?
- if (args[argIndex].equals("--replace")) {
- argIndex++;
- main.replace = true;
- }
-
- // preparse the file
- main.preparseAll(new File("."));
-
- // done
- System.exit(0);
- }
-
- public void preparseAll(File folder) {
- File[] sources = folder.listFiles();
- for(int i=0; i<sources.length; i++) {
- File source = sources[i];
- if (source.isDirectory()) {
- preparseAll(source);
- } else if(source.isFile() && source.getName().endsWith(".rb")) {
- preparse(source);
- }
- }
- }
-
- public void preparse(File source) {
- String sourcePath = source.getPath();
- if (sourcePath.startsWith("." + File.separatorChar)) {
- source = new File(sourcePath.substring(2));
- }
-
- try {
- File target = new File(source.getPath() + DEFAULT_SUFFIX);
- ASTSerializer.serialize(source, target);
- if (replace) source.delete();
- } catch (NullPointerException e) {
- System.err.println("Warning: failed to preparse " + source.getPath());
- } catch (IOException e) {
- System.err.println("Warning: failed to preparse " + source.getPath() + ": " + e.getMessage());
- }
- }
-
- private static void usage() {
- System.out.println("Usage: ASTSerializerMain [--replace]");
- System.out.println("Preparses the Ruby files in the current directory");
- System.exit(1);
- }
-
-}
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel