<commit_before>//
//  PodsHelpYepViewController.swift
//  Yep
//
//  Created by nixzhu on 15/8/31.
//  Copyright (c) 2015年 Catch Inc. All rights reserved.
//

import UIKit

class PodsHelpYepViewController: UITableViewController {

    let pods: [[String: String]] = [
        [
            "name": "RealmSwift",
            "URLString": "https://realm.io",
        ],
        [
            "name": "MZFayeClient",
            "URLString": "https://github.com/m1entus/MZFayeClient",
        ],
        [
            "name": "Proposer",
            "URLString": "https://github.com/nixzhu/Proposer",
        ],
        [
            "name": "KeyboardMan",
            "URLString": "https://github.com/nixzhu/KeyboardMan",
        ],
        [
            "name": "Ruler",
            "URLString": "https://github.com/nixzhu/Ruler",
        ],
        [
            "name": "APAddressBook/Swift",
            "URLString": "https://github.com/Alterplay/APAddressBook",
        ],
        [
            "name": "1PasswordExtension",
            "URLString": "https://github.com/AgileBits/onepassword-app-extension",
        ],
        [
            "name": "Kingfisher",
            "URLString": "https://github.com/onevcat/Kingfisher",
        ],
        [
            "name": "FXBlurView",
            "URLString": "https://github.com/nicklockwood/FXBlurView",
        ],
        [
            "name": "TPKeyboardAvoiding",
            "URLString": "https://github.com/michaeltyson/TPKeyboardAvoidin",
        ],
        [
            "name": "DeviceGuru",
            "URLString": "https://github.com/InderKumarRathore/DeviceGuru",
        ],
        [
            "name": "AFNetworking",
            "URLString": "https://github.com/AFNetworking/AFNetworkin",
        ],
        [
            "name": "pop",
            "URLString": "https://github.com/facebook/pop",
        ],
    ]

    override func viewDidLoad() {
        super.viewDidLoad()

        title = NSLocalizedString("Pods", comment: "")

        tableView.tableFooterView = UIView()


        // Uncomment the following line to preserve selection between presentations
        // self.clearsSelectionOnViewWillAppear = false

        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem()
    }

    // MARK: - Table view data source

    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
    }

    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return pods.count
    }

    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier("PodCell", forIndexPath: indexPath) as! UITableViewCell

        let pod = pods[indexPath.row]

        cell.textLabel?.text = pod["name"]

        return cell
    }

    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        tableView.deselectRowAtIndexPath(indexPath, animated: true)

        let pod = pods[indexPath.row]

        if let
            URLString = pod["URLString"],
            URL = NSURL(string: URLString) {
                UIApplication.sharedApplication().openURL(URL)
        }
    }

    /*
    // Override to support conditional editing of the table view.
    override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
    // Return NO if you do not want the specified item to be editable.
    return true
    }
    */

    /*
    // Override to support editing the table view.
    override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
    if editingStyle == .Delete {
    // Delete the row from the data source
    tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
    } else if editingStyle == .Insert {
    // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }
    }
    */

    /*
    // Override to support rearranging the table view.
    override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) {

    }
    */

    /*
    // Override to support conditional rearranging of the table view.
    override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool {
    // Return NO if you do not want the item to be re-orderable.
    return true
    }
    */

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
    }
    */
    
}
<commit_msg>clean code<commit_after>//
//  PodsHelpYepViewController.swift
//  Yep
//
//  Created by nixzhu on 15/8/31.
//  Copyright (c) 2015年 Catch Inc. All rights reserved.
//

import UIKit

class PodsHelpYepViewController: UITableViewController {

    let pods: [[String: String]] = [
        [
            "name": "RealmSwift",
            "URLString": "https://realm.io",
        ],
        [
            "name": "MZFayeClient",
            "URLString": "https://github.com/m1entus/MZFayeClient",
        ],
        [
            "name": "Proposer",
            "URLString": "https://github.com/nixzhu/Proposer",
        ],
        [
            "name": "KeyboardMan",
            "URLString": "https://github.com/nixzhu/KeyboardMan",
        ],
        [
            "name": "Ruler",
            "URLString": "https://github.com/nixzhu/Ruler",
        ],
        [
            "name": "APAddressBook/Swift",
            "URLString": "https://github.com/Alterplay/APAddressBook",
        ],
        [
            "name": "1PasswordExtension",
            "URLString": "https://github.com/AgileBits/onepassword-app-extension",
        ],
        [
            "name": "Kingfisher",
            "URLString": "https://github.com/onevcat/Kingfisher",
        ],
        [
            "name": "FXBlurView",
            "URLString": "https://github.com/nicklockwood/FXBlurView",
        ],
        [
            "name": "TPKeyboardAvoiding",
            "URLString": "https://github.com/michaeltyson/TPKeyboardAvoidin",
        ],
        [
            "name": "DeviceGuru",
            "URLString": "https://github.com/InderKumarRathore/DeviceGuru",
        ],
        [
            "name": "AFNetworking",
            "URLString": "https://github.com/AFNetworking/AFNetworkin",
        ],
        [
            "name": "pop",
            "URLString": "https://github.com/facebook/pop",
        ],
    ]

    override func viewDidLoad() {
        super.viewDidLoad()

        title = NSLocalizedString("Pods", comment: "")

        tableView.tableFooterView = UIView()
    }

    // MARK: - Table view data source

    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
    }

    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return pods.count
    }

    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier("PodCell", forIndexPath: indexPath) as! UITableViewCell

        let pod = pods[indexPath.row]

        cell.textLabel?.text = pod["name"]

        return cell
    }

    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        tableView.deselectRowAtIndexPath(indexPath, animated: true)

        let pod = pods[indexPath.row]

        if let
            URLString = pod["URLString"],
            URL = NSURL(string: URLString) {
                UIApplication.sharedApplication().openURL(URL)
        }
    }
}

{'fraction_non_alphanumeric': 0.11882640586797066, 'fraction_numerical': 0.00293398533007335, 'mean_word_length': 2.1189477697293175, 'pattern_counts': {'":': 52, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 26, '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': '1563688', 'n_tokens_mistral': 2452, 'n_tokens_neox': 2303, 'n_words': 508}