Micro framework to build clients for HTTP based APIs.
The library(gem) contains abstractions and implementation of client's interfaces
com-client gem which will be
useful in building clients to concrete HTTP based APIs.
- MRI Ruby version 2.3.1 or higher
- Bundler version 1.12.5 or higher
- Other dependencies will be installed automatically by running
bundle installfrom library's root directory.
You can install this library manually with
gem install com-http-client
with resolving all of their dependencies manually.
The preffered way to install it is to rely on Bundler in your application.
Assuming that, add follow to your
gem "com-http-client", ">= 0.1.0"
And then execute from the directory with
Gemfile (likely it should be your
application's root directory):
Adding this library(gem) as a runtime dependency to other libraries(gems)
This is the most common use case of that library. Likely you already know how to do that, but for clarity sake here is some tips and links.
Add follow line to your library's
spec.add_runtime_dependency 'com-http-client', '>= 0.1'
If we assume that you have follow directory structure of git repositories:
~ |- projects |- com-http-client |- your-library
Then you have to add to your
Gemfile something like follows:
gem "com-http-client", path: "../com-http-client"
After all run
to let your changes to make affect.
Library's interactive prompt
To experiment with that code, run
bin/console for an interactive prompt from project's root directory.
Exceptions modules and classes hierarchy
Introduced namespace modules:
Introduced error tagging modules:
After checking out the repo, run
bin/setup to install dependencies.
bin/console for an interactive prompt that will allow
you to experiment.
bundle exec com-http-client to
use the code located in this directory, ignoring other installed copies of this gem.
To install this gem onto your local machine, run
bundle exec rake install.
To release a new version, update the version number in
and then run
bundle exec rake release
to create a git tag for the version,
push git commits and tags.
There are different ways to run tests. You can use the one which you used to.
$ rake # uses default rake task which is spec
$ rake spec
$ rspec spec/
- Clone it:
git clone email@example.com:com-rb/com-http-client.git
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Ensure all tests pass successfully
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request