<commit_before>//
//  IssuesViewController.swift
//  Freetime
//
//  Created by <NAME> on 5/17/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit
import IGListKit

class IssuesViewController: UIViewController {

    fileprivate let client: GithubClient
    lazy fileprivate var feed: Feed = { Feed(viewController: self, delegate: self) }()

    init(client: GithubClient) {
        self.client = client
        super.init(nibName: nil, bundle: nil)
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        feed.viewDidLoad()
        feed.adapter.dataSource = self
    }

}

extension IssuesViewController: IGListAdapterDataSource {

    func objects(for listAdapter: IGListAdapter) -> [IGListDiffable] {
        return []
    }

    func listAdapter(_ listAdapter: IGListAdapter, sectionControllerFor object: Any) -> IGListSectionController {
        return IGListSectionController()
    }

    func emptyView(for listAdapter: IGListAdapter) -> UIView? {
        return nil
    }

}

extension IssuesViewController: FeedDelegate {

    func loadFromNetwork(feed: Feed) {

    }

}<commit_msg>DI and stub request in issues VC<commit_after>//
//  IssuesViewController.swift
//  Freetime
//
//  Created by <NAME> on 5/17/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit
import IGListKit

final class IssuesViewController: UIViewController {

    fileprivate let client: GithubClient
    fileprivate let owner: String
    fileprivate let repo: String
    fileprivate let number: String
    lazy fileprivate var feed: Feed = { Feed(viewController: self, delegate: self) }()

    init(
        client: GithubClient,
        owner: String,
        repo: String, 
        number: String
        ) {
        self.client = client
        self.owner = owner
        self.repo = repo
        self.number = number
        super.init(nibName: nil, bundle: nil)
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        feed.viewDidLoad()
        feed.adapter.dataSource = self
    }

}

extension IssuesViewController: IGListAdapterDataSource {

    func objects(for listAdapter: IGListAdapter) -> [IGListDiffable] {
        return []
    }

    func listAdapter(_ listAdapter: IGListAdapter, sectionControllerFor object: Any) -> IGListSectionController {
        return IGListSectionController()
    }

    func emptyView(for listAdapter: IGListAdapter) -> UIView? {
        return nil
    }

}

extension IssuesViewController: FeedDelegate {

    func loadFromNetwork(feed: Feed) {
        client.requestIssue(owner: owner, repo: repo, number: number) { result in
            switch result {
            case .success: print("yay")
            case .failure: print("nope")
            }
        }
    }

}
{'fraction_non_alphanumeric': 0.0949367088607595, 'fraction_numerical': 0.005996002664890073, 'mean_word_length': 2.64, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '7307823', 'n_tokens_mistral': 908, 'n_tokens_neox': 834, 'n_words': 230}