<commit_before>//
//  Device.swift
//  PuraScents
//
//  Created by <NAME> on 10/16/15.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import Foundation
import UIKit

// MARK: - Device Structure

public struct DeviceInfo {
    
    // MARK: - Singletons
    
    public static var currentDevice: UIDevice {
        struct Singleton {
            static let device = UIDevice.currentDevice()
        }
        return Singleton.device
    }
    
    public static var currentDeviceVersion: Float {
        struct Singleton {
            static let version = (UIDevice.currentDevice().systemVersion as NSString).floatValue
        }
        return Singleton.version
    }
    
    public static var currentDeviceHeight: CGFloat {
        struct Singleton {
            static let height = UIScreen.mainScreen().bounds.size.height
        }
        return Singleton.height
    }
    
    // MARK: - Device Idiom Checks
    
    public static func isPhone() -> Bool {
        return currentDevice.userInterfaceIdiom == .Phone
    }
    
    public static func isPad() -> Bool {
        return currentDevice.userInterfaceIdiom == .Pad
    }
    
    // MARK: - Device Version Checks
    
    public enum Versions: Float {
        case Five = 5.0
        case Six = 6.0
        case Seven = 7.0
        case Eight = 8.0
    }
    
    public static func isVersion(version: Versions) -> Bool {
        return currentDeviceVersion >= version.rawValue && currentDeviceVersion < (version.rawValue + 1.0)
    }
    
    public static func isVersionOrLater(version: Versions) -> Bool {
        return currentDeviceVersion >= version.rawValue
    }
    
    public static func isVersionOrEarlier(version: Versions) -> Bool {
        return currentDeviceVersion < (version.rawValue + 1.0)
    }
    
    // MARK: iOS 5 Checks
    
    public static func IS_OS_5() -> Bool {
        return isVersion(.Five)
    }
    
    public static func IS_OS_5_OR_LATER() -> Bool {
        return isVersionOrLater(.Five)
    }
    
    public static func IS_OS_5_OR_EARLIER() -> Bool {
        return isVersionOrEarlier(.Five)
    }
    
    // MARK: iOS 6 Checks
    
    public static func IS_OS_6() -> Bool {
        return isVersion(.Six)
    }
    
    public static func IS_OS_6_OR_LATER() -> Bool {
        return isVersionOrLater(.Six)
    }
    
    public static func IS_OS_6_OR_EARLIER() -> Bool {
        return isVersionOrEarlier(.Six)
    }
    
    // MARK: iOS 7 Checks
    
    public static func IS_OS_7() -> Bool {
        return isVersion(.Seven)
    }
    
    public static func IS_OS_7_OR_LATER() -> Bool {
        return isVersionOrLater(.Seven)
    }
    
    public static func IS_OS_7_OR_EARLIER() -> Bool {
        return isVersionOrEarlier(.Seven)
    }
    
    // MARK: iOS 8 Checks
    
    public static func IS_OS_8() -> Bool {
        return isVersion(.Eight)
    }
    
    public static func IS_OS_8_OR_LATER() -> Bool {
        return isVersionOrLater(.Eight)
    }
    
    public static func IS_OS_8_OR_EARLIER() -> Bool {
        return isVersionOrEarlier(.Eight)
    }
    
    // MARK: - Device Size Checks
    
    enum Heights: CGFloat {
        case Inches_3_5 = 480
        case Inches_4 = 568
        case Inches_4_7 = 667<commit_msg>Fix: Public enum<commit_after>//
//  Device.swift
//  PuraScents
//
//  Created by <NAME> on 10/16/15.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import Foundation
import UIKit

// MARK: - Device Structure

public struct DeviceInfo {
    
    // MARK: - Singletons
    
    public static var currentDevice: UIDevice {
        struct Singleton {
            static let device = UIDevice.currentDevice()
        }
        return Singleton.device
    }
    
    public static var currentDeviceVersion: Float {
        struct Singleton {
            static let version = (UIDevice.currentDevice().systemVersion as NSString).floatValue
        }
        return Singleton.version
    }
    
    public static var currentDeviceHeight: CGFloat {
        struct Singleton {
            static let height = UIScreen.mainScreen().bounds.size.height
        }
        return Singleton.height
    }
    
    // MARK: - Device Idiom Checks
    
    public static func isPhone() -> Bool {
        return currentDevice.userInterfaceIdiom == .Phone
    }
    
    public static func isPad() -> Bool {
        return currentDevice.userInterfaceIdiom == .Pad
    }
    
    // MARK: - Device Version Checks
    
    public enum Versions: Float {
        case Five = 5.0
        case Six = 6.0
        case Seven = 7.0
        case Eight = 8.0
    }
    
    public static func isVersion(version: Versions) -> Bool {
        return currentDeviceVersion >= version.rawValue && currentDeviceVersion < (version.rawValue + 1.0)
    }
    
    public static func isVersionOrLater(version: Versions) -> Bool {
        return currentDeviceVersion >= version.rawValue
    }
    
    public static func isVersionOrEarlier(version: Versions) -> Bool {
        return currentDeviceVersion < (version.rawValue + 1.0)
    }
    
    // MARK: iOS 5 Checks
    
    public static func IS_OS_5() -> Bool {
        return isVersion(.Five)
    }
    
    public static func IS_OS_5_OR_LATER() -> Bool {
        return isVersionOrLater(.Five)
    }
    
    public static func IS_OS_5_OR_EARLIER() -> Bool {
        return isVersionOrEarlier(.Five)
    }
    
    // MARK: iOS 6 Checks
    
    public static func IS_OS_6() -> Bool {
        return isVersion(.Six)
    }
    
    public static func IS_OS_6_OR_LATER() -> Bool {
        return isVersionOrLater(.Six)
    }
    
    public static func IS_OS_6_OR_EARLIER() -> Bool {
        return isVersionOrEarlier(.Six)
    }
    
    // MARK: iOS 7 Checks
    
    public static func IS_OS_7() -> Bool {
        return isVersion(.Seven)
    }
    
    public static func IS_OS_7_OR_LATER() -> Bool {
        return isVersionOrLater(.Seven)
    }
    
    public static func IS_OS_7_OR_EARLIER() -> Bool {
        return isVersionOrEarlier(.Seven)
    }
    
    // MARK: iOS 8 Checks
    
    public static func IS_OS_8() -> Bool {
        return isVersion(.Eight)
    }
    
    public static func IS_OS_8_OR_LATER() -> Bool {
        return isVersionOrLater(.Eight)
    }
    
    public static func IS_OS_8_OR_EARLIER() -> Bool {
        return isVersionOrEarlier(.Eight)
    }
    
    // MARK: - Device Size Checks
    
    public enum Heights: CGFloat {
        case Inches_3_5 = 480
        case Inches_4 = 568
        case Inches_4_7 = 667
{'fraction_non_alphanumeric': 0.08680342927127985, 'fraction_numerical': 0.015921616656460504, 'mean_word_length': 1.9165178571428572, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 45, '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': '5705416', 'n_tokens_mistral': 2143, 'n_tokens_neox': 1956, 'n_words': 512}