This repository has been archived by the owner on Aug 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from readium/2.0.0-alpha.1
2.0.0-alpha.1
- Loading branch information
Showing
9 changed files
with
92 additions
and
9 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
Pod::Spec.new do |s| | ||
|
||
s.name = 'R2Shared' | ||
s.version = '1.4.3' | ||
s.version = '2.0.0-alpha.1' | ||
s.license = 'BSD 3-Clause License' | ||
s.summary = 'R2 Shared' | ||
s.homepage = 'http://readium.github.io' | ||
s.author = { "Aferdita Muriqi" => "[email protected]" } | ||
s.source = { :git => 'https://github.com/readium/r2-shared-swift.git', :tag => '1.4.3' } | ||
s.exclude_files = ["**/Info*.plist"] | ||
s.source = { :git => 'https://github.com/readium/r2-shared-swift.git', :tag => '2.0.0-alpha.1' } | ||
s.exclude_files = ["**/Info*.plist", "r2-shared-swift/Toolkit/Archive/ZIPFoundation.swift"] | ||
s.requires_arc = true | ||
s.resources = ['r2-shared-swift/Resources/**'] | ||
s.source_files = "r2-shared-swift/**/*.{m,h,swift}" | ||
s.platform = :ios | ||
s.ios.deployment_target = "10.0" | ||
s.frameworks = 'CoreServices' | ||
s.libraries = 'xml2' | ||
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' } | ||
|
||
s.dependency 'Fuzi' | ||
s.dependency 'Minizip' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// URL.swift | ||
// r2-shared-swift | ||
// | ||
// Created by Mickaël Menu on 03/08/2020. | ||
// | ||
// Copyright 2020 Readium Foundation. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license which is detailed | ||
// in the LICENSE file present in the project repository where this source code is maintained. | ||
// | ||
|
||
import Foundation | ||
|
||
extension URL { | ||
|
||
/// Adds the given `newScheme` to the URL, but only if the URL doesn't already have one. | ||
public func addingSchemeIfMissing(_ newScheme: String) -> URL { | ||
guard scheme == nil else { | ||
return self | ||
} | ||
|
||
var components = URLComponents(url: self, resolvingAgainstBaseURL: true) | ||
components?.scheme = newScheme | ||
return components?.url ?? self | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// URLTests.swift | ||
// r2-shared-swift | ||
// | ||
// Created by Mickaël Menu on 03/08/2020. | ||
// | ||
// Copyright 2020 Readium Foundation. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license which is detailed | ||
// in the LICENSE file present in the project repository where this source code is maintained. | ||
// | ||
|
||
import XCTest | ||
@testable import R2Shared | ||
|
||
class URLTests: XCTestCase { | ||
|
||
func testAddingSchemeIfMissing() { | ||
XCTAssertEqual( | ||
URL(string: "//www.google.com/path")!.addingSchemeIfMissing("test"), | ||
URL(string: "test://www.google.com/path")! | ||
) | ||
XCTAssertEqual( | ||
URL(string: "http://www.google.com/path")!.addingSchemeIfMissing("test"), | ||
URL(string: "http://www.google.com/path")! | ||
) | ||
} | ||
|
||
} |