<commit_before>//
//  Repo.swift
//  Buildasaur
//
//  Created by <NAME> on 13/12/2014.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Foundation

class Repo : GitHubEntity {
    
    let name: String
    let fullName: String
    let repoUrlHTTPS: String
    let repoUrlSSH: String
    let permissionsDict: NSDictionary
    
    required init(json: NSDictionary) {

        self.name = json.stringForKey("name")
        self.fullName = json.stringForKey("full_name")
        self.repoUrlHTTPS = json.stringForKey("clone_url")
        self.repoUrlSSH = json.stringForKey("ssh_url")
        
        if let permissions = json.optionalDictionaryForKey("permissions") {
            self.permissionsDict = permissions
        } else {
            self.permissionsDict = NSDictionary()
        }
        
        super.init(json: json)
    }
}

extension Repo: RepoType {
    
    var permissions: RepoPermissions {
        
        let read = self.permissionsDict["pull"] as? Bool ?? false
        let write = self.permissionsDict["push"] as? Bool ?? false
        return RepoPermissions(read: read, write: write)
    }
    
    var originUrlSSH: String {
        
        return self.repoUrlSSH
    }
    
    var latestRateLimitInfo: RateLimitType? {
        
        return self.latestRateLimitInfo
    }
}<commit_msg>fixed a beautiful infinite recursion. anyway, buildasaur passed the first test, seems to be pretty much working again. now i need to fix tests.<commit_after>//
//  Repo.swift
//  Buildasaur
//
//  Created by <NAME> on 13/12/2014.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Foundation

class Repo : GitHubEntity {
    
    let name: String
    let fullName: String
    let repoUrlHTTPS: String
    let repoUrlSSH: String
    let permissionsDict: NSDictionary
    
    var latestRateLimitInfo: RateLimitType?
    
    required init(json: NSDictionary) {

        self.name = json.stringForKey("name")
        self.fullName = json.stringForKey("full_name")
        self.repoUrlHTTPS = json.stringForKey("clone_url")
        self.repoUrlSSH = json.stringForKey("ssh_url")
        
        if let permissions = json.optionalDictionaryForKey("permissions") {
            self.permissionsDict = permissions
        } else {
            self.permissionsDict = NSDictionary()
        }
        
        super.init(json: json)
    }
}

extension Repo: RepoType {
    
    var permissions: RepoPermissions {
        
        let read = self.permissionsDict["pull"] as? Bool ?? false
        let write = self.permissionsDict["push"] as? Bool ?? false
        return RepoPermissions(read: read, write: write)
    }
    
    var originUrlSSH: String {
        
        return self.repoUrlSSH
    }
}
{'fraction_non_alphanumeric': 0.09426379247351115, 'fraction_numerical': 0.00876872488125685, 'mean_word_length': 2.2790419161676647, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4007645', 'n_tokens_mistral': 834, 'n_tokens_neox': 803, 'n_words': 201}