Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support configuration property. #33

Merged
merged 7 commits into from
Dec 16, 2018
Merged

Support configuration property. #33

merged 7 commits into from
Dec 16, 2018

Conversation

kawoou
Copy link
Owner

@kawoou kawoou commented Nov 28, 2018

from #32

  • ConfigProperty
struct ServerConfig: ConfigProperty {
    let target: String = "server"
    let url: String
}
  • InjectProperty()
final class NetworkManager: Inject {
    let serverUrl = InjectProperty("server.url")
}
  • Injection (Autowired, LazyAutowired, AutowiredFactory, LazyAutowiredFactory)
final class UserService: Autowired {
    required init(_/*environment*/ network: NetworkProvider) {
    }
}
  • Injection (Inject)
final class LibraryFactory: Inject {
    func getBooks() -> [Book] {
        return Inject([Book].self, qualifierBy: "environment")
    }
}
  • Optional get property
final class InjectPropertyTest: Component {
    let test: Any? = AppContext.shared.getProperty("server.test")
    required init() {}
}

@kawoou kawoou added the enhancement New feature or request label Nov 28, 2018
@kawoou kawoou self-assigned this Nov 28, 2018
@codecov-io
Copy link

codecov-io commented Nov 28, 2018

Codecov Report

Merging #33 into develop will increase coverage by 10.04%.
The diff coverage is 99.08%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #33       +/-   ##
===========================================
+ Coverage    65.75%   75.8%   +10.04%     
===========================================
  Files           16      16               
  Lines          549     624       +75     
===========================================
+ Hits           361     473      +112     
+ Misses         188     151       -37
Impacted Files Coverage Δ
Sources/Deli/Autowired.swift 10% <ø> (ø) ⬆️
Sources/Deli/Core/AppContext.swift 99.06% <100%> (+1.14%) ⬆️
Sources/Deli/ModuleFactory.swift 100% <100%> (+3.94%) ⬆️
Sources/Deli/Inject.swift 100% <100%> (ø) ⬆️
Sources/Deli/Core/Container.swift 98.11% <98.73%> (+28.95%) ⬆️
Sources/Deli/Core/Type/ResolveRule.swift 100% <0%> (+11.11%) ⬆️
Sources/Deli/Core/Type/LoadPriority.swift 100% <0%> (+20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6241730...a5efb1f. Read the comment docs.

@kawoou kawoou force-pushed the feature/configuration branch 2 times, most recently from 5ca8707 to fedb7f1 Compare December 1, 2018 12:13
@kawoou kawoou merged commit bc0d679 into develop Dec 16, 2018
@kawoou kawoou deleted the feature/configuration branch December 16, 2018 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants