Skip to content

Commit 5ab8f3c

Browse files
author
Emre Çiftçi
authored
Merge pull request tristanhimmelman#1 from tristanhimmelman/master
Merge master to emrcftci/master
2 parents cb05b2a + 3cccd28 commit 5ab8f3c

10 files changed

+29
-18
lines changed

.github/pull_request_template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Why <!-- Describe why you are making the change -->
2+
3+
4+
5+
## What <!-- Describe what changed -->

.travis.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: objective-c
2-
osx_image: xcode9.4
2+
osx_image: xcode11.3
33

44
env:
55
global:
@@ -14,19 +14,13 @@ env:
1414
#iOS
1515
- DESTINATION="OS=11.4,name=iPhone X" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES"
1616
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES"
17-
- DESTINATION="OS=9.3,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES"
1817
#macOS
1918
- DESTINATION="arch=x86_64" SCHEME="$OSX_FRAMEWORK_SCHEME" RUN_TESTS="YES"
20-
#watchOS
21-
- DESTINATION="OS=4.3,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO"
22-
- DESTINATION="OS=3.2,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO"
23-
- DESTINATION="OS=2.2,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO"
2419
#tvOS
2520
- DESTINATION="OS=11.4,name=Apple TV 4K" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES"
26-
- DESTINATION="OS=10.2,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES"
2721

2822
before_install:
29-
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
23+
- gem install xcpretty --no-document --quiet
3024

3125
script:
3226
- set -o pipefail

ObjectMapper.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'ObjectMapper'
3-
s.version = '3.5.0'
3+
s.version = '3.5.2'
44
s.license = 'MIT'
55
s.summary = 'JSON Object mapping written in Swift'
66
s.homepage = 'https://github.com/tristanhimmelman/ObjectMapper'

Package.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import PackageDescription
22

33
let package = Package(
4-
name: "ObjectMapper"
4+
name: "ObjectMapper",
5+
targets: [
6+
.target(
7+
name: "ObjectMapper",
8+
path: "Sources"
9+
)
10+
],
511
)

Package@swift-4.2.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let package = Package(
1111
targets: [
1212
.target(
1313
name: "ObjectMapper",
14-
dependencies: []
14+
path: "Sources"
1515
)
1616
],
1717
swiftLanguageVersions: [.v3, .v4, .v4_2]

Package@swift-4.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let package = Package(
1111
targets: [
1212
.target(
1313
name: "ObjectMapper",
14-
dependencies: []
14+
path: "Sources"
1515
)
1616
],
1717
swiftLanguageVersions = [3, 4]

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,8 @@ Note: Generating a JSON string of a Realm Object using ObjectMappers' `toJSON` f
451451

452452
- [Json4Swift - Supports generating `ImmutableMappable` structs online (no plugins needed)](http://www.json4swift.com)
453453

454+
- [JSON to Model - Template based MacOS app which generates structs with customisation.](https://github.com/chanonly123/Json-Model-Generator) [⬇️Download App](https://github.com/chanonly123/Json-Model-Generator/raw/master/JsonToModel.zip)
455+
454456
If you have a project that utilizes, extends or provides tooling for ObjectMapper, please submit a PR with a link to your project in this section of the README.
455457

456458
# To Do
@@ -468,14 +470,14 @@ Before submitting any pull request, please ensure you have run the included test
468470
ObjectMapper can be added to your project using [CocoaPods 0.36 or later](http://blog.cocoapods.org/Pod-Authors-Guide-to-CocoaPods-Frameworks/) by adding the following line to your `Podfile`:
469471

470472
```ruby
471-
pod 'ObjectMapper', '~> 3.4'
473+
pod 'ObjectMapper', '~> 3.5' (check releases to make sure this is the latest version)
472474
```
473475

474476
### Carthage
475477
If you're using [Carthage](https://github.com/Carthage/Carthage) you can add a dependency on ObjectMapper by adding it to your `Cartfile`:
476478

477479
```
478-
github "tristanhimmelman/ObjectMapper" ~> 3.4
480+
github "tristanhimmelman/ObjectMapper" ~> 3.5 (check releases to make sure this is the latest version)
479481
```
480482

481483
### Swift Package Manager

Sources/Mappable.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public protocol StaticMappable: BaseMappable {
4646
static func objectForMapping(map: Map) -> BaseMappable?
4747
}
4848

49-
public extension BaseMappable {
49+
public extension Mappable {
5050

5151
/// Initializes object from a JSON String
5252
init?(JSONString: String, context: MapContext? = nil) {
@@ -65,12 +65,15 @@ public extension BaseMappable {
6565
return nil
6666
}
6767
}
68-
68+
}
69+
70+
public extension BaseMappable {
71+
6972
/// Returns the JSON Dictionary for the object
7073
func toJSON() -> [String: Any] {
7174
return Mapper().toJSON(self)
7275
}
73-
76+
7477
/// Returns the JSON String for the object
7578
func toJSONString(prettyPrint: Bool = false) -> String? {
7679
return Mapper().toJSONString(self, prettyPrint: prettyPrint)

Sources/Mapper.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public final class Mapper<N: BaseMappable> {
114114
}
115115
} catch let error {
116116
#if DEBUG
117+
#if !os(Linux)
117118
let exception: NSException
118119
if let mapError = error as? MapError {
119120
exception = NSException(name: .init(rawValue: "MapError"), reason: mapError.description, userInfo: nil)
@@ -122,6 +123,7 @@ public final class Mapper<N: BaseMappable> {
122123
}
123124
exception.raise()
124125
#endif
126+
#endif
125127
}
126128
} else {
127129
// Ensure BaseMappable is not implemented directly

Sources/ObjectMapper

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)