Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
Travis CI working.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Rupérez committed Mar 6, 2017
1 parent 3bbee3a commit 6bee975
Show file tree
Hide file tree
Showing 30 changed files with 25 additions and 14 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: objective-c
xcode_project: Kommander.xcodeproj
xcode_scheme: Kommander

osx_image: xcode8.2
xcode_sdk: iphonesimulator10.2

script:
- xcodebuild -project Kommander.xcodeproj -scheme Kommander -sdk iphonesimulator10.2 -destination "platform=iOS Simulator,name=iPhone 7,OS=10.1" -configuration Debug -enableCodeCoverage YES clean build test
Empty file modified CHANGELOG.md
100644 → 100755
Empty file.
Empty file modified Kommander.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Kommander.podspec
100644 → 100755
Empty file.
Empty file modified Kommander.xcodeproj/project.pbxproj
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified Kommander.xcodeproj/xcshareddata/xcschemes/Kommander.xcscheme
100644 → 100755
Empty file.
Empty file modified Kommander.xcodeproj/xcshareddata/xcschemes/Major.xcscheme
100644 → 100755
Empty file.
Empty file modified Kommander/CurrentDispatcher.swift
100644 → 100755
Empty file.
Empty file modified Kommander/Dispatcher.swift
100644 → 100755
Empty file.
Empty file modified Kommander/Info.plist
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions Kommander/Kommand.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ open class Kommand<Result> {
/// Error block type
public typealias ErrorBlock = (_ error: Error?) -> Void

/// Kommand<Result> state
internal(set) public final var state = State.uninitialized

/// Deliverer
Expand Down
Empty file modified Kommander/Kommander.h
100644 → 100755
Empty file.
Empty file modified Kommander/Kommander.swift
100644 → 100755
Empty file.
Empty file modified Kommander/MainDispatcher.swift
100644 → 100755
Empty file.
Empty file modified KommanderTests/Info.plist
100644 → 100755
Empty file.
Empty file modified KommanderTests/KommanderTests.swift
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified Major/AppDelegate.swift
100644 → 100755
Empty file.
Empty file modified Major/Assets.xcassets/AppIcon.appiconset/Contents.json
100644 → 100755
Empty file.
Empty file modified Major/Base.lproj/LaunchScreen.storyboard
100644 → 100755
Empty file.
Empty file modified Major/Base.lproj/Main.storyboard
100644 → 100755
Empty file.
Empty file modified Major/Info.plist
100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions Major/ViewController.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ViewController: UIViewController {
let sleepTime: UInt32 = 2

@IBAction func singleAction(_ sender: UIButton) {
_ = kommander.makeKommand { () -> Double in
_ = kommander.makeKommand { () -> TimeInterval in
sleep(self.sleepTime)
return Date().timeIntervalSince1970
}.onSuccess { result in
Expand All @@ -28,11 +28,11 @@ class ViewController: UIViewController {
sleep(self.sleepTime)
print("Concurrent first: " + String(describing: Date().timeIntervalSince1970))
return nil
}, { () -> Any? in
}, {
sleep(self.sleepTime)
print("Concurrent second: " + String(describing: Date().timeIntervalSince1970))
return nil
}, { () -> Any? in
}, {
sleep(self.sleepTime)
print("Concurrent third: " + String(describing: Date().timeIntervalSince1970))
return nil
Expand All @@ -44,19 +44,19 @@ class ViewController: UIViewController {
sleep(self.sleepTime)
print("Sequential first: " + String(describing: Date().timeIntervalSince1970))
return nil
}, { () -> Any? in
}, {
sleep(self.sleepTime)
print("Sequential second: " + String(describing: Date().timeIntervalSince1970))
return nil
}, { () -> Any? in
}, {
sleep(self.sleepTime)
print("Sequential third: " + String(describing: Date().timeIntervalSince1970))
return nil
}]), concurrent: false)
}

@IBAction func errorAction(_ sender: UIButton) {
_ = kommander.makeKommand { () -> Void in
_ = kommander.makeKommand {
sleep(self.sleepTime)
throw CocoaError(.featureUnsupported)
}.onError { error in
Expand All @@ -65,7 +65,7 @@ class ViewController: UIViewController {
}

@IBAction func crashAction(_ sender: UIButton) {
_ = kommander.makeKommand { () -> Void in
_ = kommander.makeKommand {
sleep(self.sleepTime)
fatalError()
}.execute()
Expand Down
Empty file modified MajorUITests/Info.plist
100644 → 100755
Empty file.
Empty file modified MajorUITests/MajorUITests.swift
100644 → 100755
Empty file.
Empty file modified Package.swift
100644 → 100755
Empty file.
15 changes: 8 additions & 7 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
[![License](https://img.shields.io/cocoapods/l/Kommander.svg?style=flat)](http://cocoapods.org/pods/Kommander)
[![Platform](https://img.shields.io/cocoapods/p/Kommander.svg?style=flat)](http://cocoapods.org/pods/Kommander)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Docs](https://img.shields.io/badge/docs-here-green.svg?style=flat)](http://cocoadocs.org/docsets/Kommander)

[![Swift Package Manager Compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-4BC51D.svg?style=flat)](https://github.com/apple/swift-package-manager)
[![Docs](https://img.shields.io/cocoapods/metrics/doc-percent/Kommander.svg)](http://cocoadocs.org/docsets/Kommander)
[![Build Status](https://travis-ci.org/intelygenz/Kommander-iOS.svg?branch=master)](https://travis-ci.org/intelygenz/Kommander-iOS)

**Kommander** is a Swift library to manage the task execution in different threads. Through the definition a simple but powerful concept, [**Kommand**](https://en.wikipedia.org/wiki/Command_pattern).

Expand Down Expand Up @@ -45,7 +46,7 @@ pod 'Kommander'
For Swift 2 compatibility use:

```ruby
pod 'Kommander', :git => 'https://github.com/intelygenz/Kommander-iOS.git', :tag => '0.2.3-swift2'
pod 'Kommander', :git => 'https://github.com/intelygenz/Kommander-iOS.git', :tag => '0.3.0-swift2'
```

For Objective-C compatibility use:
Expand All @@ -71,7 +72,7 @@ dependencies: [
## Usage

```swift
_ = Kommander().makeKommand { () -> Void in
_ = Kommander().makeKommand {
// Your code here
}.execute()
```
Expand All @@ -85,15 +86,15 @@ _ = Kommander().makeKommand { () -> String in
```

```swift
_ = Kommander().makeKommand { () -> Void in
_ = Kommander().makeKommand {
throw CocoaError(.featureUnsupported)
}.onError({ error in
print(String(describing: error!))
}).execute()
```

```swift
let kommand = Kommander().makeKommand { () -> Any in
let kommand = Kommander().makeKommand { () -> Any? in
// Your code here
}.onSuccess { result in
// Your success handling here
Expand All @@ -119,4 +120,4 @@ kommand.cancel()

## License

Kommander is available under the MIT license. See the LICENSE file for more info.
Kommander is available under the MIT license. See the LICENSE file for more info.
Empty file modified _config.yml
100644 → 100755
Empty file.

0 comments on commit 6bee975

Please sign in to comment.