Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ijackua/ruby-di-playground
Try different approaches for Dependency Injection in Ruby code
https://github.com/ijackua/ruby-di-playground
dependency-injection ruby
Last synced: 17 days ago
JSON representation
Try different approaches for Dependency Injection in Ruby code
- Host: GitHub
- URL: https://github.com/ijackua/ruby-di-playground
- Owner: iJackUA
- License: mit
- Created: 2016-08-04T17:47:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-26T15:50:13.000Z (about 8 years ago)
- Last Synced: 2024-10-09T22:03:12.343Z (28 days ago)
- Topics: dependency-injection, ruby
- Language: Ruby
- Size: 12.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Ruby dependency injection experiments
Each sub-folder contains own implementation of the similar synthetic functionality
### How to run?
* `ruby ./hardcode/server.rb` - start a fake web app
* open `http://localhost:8080/` to run our action### Expectations
Initial behavior
```
» ruby ./server.rb 130 ↵
...
Start App action
LogStorage::call |> Save to File. Msg: get_by_id via 'jdbc:postgresql://localhost:1234/users'
App |> User: Ievgen
Finish App action
```Behavior after classes monkey-patching
```
» ruby ./server.rb 130 ↵
...
Start App action
LogStorage::call |> Send to Elastic. Msg: get_by_id via 'jdbc:sqlite://skynet:1234/humanoids'
App |> User: Ievgen
Finish App action
```