Twingly::HTTP
Robust HTTP client, tailored by Twingly.
Getting Started
Install the gem:
gem install twingly-http
Example "one-liner" usage:
ruby -rlogger -rtwingly/http -e '\
logger = Logger.new($stdout); logger.level = :INFO; \
puts Twingly::HTTP::Client.new(logger: logger, \
base_user_agent: "").get("http://example.org").status'
Example irb usage:
irb -rlogger -rtwingly/http
logger = Logger.new($stdout); logger.level = :INFO
client = Twingly::HTTP::Client.new(logger: logger, base_user_agent: "")
client.get("http://example.org").status
Tests
The tests require Toxiproxy
docker-compose up
Run tests with
bundle exec rake
Release workflow
Bump the version in
lib/twingly/version.rbin a commit, no need to push (the release task does that).Ensure you are signed in to RubyGems.org as twingly with
gem signin.Build and publish the gem. This will create the proper tag in git, push the commit and tag and upload to RubyGems.
bundle exec rake releaseUpdate the changelog with GitHub Changelog Generator (
gem install github_changelog_generatorif you don't have it, setCHANGELOG_GITHUB_TOKENto a personal access token to avoid rate limiting by GitHub). This command will updateCHANGELOG.md. You need to commit and push manually.github_changelog_generator