Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scala.io.Source
- /**
- * @author pawbara
- */
- object Counter {
- def main(args: Array[String]) = {
- assert(args.size == 2, "Need two commit logs")
- val parsedArgs = args map(a => parseCommits(readCommitLogFromFile(a)))
- val commitLogs = (parsedArgs(0), parsedArgs(1))
- // print(countCommits(commitLogs._1, commitLogs._2) mkString("\r\n"))
- println(countCommits(commitLogs))
- }
- def countCommits(commitLogs: (List[String], List[String])) = {
- (commitLogs._1.size, commitLogs._1 count (commitLogs._2 contains _), commitLogs._2.size)
- // commits filter (otherBranchCommits contains _)
- }
- def parseCommits(data: List[String]) = data filter(_.startsWith(" S"))
- def readCommitLogFromFile(filePath: String) = (Source fromFile filePath getLines()).toList
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement