Tech: Ruby, Rubocop, Splunk, Docker, CI, Rspec, TigerConnect
Challenge: a particular component (HIPAA-compliant text messaging) of an application proved valuable in other applications. The code was organically customized and integrated into several applications. Eventually, we had a clear case to pull out the duplicated code (DRY!) from the various repos, standardize, and package as a gem.
What I learned:
sendis a Ruby reserved keyword (for dynamically calling method names)
- How to pass creds for a private GitLab/GitHub repo into Gemfile, so the gem can be implemented (gitlab-ci-token)
- After updating the gem, and using
bundle updatein an app implementing the gem, sometimes you must force pull from the private repo to get the latest changes.
- GitLab CI w/ RSpec, Rubocop!
- garbage collection https://blog.codeship.com/visualizing-garbage-collection-ruby-python/
- Splunk search is NOT case sensitive!
And topics/pitfalls for further research:
- Oddly, my Mail settings took in the local environment, but not in the application Docker image utilizing the gem
- In the local environment, one dynamic
require allin the main module worked nicely for files in
./lib. However, needed multiple require statements (one for each file) when implementing the gem elsewhere.
Gemfile.lockin commits was helpful when trying to implement gem in applications.