Created
November 8, 2015 02:58
-
-
Save ayanonagon/dada7681435bbe305095 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func getLicense(URL: NSURL) throws -> License { | |
let legalText = try String(contentsOfURL: URL, encoding: NSUTF8StringEncoding) | |
let pathComponents = URL.pathComponents! | |
let libraryName = pathComponents[pathComponents.count - 2] | |
return License(libraryName: libraryName, legalText: legalText) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment