Skip to content

Commit

Permalink
Merge pull request #1 from devmynd/harbor2-0
Browse files Browse the repository at this point in the history
Refactor, Release Readiness
  • Loading branch information
tycobbb committed May 10, 2016
2 parents 644985f + 9a7c16c commit 6d53cd3
Show file tree
Hide file tree
Showing 281 changed files with 22,532 additions and 1,819 deletions.
63 changes: 61 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,61 @@
Harbor.xcodeproj/project.xcworkspace/xcuserdata/*.xcuserdatad/
Harbor.xcodeproj/xcuserdata/*.xcuserdatad/
# 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

## 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/docs/Gitignore.md

fastlane/report.xml
fastlane/screenshots
14 changes: 14 additions & 0 deletions Components/AppComponent.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

import Drip

class AppComponent: Component {
var system: SystemModule { return module() }
var service: ServiceModule { return module() }
var interactor: InteractorModule { return module() }
}

class AppModule: Module<AppComponent> {
required init(_ component: AppComponent) {
super.init(component)
}
}
28 changes: 28 additions & 0 deletions Components/InteractorModule.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

class InteractorModule: AppModule {
func inject() -> Settings {
return single {
Settings(
defaults: $0.system.inject(),
keychain: $0.system.inject(),
notificationCenter: $0.system.inject())
}
}

func inject() -> ProjectsInteractor {
return single {
ProjectsProvider(
api: $0.service.inject(),
settings: $0.interactor.inject()) as ProjectsInteractor
}
}

func inject() -> TimerCoordinator {
return single {
TimerCoordinator(
runLoop: $0.system.inject(),
projectsInteractor: $0.interactor.inject(),
settings: $0.interactor.inject())
}
}
}
11 changes: 11 additions & 0 deletions Components/PreferencesViewModule.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

class PreferencesViewModule: ViewModule {
func inject<V: PreferencesView>(view: V) -> PreferencesPresenter<V> {
return single {
PreferencesPresenter(
view: view,
projectsInteractor: $0.app.interactor.inject(),
settings: $0.app.interactor.inject())
}
}
}
8 changes: 8 additions & 0 deletions Components/ServiceModule.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

class ServiceModule: AppModule {
func inject() -> CodeshipApiType {
return transient { component in
CodeshipApi(settings: component.interactor.inject()) as CodeshipApiType
}
}
}
11 changes: 11 additions & 0 deletions Components/StatusMenuViewModule.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

class StatusMenuModule: ViewModule {
func inject<V: StatusMenuView>(view: V) -> StatusMenuPresenter<V> {
return single {
StatusMenuPresenter(
view: view,
projectsInteractor: $0.app.interactor.inject(),
settings: $0.app.interactor.inject())
}
}
}
28 changes: 28 additions & 0 deletions Components/SystemModule.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

import Foundation

class SystemModule: AppModule {
func inject() -> UserDefaults {
return transient {
NSUserDefaults.standardUserDefaults() as UserDefaults
}
}

func inject() -> NotificationCenter {
return transient {
NSNotificationCenter.defaultCenter() as NotificationCenter
}
}

func inject() -> RunLoop {
return transient {
NSRunLoop.mainRunLoop() as RunLoop
}
}

func inject() -> Keychain {
return transient {
KeychainWrapper() as Keychain
}
}
}
14 changes: 14 additions & 0 deletions Components/ViewComponent.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

import Drip

class ViewComponent: Component {
var app: AppComponent { return parent() }
var status: StatusMenuModule { return module() }
var preferences: PreferencesViewModule { return module() }
}

class ViewModule: Module<ViewComponent> {
required init(_ component: ViewComponent) {
super.init(component)
}
}
1,053 changes: 788 additions & 265 deletions Harbor.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions Harbor.xcodeproj/project.xcworkspace/contents.xcworkspacedata

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6d53cd3

Please sign in to comment.