Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ch-one committed Nov 24, 2016
2 parents 7730002 + 94c905f commit 220a695
Show file tree
Hide file tree
Showing 69 changed files with 2,421 additions and 1,415 deletions.
66 changes: 65 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,65 @@
Carthage/*
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xcuserstate

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
5 changes: 3 additions & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
disabled_rules: # rule identifiers to exclude from running
- trailing_whitespace
- missing_docs
opt_in_rules: # some rules are only opt-in
- conditional_returns_on_newline
- force_unwrapping
- empty_count
- missing_docs
- vertical_whitespace
- private_outlet
excluded: # paths to ignore during linting. Takes precedence over `included`.
Expand All @@ -14,7 +14,7 @@ excluded: # paths to ignore during linting. Takes precedence over `included`.
force_cast: warning # implicitly
force_try:
severity: warning # explicitly
line_length: 140
line_length: 160
function_parameter_count:
warning: 10
error: 15
Expand All @@ -40,4 +40,5 @@ variable_name:
excluded: # excluded via string array
- id
- URL
- url
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit)
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: objective-c
osx_image: xcode8.1

env:
- ACTION=test PLATFORM=Mac DESTINATION='platform=OS X' COVERAGE='-enableCodeCoverage NO'
- ACTION=test PLATFORM=iOS DESTINATION='platform=iOS Simulator,name=iPhone SE' COVERAGE='-enableCodeCoverage NO'
- ACTION=build PLATFORM=watchOS DESTINATION='platform=watchOS Simulator,name=Apple Watch - 38mm' COVERAGE=''
- ACTION=test PLATFORM=tvOS DESTINATION='platform=tvOS Simulator,name=Apple TV 1080p' COVERAGE='-enableCodeCoverage NO'

script:
- set -o pipefail && xcodebuild -scheme DBNetworkStack -destination "$DESTINATION" $ACTION CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO $COVERAGE | xcpretty
199 changes: 128 additions & 71 deletions DBNetworkStack.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
5 changes: 4 additions & 1 deletion DBNetworkStack.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

73 changes: 0 additions & 73 deletions DBNetworkStack/AlamofireNetworkAccess.swift

This file was deleted.

37 changes: 37 additions & 0 deletions DBNetworkStack/ArrayResourceModeling.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// ArrayResourceModeling.swift
//
// Copyright (C) 2016 DB Systel GmbH.
// DB Systel GmbH; Jürgen-Ponto-Platz 1; D-60329 Frankfurt am Main; Germany; http://www.dbsystel.de/
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Created by Lukas Schmidt on 11.10.16.
//

import Foundation

/**
`ArrayResourceModeling` describes a remote resource of generic type structured in an array.
The resource type can be fetched via HTTP(s) and parsed into the coresponding model object.
*/
public protocol ArrayResourceModeling: ResourceModeling {
associatedtype Element
associatedtype Model = Array<Element>
}
36 changes: 19 additions & 17 deletions DBNetworkStack/BaseURLKey.swift
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
//
// BaseURLKey.swift
// DBNetworkStack
//
// Legal Notice! DB Systel GmbH proprietary License!
//
// Copyright (C) 2015 DB Systel GmbH
// DB Systel GmbH; Jürgen-Ponto-Platz 1; D-60329 Frankfurt am Main; Germany; http://www.dbsystel.de/

// This code is protected by copyright law and is the exclusive property of
// Copyright (C) 2016 DB Systel GmbH.
// DB Systel GmbH; Jürgen-Ponto-Platz 1; D-60329 Frankfurt am Main; Germany; http://www.dbsystel.de/

// Consent to use ("licence") shall be granted solely on the basis of a
// written licence agreement signed by the customer and DB Systel GmbH. Any
// other use, in particular copying, redistribution, publication or
// modification of this code without written permission of DB Systel GmbH is
// expressly prohibited.

// In the event of any permitted copying, redistribution or publication of
// this code, no changes in or deletion of author attribution, trademark
// legend or copyright notice shall be made.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Created by Lukas Schmidt on 30.08.16.
//
Expand Down
57 changes: 57 additions & 0 deletions DBNetworkStack/BaseURLProviding.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// BaseURLProviding.swift
//
// Copyright (C) 2016 DB Systel GmbH.
// DB Systel GmbH; Jürgen-Ponto-Platz 1; D-60329 Frankfurt am Main; Germany; http://www.dbsystel.de/
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Created by Christian Himmelsbach on 29.09.16.
//

import Foundation

internal protocol BaseURLProviding {

var endPoints: [String: URL] {get}
/**
Provides an baseURL for a given resource.

To be more flexible, a request does only contain a path and not a full URL.
Mapping has to be done in the service to get an registerd baseURL for the request.

- parameter resource: The resource you want to get a baseURL for.

- return matching baseURL to the given resource
*/
func baseURL<T: ResourceModeling>(with resource: T) -> URL
}

extension BaseURLProviding {

func baseURL<T: ResourceModeling>(with resource: T) -> URL {

guard let baseURL = endPoints[resource.request.baseURLKey.name] else {
fatalError("Missing baseurl for key: \(resource.request.baseURLKey.name)")
}

return baseURL
}

}
25 changes: 22 additions & 3 deletions DBNetworkStack/DBNetworkStack.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
//
// DBNetworkStack.h
// DBNetworkStack
//
// Copyright (C) 2016 DB Systel GmbH.
// DB Systel GmbH; Jürgen-Ponto-Platz 1; D-60329 Frankfurt am Main; Germany; http://www.dbsystel.de/
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Created by Lukas Schmidt on 22.08.16.
// Copyright © 2016 DBSystel. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

//! Project version number for DBNetworkStack.
FOUNDATION_EXPORT double DBNetworkStackVersionNumber;
Expand Down
Loading

0 comments on commit 220a695

Please sign in to comment.