Giter VIP home page Giter VIP logo

music-library's Introduction

Ruby Music Library Build Status

Overview

A command line Music Library application. The application accepts a file path to the music mp3 files, parses them and is able to display, search, create and 'play' the music.

Getting Started

  1. Clone the repo to your local machine.

    $  git clone https://github.com/andela-tpeters/music-library.git
  2. cd into the music-library folder.

    $  cd music-library
  3. Install dependencies

    $  bundle install

Usage

To start the library cli execute the musiclibrary file in the bin directory

$  bin/musiclibrary

  ----------------------------
  Welcome to Music Library
  ----------------------------

  Commands:
    lib stat         - Shows Statistics of Library.
    lib genres  - Shows All Genres and thier songs.
    lib artists - Shows All Artists and thier songs.
    list songs       - List all songs.
    list artists     - List all artists.
    list genres      - List all genres.
    play song        - Play a single song (specify the song number).
    list artist      - List songs of artist.
    list genre       - List songs of certain genre.
    exit             - Exit the Library.
    help             - Displays all the available commands
 ♯ ~

Example command usage:

  1. list songs:

    ~ list songs
    1. Action Bronson - Larry Csonka - indie
    2. Adele - Rolling In the Deep - folk
    3. Adele - Someone Like You - country
    4. AraabMuzik - Streetz Tonight - folk
    5. ASAP Rocky - Peso - dance
    6. Atlas Sound - Mona Lisa - pop
    7. Azealia Banks - 212 - hip-hop
    8. Battles - Ice Cream (Feat. Matias Aguayo) - rock
    9. Beyonce - 1+1 - house
    ...
  2. play song e.g. enter "1" for the first song:

    ~ play song
    Please enter the song number.
    1
    Playing Action Bronson - Larry Csonka - indie
    
  3. list artist e.g enter "Adele":

    ~ list artist
    Please enter the artist name.
    Adele
    Adele - Rolling In the Deep - folk
    Adele - Someone Like You - country

Tests

You need to have installed test dependencies. If you ran:

$  bundle install

You are good and can continue to testing the application. Otherwise proceed to install all dependencies.

Run tests:

$  rspec spec

music-library's People

Contributors

tijesunimi-peters avatar

Watchers

James Cloos avatar  avatar

music-library's Issues

Base class for all models

You should have a base model for all your models where you put shared logic and interfaces for all other models. There is a whole lot of repetition in your code, in models like Genre and Artist you keep including and extending modules some of this method in this module can be kept in your base model.

Also, I want you to research on when to use mixin vs inheritance, I will be glad if you share your findings with me. Thanks.

UX

Try as much as possible to not overdo UI, in your case, the UI is affecting the test and also some portion affects the UX, making it take longer than expected. In most cases a simple UI should suffice.

Your UI & UX should revolve around the goal of your application. In this case, an app that makes it easy for users to find and play music in their library. Overdoing it is an overkill. When building UI & UX keep this maxim in mind (Keep it Simple)

I am not asking you to change your UI but just take note of this in the case of next time.

Git Workflow

Next time, adhere to git best practices, I see you only have a master branch. In future scenarios, create a different branch for each feature you are to work on.

Avoid using reserved keywords

You should stay away from using reserved keywords. If you take a look at here you have a method called put define on line 76 and puts is also called on line 10 tho, they are different but it creates mystery guess There are several instances of this same puts method in this file, instead, rename the method to what seems appropriate. To me, this looks like a nice hack

Folder Structure

Take advantage of folders to structure your code. At this point, it may seem trivial but it's very important as a developer. In your lib folder, leaving code laying on different aspect without grouping them is really not a good approach. So go create models folder, and controllers folder move all your models to the model folder and your music_library_controller.rb file to your controller folder. This gives your code a good folder structure. Ensure you change the path to require in your music_library_controller.rb file to make it work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.