Genius API

Welcome to the unofficial Genius API representation. This repo reflects all of the service API and much more!

Documentation content

  1. Overview

  2. Installation

    1. Build from source

      1. Manual installation

      2. Automatic installation

    2. Build via bundler

  3. Usage

  4. Todo

  5. Development

  6. Requirements

    1. Common usage

    2. Development purposes

  7. Project style guide

  8. Contributing

  9. License

  10. Code of Conduct

Overview

As noted above, this gem fully represents Genius service API. The projects source tree is pretty simple. All of the resources are stored in theirs separate module, so it does code readability much cleaner.

Installation

Genius API gem is quite simple to use and install. There are two options to install it — for those who is going to contribute into the project and for those who is going to embed gem to theirs project. See below for each step.

Build from source

Manual installation

The manual installation includes installation via command line interface. it is practically no different from what happens during the automatic build of the project:

git clone https://github.com/unurgunite/genius-api.git && \
cd genius-api && \
bundle install && \
gem build genius-api.gemspec && \
gem install genius-api-0.2.1.gem

Now everything should work fine. Just type irb and require "genius/api" to start working with the library

Automatic installation

The automatic installation is simpler but it has at least same steps as manual installation:

git clone https://github.com/unurgunite/genius-api.git && \
cd genius-api && \
bin/setup

If you see irb interface, then everything works fine. The main goal of automatic installation is that you do not need to create your own script to simplify project build and clean up the shell history. Note: you do not need to require projects file after the automatic installation. See bin/setup file for clarity of the statement

Build via bundler

This documentation point is close to those who need to embed the library in their project. Just place this gem to your Gemfile or create it manually via bundle init:

# Your Gemfile
gem 'genius-api'

And then execute:

bundle install

Or install it yourself for non bundled projects as:

gem install genius-api

Usage

All docs are available at the separate page: unurgunite.github.io/genius-api_docs/

TODO

  • [x] Update README.md

  • [ ] Refactor code base

  • [ ] Add tests with RSpec

  • [ ] 100% code coverage with RuboCop

  • [ ] Refactor code according to the style guides

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Requirements

This section will show dependencies which are used in the project. This section splits in two other sections — requirements for common use and requirements for the development purposes.

Common use

The genius-api gem is built on top of two other gems:

| Dependencies | Description | |—————–|———————————————————————————————| | HTTParty | The HTTParty gem is used to send requests to the REST client of the api.genius.com/ | | Nokogiri | The Nokogiri gem is used to represent XML objects as Ruby structures. |

Development purposes

For the development purposes genius-api gem uses:

| Dependencies | Description | |—————-|——————————————————————————————| | RSpec | The RSpec gem is used for test which are located in a separate folder under spec name. | | RuboCop | The RuboCop gem is used for code formatting. | | Rake | The Rake gem is used for building tasks as generating documentation. | | Dotenv | The Dotenv gem is used for setting variables for test environment (token, for e.g.). | | Coderay | The Coderay gem is used for colorizing Rspec output. | | YARD | The YARD gem is used for the documentation. |

Project style guide

To make the code base much cleaner gem has its own style guides. They are defined in a root folder of the gem in a CONTRIBUTING.md file. Check it for more details.

Contributing

Bug reports and pull requests are welcome on GitHub at github.com/unurgunite/genius-api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct. To contribute you should fork this project and create there new branch:

git clone https://github.com/your-beautiful-username/genius-api.git && \
git checkout -b refactor && \
git commit -m "Affected new changes" && \
git push origin refactor

And then make new pull request with additional notes of what you have done. The better the changes are scheduled, the faster the PR will be checked.

Code of Conduct

Everyone interacting in the Genius::Api project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

License

The gem is available as open source under the terms of the GPLv3 License. The copy of the license is stored in project under the LICENSE.txt file name: copy of the License

The documentation is available as open source under the terms of the CC BY-SA 4.0 License

The other libs are available as open source under the terms of the New BSD License