Skip to content

Commit

Permalink
Update ReactiveSwift to 2.0.0-rc.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesyo committed Jul 4, 2017
1 parent e444bec commit b97323a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "antitypical/Result" ~> 3.2.1
github "ReactiveCocoa/ReactiveSwift" ~> 1.1
github "ReactiveCocoa/ReactiveSwift" "2.0.0-rc.1"
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github "Quick/Nimble" "v7.0.1"
github "Quick/Quick" "v1.1.0"
github "ReactiveCocoa/ReactiveSwift" "1.1.3"
github "ReactiveCocoa/ReactiveSwift" "2.0.0-rc.1"
github "antitypical/Result" "3.2.3"
github "jspahrsummers/xcconfigs" "3d9d99634cae6d586e272543d527681283b33eb0"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/ReactiveSwift
Submodule ReactiveSwift updated 67 files
+0 −10 .Package.test.swift
+3 −0 .github/PULL_REQUEST_TEMPLATE.md
+4 −0 .gitignore
+9 −14 .jazzy.yaml
+48 −31 .travis.yml
+232 −0 CHANGELOG.md
+1 −1 Cartfile.private
+1 −1 Cartfile.resolved
+1 −1 Carthage/Checkouts/Nimble
+13 −13 Documentation/APIContracts.md
+3 −3 Documentation/BasicOperators.md
+173 −0 Documentation/Example.OnlineSearch.md
+1 −1 Documentation/FrameworkOverview.md
+115 −0 Documentation/ReactivePrimitives.md
+89 −0 Documentation/RxComparison.md
+ Logo/Icons/docset-icon.png
+ Logo/Icons/docset-icon@2x.png
+24 −0 Package.pins
+34 −0 Package.resolved
+18 −3 Package.swift
+54 −371 README.md
+24 −17 ReactiveSwift-UIExamples.playground/Pages/ValidatingProperty.xcplaygroundpage/Contents.swift
+2 −2 ReactiveSwift.playground/Pages/Property.xcplaygroundpage/Contents.swift
+11 −11 ReactiveSwift.playground/Pages/Signal.xcplaygroundpage/Contents.swift
+4 −4 ReactiveSwift.playground/Pages/SignalProducer.xcplaygroundpage/Contents.swift
+1 −1 ReactiveSwift.playground/contents.xcplayground
+1 −1 ReactiveSwift.podspec
+11 −51 ReactiveSwift.xcodeproj/project.pbxproj
+221 −212 Sources/Action.swift
+110 −121 Sources/Atomic.swift
+52 −58 Sources/Bag.swift
+128 −565 Sources/Deprecations+Removals.swift
+140 −187 Sources/Disposable.swift
+119 −115 Sources/Event.swift
+13 −13 Sources/EventLogger.swift
+337 −554 Sources/Flatten.swift
+3 −5 Sources/FoundationExtensions.swift
+1 −1 Sources/Info.plist
+132 −0 Sources/InhabitableTypeGuards.swift
+38 −33 Sources/Lifetime.swift
+102 −85 Sources/Observer.swift
+2 −2 Sources/Optional.swift
+215 −187 Sources/Property.swift
+33 −26 Sources/Scheduler.swift
+970 −802 Sources/Signal.swift
+862 −742 Sources/SignalProducer.swift
+0 −42 Sources/TupleExtensions.swift
+115 −118 Sources/UnidirectionalBinding.swift
+66 −66 Sources/ValidatingProperty.swift
+80 −26 Tests/ReactiveSwiftTests/ActionSpec.swift
+1 −28 Tests/ReactiveSwiftTests/DeprecationSpec.swift
+11 −11 Tests/ReactiveSwiftTests/DisposableSpec.swift
+63 −11 Tests/ReactiveSwiftTests/FlattenSpec.swift
+5 −5 Tests/ReactiveSwiftTests/FoundationExtensionsSpec.swift
+1 −1 Tests/ReactiveSwiftTests/Info.plist
+50 −31 Tests/ReactiveSwiftTests/PropertySpec.swift
+118 −46 Tests/ReactiveSwiftTests/SignalLifetimeSpec.swift
+104 −21 Tests/ReactiveSwiftTests/SignalProducerLiftingSpec.swift
+1 −1 Tests/ReactiveSwiftTests/SignalProducerNimbleMatchers.swift
+333 −96 Tests/ReactiveSwiftTests/SignalProducerSpec.swift
+234 −41 Tests/ReactiveSwiftTests/SignalSpec.swift
+2 −2 Tests/ReactiveSwiftTests/TestError.swift
+88 −38 Tests/ReactiveSwiftTests/UnidirectionalBindingSpec.swift
+1 −1 Tests/ReactiveSwiftTests/ValidatingPropertySpec.swift
+4 −0 script/feed.xml.template
+33 −8 script/gen-docs
+24 −0 script/update-version
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let package = Package(
dependencies: {
var deps: [Package.Dependency] = [
.Package(url: "https://github.com/antitypical/Result.git", versions: Version(3, 2, 1)..<Version(3, .max, .max)),
.Package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", versions: Version(1, 1, 0)..<Version(1, .max, .max)),
.Package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", "2.0.0-rc.1"),
]
if isSwiftPackagerManagerTest {
deps += [
Expand Down
32 changes: 17 additions & 15 deletions Sources/Task.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private final class Pipe {
/// After starting the returned producer, `readFD` should not be used
/// anywhere else, as it may close unexpectedly.
func transferReadsToProducer() -> ReadProducer {
return SignalProducer { observer, disposable in
return SignalProducer { observer, lifetime in
self.group.enter()
let channel = DispatchIO(type: .stream, fileDescriptor: self.readFD, queue: self.queue) { error in
if error == 0 {
Expand Down Expand Up @@ -200,7 +200,7 @@ private final class Pipe {
}
}

let _ = disposable.add {
lifetime.observeEnded {
channel.close(flags: .stop)
}
}
Expand All @@ -215,7 +215,7 @@ private final class Pipe {
///
/// Returns a producer that will complete or error.
func writeDataFromProducer(_ producer: SignalProducer<Data, NoError>) -> SignalProducer<(), TaskError> {
return SignalProducer { observer, disposable in
return SignalProducer { observer, lifetime in
self.group.enter()
let channel = DispatchIO(type: .stream, fileDescriptor: self.writeFD, queue: self.queue) { error in
if error == 0 {
Expand All @@ -231,9 +231,9 @@ private final class Pipe {
}

producer.startWithSignal { signal, producerDisposable in
disposable.add(producerDisposable)
lifetime.observeEnded(producerDisposable.dispose)

signal.observe(Observer(value: { data in
signal.observe(Signal.Observer(value: { data in
let dispatchData = data.withUnsafeBytes { (bytes: UnsafePointer<UInt8>) -> DispatchData in
let buffer = UnsafeBufferPointer(start: bytes, count: data.count)
return DispatchData(bytes: buffer)
Expand All @@ -253,7 +253,7 @@ private final class Pipe {
}))
}

let _ = disposable.add {
lifetime.observeEnded {
channel.close(flags: .stop)
}
}
Expand Down Expand Up @@ -409,7 +409,7 @@ extension Task {
/// - Returns: A producer that will launch the receiver when started, then send
/// `TaskEvent`s as execution proceeds.
public func launch(standardInput: SignalProducer<Data, NoError>? = nil) -> SignalProducer<TaskEvent<Data>, TaskError> {
return SignalProducer { observer, disposable in
return SignalProducer { observer, lifetime in
let queue = DispatchQueue(label: self.description, attributes: [])
let group = Task.group

Expand Down Expand Up @@ -466,15 +466,15 @@ extension Task {
}
}

return SignalProducer { observer, disposable in
return SignalProducer { observer, lifetime in
func startAggregating(producer: Pipe.ReadProducer, chunk: @escaping (Data) -> TaskEvent<Data>) -> Pipe.ReadProducer {
let aggregated = MutableProperty<Aggregation?>(nil)

producer.startWithSignal { signal, signalDisposable in
disposable += signalDisposable
lifetime.observeEnded(signalDisposable.dispose)

var aggregate = Data()
signal.observe(Observer(value: { data in
signal.observe(Signal.Observer(value: { data in
observer.send(value: chunk(data))
aggregate.append(data)
}, failed: { error in
Expand Down Expand Up @@ -504,20 +504,22 @@ extension Task {
if terminationStatus == EXIT_SUCCESS {
// Wait for stderr to finish, then pass
// through stdout.
disposable += stderrAggregated
let disposable = stderrAggregated
.then(stdoutAggregated)
.map(TaskEvent.success)
.start(observer)
lifetime.observeEnded(disposable.dispose)
} else {
// Wait for stdout to finish, then pass
// through stderr.
disposable += stdoutAggregated
let disposable = stdoutAggregated
.then(stderrAggregated)
.flatMap(.concat) { data -> SignalProducer<TaskEvent<Data>, TaskError> in
let errorString = (data.count > 0 ? String(data: data, encoding: .utf8) : nil)
return SignalProducer(error: .shellTaskFailed(self, exitCode: terminationStatus, standardError: errorString))
}
.start(observer)
lifetime.observeEnded(disposable.dispose)
}
group.leave()
}
Expand All @@ -527,15 +529,15 @@ extension Task {
close(stdoutPipe.writeFD)
close(stderrPipe.writeFD)

disposable += stdinProducer.start()
lifetime.observeEnded(stdinProducer.start().dispose)

let _ = disposable.add {
lifetime.observeEnded {
process.terminate()
}
}
}
.startWithSignal { signal, taskDisposable in
disposable.add(taskDisposable)
lifetime.observeEnded(taskDisposable.dispose)
signal.observe(observer)
}
}
Expand Down

0 comments on commit b97323a

Please sign in to comment.