This API provides tweets and Twitter users which complains about Locaweb products.
- Ruby 2.4.0
- Rails 5.0.3
- Contains all the business logic of the application. It should have a single responsibility and should response to the
call
method.
- It should be a communication layer that abstracts external services.
- It contains application response resources. It should be only a mapping between an internal object and the desired response.
First, be sure you are using Ruby 2.4.0. You may use rbenv
for Ruby version management.
Then, install bundler
for this Ruby version
gem install bundler
Install application dependencies
bundle install
You can run the tests by running
bundle exec rspec
You can lint your code by running
bundle exec rubocop
You can start the application using puma
. It will be available on port 3000.
bundle exec puma
You can also use Docker to start the application.
docker-compose up --build -d
I tried not to use any external library on the development. Most of them are test and debugger utilities. Rubocop is used to lint the code and to analyze its complexity. I used Figaro library for configuration parameters like Twitter and Tweeps URLs and the authorization email for Tweeps. Rails were chosen due to my familiarity with this framework, but since there is no need for a database, ActiveRecord were removed.