diff --git a/SwiftShell/Stream.swift b/SwiftShell/Stream.swift index 395eed5..85f1972 100644 --- a/SwiftShell/Stream.swift +++ b/SwiftShell/Stream.swift @@ -22,13 +22,13 @@ public protocol ReadableStreamType : Streamable { */ func readSome() -> String? - /// Reads everything at once. + /** Reads everything at once. */ func read() -> String - /// Lazily splits the stream into lines + /** Lazily splits the stream into lines. */ func lines() -> SequenceOf - /// Allows stream to be used by "println" + /** Allows stream to be used by "println". */ func writeTo(inout target: Target) } @@ -37,12 +37,12 @@ public protocol WriteableStreamType : OutputStreamType { func write(string: String) - /// Must be called on local streams when done writing. + /** Must be called on local streams when done writing. */ func closeStream() } /** Creates a stream from a String. */ -public func stream(text: String) -> ReadableStreamType { +public func stream (text: String) -> ReadableStreamType { let pipe = NSPipe() let input = pipe.fileHandleForWriting input.write(text) @@ -59,9 +59,6 @@ public func stream ( closureclosure:() -> () -> String? ) -> ReadableStreamType if let text = closure() { filehandle.write(text) } else { - // why won't this work? (beta 6) - // filehandle.writeabilityHandler = nil - input.writeabilityHandler = nil } } diff --git a/SwiftShell/String.swift b/SwiftShell/String.swift index 9a8467a..4a7936f 100644 --- a/SwiftShell/String.swift +++ b/SwiftShell/String.swift @@ -22,7 +22,11 @@ extension String { return self.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) } - /// Split the string at the first occurrence of separator, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing the string itself, followed by two empty strings. + /** + Splits the string at the first occurrence of separator, and returns a 3-tuple containing the part + before the separator, the separator itself, and the part after the separator. If the separator is + not found, returns a 3-tuple containing the string itself, followed by two empty strings. + */ public func partition(separator: String) -> (String, String, String) { if let separatorRange = self.rangeOfString(separator) { if !separatorRange.isEmpty {