-
Notifications
You must be signed in to change notification settings - Fork 4
Codebase Explanation
Some files may be added and removed over time, but the directory structure should largely remain the same.
.
├── Gemfile
├── LICENSE.txt
├── README.md
├── Rakefile
├── bin
│ ├── console
│ └── setup
├── lib
│ ├── napster
│ │ ├── client.rb
│ │ ├── me.rb
│ │ ├── models
│ │ │ ├── album.rb
│ │ │ ├── artist.rb
│ │ │ ├── chart.rb
│ │ │ ├── content.rb
│ │ │ ├── favorite.rb
│ │ │ ├── favorite_status.rb
│ │ │ ├── follower.rb
│ │ │ ├── following.rb
│ │ │ ├── library.rb
│ │ │ ├── library_date_time.rb
│ │ │ ├── member.rb
│ │ │ ├── playlist.rb
│ │ │ ├── profile.rb
│ │ │ ├── tag.rb
│ │ │ ├── track.rb
│ │ │ └── uploaded_image.rb
│ │ ├── moniker.rb
│ │ ├── request.rb
│ │ ├── response_error.rb
│ │ └── version.rb
│ ├── napster.rb
│ └── string_helper.rb
├── napster-0.1.0.gem
├── napster.gemspec
└── spec
├── client_spec_helper.rb
├── config_loader.rb
├── fixture_loader.rb
├── fixtures
│ ├── albums_top.json
│ ├── artists_top.json
│ ├── genres.json
│ ├── main.json
│ ├── member.json
│ ├── playlists.json
│ └── tracks_top.json
├── lib
│ └── napster
│ ├── client_spec.rb
│ ├── me_spec.rb
│ ├── models
│ │ ├── album_spec.rb
│ │ ├── artist_spec.rb
│ │ ├── chart_spec.rb
│ │ ├── content_spec.rb
│ │ ├── favorite_spec.rb
│ │ ├── favorite_status_spec.rb
│ │ ├── library_date_time.rb
│ │ ├── library_spec.rb
│ │ ├── member_spec.rb
│ │ ├── playlist_spec.rb
│ │ ├── profile_spec.rb
│ │ ├── tag_spec.rb
│ │ ├── track_spec.rb
│ │ └── uploaded_image_spec.rb
│ ├── request_spec.rb
│ └── response_error_spec.rb
├── napster_spec.rb
└── spec_helper.rb
This file is what rubygems.org looks at in order to determine metadata about the Napster gem. You can add gem dependencies and development dependencies here. Do not use Gemfile
to add new dependencies.
Use napster.gemspec
for all gem dependency management.
All the new files introduced should be required here. Also if a gem (like faraday
and oj
) is used globally in the Napster gem, you can require the gem here.
This is a one-off module that's used to monkey patch a method for String
.
The Client
class is responsible for calling Naster API. To use, Napster gem, we begin by instantiating a client from the Client
class. Authentications are made through a client. Also metadata and authenticated calls are all made through a client. The Client
class has get
, put
, post
, delete
methods that are used to make requests to Napster API.
The Me
class is responsible for calling all authenticated calls to Napster API that starts with /me
namespace.
The Moniker
module includes a method that can be used to validate IDs for Napster API.
The Request
class creates a Faraday client used to make requests.
The ResponseError
class is used when the client receives an error from Napster API. The ResponseError
class inherits from Faraday::Error
.
Bump the version here whenever a new version is released.
The model classes are used to wrap the response body from Napster API. Example classes are Artist
, Album
, and Tracks
. Some example like Library
do not contain any data from responses, but it provides a namespace to other calls for /me/library
.
This directory contains all files related to rspec
.