public static Specification ReadFromText(string text) { using (var reader = new MarkdownReader(new StringReader(text))) { return reader.Read(); } }
public static Specification ReadFromText(string text) { using (var reader = new MarkdownReader(new StringReader(text))) { return(reader.Read()); } }
public static Specification ReadFromFile(string file) { using (var stream = new FileStream(file, FileMode.Open)) { var reader = new StreamReader(stream); var spec = new MarkdownReader(reader).Read(); spec.Filename = file; return(spec); } }
public static Specification ReadFromFile(string file) { using (var stream = new FileStream(file, FileMode.Open, FileAccess.Read)) { using (var reader = new StreamReader(stream)) { var spec = new MarkdownReader(reader).Read(); spec.Filename = file; return spec; } } }
public static Specification ReadFromFile(string file) { using (var stream = new FileStream(file, FileMode.Open, FileAccess.Read)) { using (var reader = new StreamReader(stream)) { var spec = new MarkdownReader(reader).Read(); spec.Filename = file; if (spec.name.IsEmpty()) { spec.name = Path.GetFileNameWithoutExtension(file); ConsoleWriter.Write(ConsoleColor.Yellow, $"The spec file at {file} appears to be empty"); } return(spec); } } }