Skip to content
This repository was archived by the owner on May 21, 2024. It is now read-only.

Commit 97d0fe4

Browse files
authored
Merge pull request #1 from gperdomor/feature/unbox-integration
Feature/unbox integration
2 parents 8472543 + 61ef322 commit 97d0fe4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+874
-864
lines changed

.travis.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,39 @@ cache:
77
directories:
88
- Carthage
99

10-
xcode_project: MoyaModelMapper.xcodeproj
10+
xcode_project: MoyaUnbox.xcodeproj
1111

1212
xcode_scheme:
13-
- MoyaModelMapper
14-
- RxMoyaModelMapper
15-
- ReactiveMoyaModelMapper
13+
- MoyaUnbox
14+
- RxMoyaUnbox
15+
- ReactiveMoyaUnbox
1616

1717
env:
1818
- CACHE_NAME=iOS PLATFORM=iOS
1919
- CACHE_NAME=macOS PLATFORM=macOS
2020
- CACHE_NAME=tvOS PLATFORM=tvOS
2121
- CACHE_NAME=watchOS PLATFORM=watchOS
2222

23+
matrix:
24+
allow_failures:
25+
- xcode_project: MoyaUnbox.xcodeproj
26+
xcode_scheme: MoyaUnbox
27+
env: CACHE_NAME=watchOS PLATFORM=watchOS
28+
- xcode_project: MoyaUnbox.xcodeproj
29+
xcode_scheme: RxMoyaUnbox
30+
env: CACHE_NAME=watchOS PLATFORM=watchOS
31+
- xcode_project: MoyaUnbox.xcodeproj
32+
xcode_scheme: ReactiveMoyaUnbox
33+
env: CACHE_NAME=watchOS PLATFORM=watchOS
34+
2335
before_install:
2436
- brew update
2537
# Cocoapod
26-
- brew install cocoapods || brew upgrade cocoapods
38+
- brew outdated cocoapods || brew upgrade cocoapods
2739
# SwiftLint
28-
- brew install swiftlint || brew upgrade swiftlint
40+
- brew outdated swiftlint || brew upgrade swiftlint
2941
# Carthage tools
30-
- brew install carthage || brew upgrade carthage
42+
- brew outdated carthage || brew upgrade carthage
3143
- curl -L -O https://github.com/YPlan/CartfileDiff/releases/download/0.1/CartfileDiff.pkg
3244
- sudo installer -pkg CartfileDiff.pkg -target /
3345
# xcpretty
@@ -60,7 +72,7 @@ before_script:
6072
;;
6173
esac
6274

63-
- if [ ${SCHEME} == "MoyaModelMapper-iOS" ]; then
75+
- if [ ${SCHEME} == "MoyaUnbox-iOS" ]; then
6476
export POD_LINT="YES";
6577
fi
6678

@@ -69,14 +81,15 @@ before_script:
6981
- PLATFORM=${PLATFORM} ./scripts/bootstrap-if-needed
7082

7183
script:
84+
- printenv
7285
- set -o pipefail
7386
- xcodebuild -version
7487
- xcodebuild -showsdks
7588

7689
- xcodebuild clean -project "${TRAVIS_XCODE_PROJECT}" -scheme "${SCHEME}" | xcpretty
7790

7891
# Build Framework in Debug and Run Tests if specified
79-
- echo "BUILD FOR DEBUG"
92+
- echo "BUILD FOR DEBUG ---> RUN_TESTS = ${RUN_TESTS}"
8093
- if [ ${RUN_TESTS} == "YES" ]; then
8194
xcodebuild -project "${TRAVIS_XCODE_PROJECT}" -scheme "${SCHEME}" -sdk "${SDK}" -destination "${DESTINATION}" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
8295
else
@@ -86,7 +99,7 @@ script:
8699
- xcodebuild clean -project "$TRAVIS_XCODE_PROJECT" -scheme "$SCHEME" | xcpretty
87100

88101
# Build Framework in Release and Run Tests if specified
89-
- echo "BUILD FOR RELEASE"
102+
- echo "BUILD FOR RELEASE ---> RUN_TESTS = ${RUN_TESTS}"
90103
- if [ ${RUN_TESTS} == "YES" ]; then
91104
xcodebuild -project "${TRAVIS_XCODE_PROJECT}" -scheme "${SCHEME}" -sdk "${SDK}" -destination "${DESTINATION}" -configuration Release ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
92105
else

CHANGELOG.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Next
22

3-
# 1.0.1
4-
5-
- Minor fixes.
6-
- Improved docs.
7-
- Updated deps.
8-
93
# 1.0.0
104

115
- Initial release.

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
github "Moya/Moya" ~> 8.0
2-
github "lyft/mapper" ~> 6.0
2+
github "johnsundell/unbox" ~> 2.4

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ github "Quick/Quick" "v1.1.0"
55
github "ReactiveCocoa/ReactiveSwift" "1.1.0"
66
github "ReactiveX/RxSwift" "3.2.0"
77
github "antitypical/Result" "3.2.1"
8-
github "lyft/mapper" "6.0.0"
8+
github "johnsundell/unbox" "2.4.0"

Dangerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ end
2222
# Carthage Xcode project to avoid breaking things for our Carthage users.
2323
added_swift_library_files = git.added_files.grep(/Sources.*\.swift/).empty?
2424
deleted_swift_library_files = git.deleted_files.grep(/Sources.*\.swift/).empty?
25-
modified_carthage_xcode_project = !(git.deleted_files.grep(/MoyaModelMapper\.xcodeproj/).empty?)
25+
modified_carthage_xcode_project = !(git.deleted_files.grep(/MoyaUnbox\.xcodeproj/).empty?)
2626
if (added_swift_library_files || deleted_swift_library_files) && modified_carthage_xcode_project
2727
fail("Added or removed library files require the Carthage Xcode project to be updated.")
2828
end
@@ -35,7 +35,7 @@ end
3535

3636
# Warn when either the podspec or Cartfile + Cartfile.resolved has been updated,
3737
# but not both.
38-
podspec_updated = !git.modified_files.grep(/MoyaModelMapper.podspec/).empty?
38+
podspec_updated = !git.modified_files.grep(/MoyaUnbox.podspec/).empty?
3939
cartfile_updated = !git.modified_files.grep(/Cartfile/).empty?
4040
cartfile_resolved_updated = !git.modified_files.grep(/Cartfile.resolved/).empty?
4141

Demo/Demo/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// AppDelegate.swift
33
// Demo
44
//
5-
// Created by Gustavo Perdomo on 2/20/17.
5+
// Created by Gustavo Perdomo on 3/5/17.
66
// Copyright (c) 2017 Gustavo Perdomo. Licensed under the MIT license, as follows:
77
//
88
// Permission is hereby granted, free of charge, to any person obtaining a copy

Demo/Demo/GitHubAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// GitHubAPI.swift
33
// Demo
44
//
5-
// Created by Gustavo Perdomo on 2/20/17.
5+
// Created by Gustavo Perdomo on 3/5/17.
66
// Copyright (c) 2017 Gustavo Perdomo. Licensed under the MIT license, as follows:
77
//
88
// Permission is hereby granted, free of charge, to any person obtaining a copy

Demo/Demo/Issue.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Issue.swift
33
// Demo
44
//
5-
// Created by Gustavo Perdomo on 2/20/17.
5+
// Created by Gustavo Perdomo on 3/5/17.
66
// Copyright (c) 2017 Gustavo Perdomo. Licensed under the MIT license, as follows:
77
//
88
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -25,18 +25,18 @@
2525
//
2626

2727
import Foundation
28-
import Mapper
28+
import Unbox
2929

30-
class Issue: Mappable {
30+
struct Issue: Unboxable {
3131
let identifier: Int
3232
let number: Int
3333
let title: String
3434
let body: String
35-
36-
required init(map: Mapper) throws {
37-
try identifier = map.from("id")
38-
try number = map.from("number")
39-
try title = map.from("title")
40-
try body = map.from("body")
35+
36+
init(unboxer: Unboxer) throws {
37+
identifier = try unboxer.unbox(key: "id")
38+
number = try unboxer.unbox(key: "number")
39+
title = try unboxer.unbox(key: "title")
40+
body = try unboxer.unbox(key: "body")
4141
}
4242
}

0 commit comments

Comments
 (0)