Compare commits
13 Commits
Author | SHA1 | Date |
---|---|---|
![]() |
1bf0af80bb | |
![]() |
984de192ea | |
![]() |
5968a3aff2 | |
![]() |
e0cfd40496 | |
![]() |
6ac7090646 | |
![]() |
2bf41a2cd5 | |
![]() |
65c5237602 | |
![]() |
450ba6cef5 | |
![]() |
15ecf990d0 | |
![]() |
66df0c6376 | |
![]() |
0f36dd90d0 | |
![]() |
193e3e01a5 | |
![]() |
e5cc25a31a |
|
@ -1,10 +0,0 @@
|
|||
image: kylef/swiftenv
|
||||
|
||||
before_script:
|
||||
- swiftenv install https://swift.org/builds/swift-3.1-release/ubuntu1604/swift-3.1-RELEASE/swift-3.1-RELEASE-ubuntu16.04.tar.gz
|
||||
|
||||
test:
|
||||
script:
|
||||
- swift build
|
||||
tags:
|
||||
- vapor
|
|
@ -1 +1 @@
|
|||
4.2
|
||||
5.1.3
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
osx_image: xcode10
|
||||
osx_image: xcode12.5
|
||||
language: objective-c
|
||||
xcode_project: Fileable.xcodeproj
|
||||
xcode_scheme: Fileable
|
||||
xcode_destination: platform=iOS Simulator,OS=12.0,name=iPhone XS
|
||||
xcode_scheme: Fileable-Package
|
||||
xcode_destination: platform=iOS Simulator,OS=14.5,name=iPhone 11
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
## Version 1.2.1
|
||||
|
||||
- Fix internal inaccessible level
|
||||
|
||||
## Version 1.2
|
||||
|
||||
- Implement get bundle file path method
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -39,8 +39,6 @@
|
|||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
|
@ -52,17 +50,6 @@
|
|||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "Fileable::Fileable"
|
||||
BuildableName = "Fileable.framework"
|
||||
BlueprintName = "Fileable"
|
||||
ReferencedContainer = "container:Fileable.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017-2018 Shota Shimazu
|
||||
Copyright (c) 2017-2019 Shota Shimazu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// swift-tools-version:4.0
|
||||
// swift-tools-version:5.0
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||

|
||||
|
||||
[](https://travis-ci.org/shotastage/Fileable.swift)
|
||||
[](https://travis-ci.com/shotastage/Fileable.swift)
|
||||
[](https://github.com/shotasatge/Fileable)
|
||||
[](http://cocoapods.org/pods/Fileable)
|
||||

|
||||

|
||||

|
||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fshotastage%2FFileable.swift?ref=badge_shield)
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// Fileable
|
||||
//
|
||||
// Created by Shota Shimazu on 2017/10/25.
|
||||
// Copyright © 2017-2019 Shota Shimazu. All rights reserved.
|
||||
// Copyright © 2017-2020 Shota Shimazu. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// Fileable
|
||||
//
|
||||
// Created by Shota Shimazu on Oct 25, 2017.
|
||||
// Copyright © 2017-2019 Shota Shimazu. All rights reserved.
|
||||
// Copyright © 2017-2020 Shota Shimazu. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
@ -21,11 +21,11 @@ open class Path {
|
|||
|
||||
// Services
|
||||
#if os(iOS) || os(watchOS) || os(tvOS)
|
||||
static let ios = FileableIOS.shared
|
||||
public static let ios = FileableIOS.shared
|
||||
#endif
|
||||
|
||||
#if os(Linux)
|
||||
static let linux = FileableLinux.shared
|
||||
public static let linux = FileableLinux.shared
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// Fileable
|
||||
//
|
||||
// Created by Shota Shimazu on 2017/10/25.
|
||||
// Copyright © 2017-2019 Shota Shimazu. All rights reserved.
|
||||
// Copyright © 2017-2020 Shota Shimazu. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// Fileable
|
||||
//
|
||||
// Created by Shota Shimazu on 2019/01/13.
|
||||
// Copyright © 2017-2019 Shota Shimazu. All rights reserved.
|
||||
// Copyright © 2017-2020 Shota Shimazu. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// Fileable
|
||||
//
|
||||
// Created by Shota Shimazu on 2017/10/25.
|
||||
// Copyright © 2017-2019 Shota Shimazu. All rights reserved.
|
||||
// Copyright © 2017-2020 Shota Shimazu. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// Fileable
|
||||
//
|
||||
// Created by Shota Shimazu on 2018/12/04.
|
||||
// Copyright © 2017-2019 Shota Shimazu. All rights reserved.
|
||||
// Copyright © 2017-2020 Shota Shimazu. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// Fileable
|
||||
//
|
||||
// Created by Shota Shimazu on 2017/10/25.
|
||||
// Copyright © 2017-2019 Shota Shimazu. All rights reserved.
|
||||
// Copyright © 2017-2020 Shota Shimazu. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// Fileable
|
||||
//
|
||||
// Created by Shota Shimazu on 2018/12/09.
|
||||
// Copyright © 2017-2019 Shota Shimazu. All rights reserved.
|
||||
// Copyright © 2017-2020 Shota Shimazu. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// Fileable
|
||||
//
|
||||
// Created by Shota Shimazu on 2018/12/09.
|
||||
// Copyright © 2017-2019 Shota Shimazu. All rights reserved.
|
||||
// Copyright © 2017-2020 Shota Shimazu. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
//
|
||||
// Old.swift
|
||||
// Fileable
|
||||
//
|
||||
// Created by Shota Shimazu on 2017/10/25.
|
||||
// Copyright © 2017-2019 Shota Shimazu. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
#if os(iOS) || os(watchOS) || os(tvOS)
|
||||
|
||||
extension Path {
|
||||
|
||||
///
|
||||
/// Deprecated methods
|
||||
///
|
||||
@available(*, unavailable, renamed: "IOSDirs.document.path")
|
||||
static func appDocument() -> String {
|
||||
fatalError("appDocument is deprecated!")
|
||||
}
|
||||
|
||||
@available(*, unavailable, renamed: "IOSDirs.cache.path")
|
||||
static func appCache() -> String {
|
||||
fatalError("appCache is deprecated!")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -3,7 +3,7 @@
|
|||
// Fileable
|
||||
//
|
||||
// Created by Shota Shimazu on 2018/12/09.
|
||||
// Copyright © 2017-2019 Shota Shimazu. All rights reserved.
|
||||
// Copyright © 2017-2020 Shota Shimazu. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
@ -18,9 +18,9 @@ open class FileableIOS {
|
|||
|
||||
private init() { }
|
||||
|
||||
static func getBundle(file: String) -> String {
|
||||
public func getBundle(file: String) -> String? {
|
||||
|
||||
let path = Bundle.main.path(forResource: file.components(separatedBy: ".")[0] , ofType: file.components(separatedBy: ".")[1])!
|
||||
let path = Bundle.main.path(forResource: file.components(separatedBy: ".")[0] , ofType: file.components(separatedBy: ".")[1])
|
||||
|
||||
return path
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ public enum IOSDirs {
|
|||
|
||||
|
||||
/// path propaty returns directory path as String type
|
||||
@available(iOS 10.0, *)
|
||||
var path: String! {
|
||||
switch self {
|
||||
|
||||
|
|
|
@ -43,6 +43,13 @@ class IOSDirsTest: XCTestCase {
|
|||
XCTAssertTrue(cacheDirectory.contains("Library/Caches"))
|
||||
XCTAssertTrue(tmpDirectory.contains("tmp"))
|
||||
}
|
||||
|
||||
|
||||
func testGetBundleFile() {
|
||||
let path = Path.ios.getBundle(file: "unlocated.txt")
|
||||
|
||||
XCTAssertNil(path)
|
||||
}
|
||||
|
||||
|
||||
func testPerformanceExample() {
|
||||
|
|
Loading…
Reference in New Issue