Package com.github.sommeri.less4j.utils.w3ctestsextractor.common

Examples of com.github.sommeri.less4j.utils.w3ctestsextractor.common.SimpleFileWriter


    builder.buildTestCases();
    builder.outputTestCases();
  }

  private void outputTestCases() {
    SimpleFileWriter writer = new SimpleFileWriter();
    for (Entry<String, List<TestCase>> couple : testCases.entrySet()) {
      String kind = couple.getKey();
      String content = "";
      List<TestCase> tests = couple.getValue();
      for (TestCase testCase : tests) {
        content += "/* " + testCase.getName() + " */\n";
        content += toMediaQuery(kind, testCase.getTestCase());
      }

      try {
        String outputDirectory = getCurrentDirectory() + OUTPUT_DIRECTORY;
        ensureDirectory(outputDirectory);
        writer.write(outputDirectory + kind + ".less", content);
      } catch (IOException e) {
        throw new IllegalStateException(e);
      }
      System.out.println(content);
    }
View Full Code Here


  public static void main(String[] args) throws IOException {
    (new SelectorsDownloader()).doIt();
  }

  public void doIt() throws MalformedURLException, IOException {
    SimpleFileWriter writer = new SimpleFileWriter();
    for (String string : Links.LINKS) {
      String shortName = string.substring(9, string.indexOf(".xml"));
      String link = toFullLink(shortName);
      String comment = string.substring(string.indexOf("xml\">") + 5, string.indexOf("</a>"));

      String content = getContent(link);
      String outputDirectory = getCurrentDirectory() + OUTPUT_DIRECTORY;
      ensureDirectory(outputDirectory);
      writer.write(outputDirectory + shortName + ".less", toComment(link, comment) + content);
    }
  }
View Full Code Here

TOP

Related Classes of com.github.sommeri.less4j.utils.w3ctestsextractor.common.SimpleFileWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.