@Test public void testGitlabRoutesParser() throws Exception { File f = ResourceManager.getRailsFile("gitlab_routes.rb"); assert(f.exists()); Map<String, RailsRoute> mappings = RailsRoutesParser.parse(f); compareRoutes(GITLAB_ROUTES, mappings); }
public static Map parse(@Nonnull File file) { if (!file.exists()) { LOG.error("File not found. Exiting. " + file.getName()); return null; } RailsRoutesParser parser = new RailsRoutesParser(); EventBasedTokenizerRunner.runRails(file, parser); return parser.mappings; }
RailsRoutesParser implements EventBasedTokenizer { public static Map parse(@Nonnull File file) { if (!file.exists()) { LOG.error("File not found. Exiting. " + file.getName()); return null; } RailsRoutesParser parser = new RailsRoutesParser(); EventBasedTokenizerRunner.runRails(file, parser); return parser.mappings; } }
RailsRoutesParser implements EventBasedTokenizer { public static Map parse(@Nonnull File file) { if (!file.exists()) { LOG.error("File not found. Exiting. " + file.getName()); return null; } RailsRoutesParser parser = new RailsRoutesParser(); EventBasedTokenizerRunner.runRails(file, parser); return parser.mappings; }  }
RailsRoutesParser implements EventBasedTokenizer { public static Map parse(@Nonnull File file) { if (!file.exists()) { LOG.error("File not found. Exiting. " + file.getName()); return null; } RailsRoutesParser parser = new RailsRoutesParser(); EventBasedTokenizerRunner.runRails(file, parser); return parser.mappings; }  static Map parse(@Nonnull File file); @Override boolean shouldContinue(); @Override void processToken(int type, int lineNumber, String stringValue); }
RailsRoutesParser implements EventBasedTokenizer { public static Map parse(@Nonnull File file) { if (!file.exists()) { LOG.error("File not found. Exiting. " + file.getName()); return null; } RailsRoutesParser parser = new RailsRoutesParser(); EventBasedTokenizerRunner.runRails(file, parser); return parser.mappings; }  static Map parse(@Nonnull File file); @Override boolean shouldContinue(); @Override void processToken(int type, int lineNumber, String stringValue);  }