Coding as a Craft 2.0
  • Introduction
  • Week 1 - Programming Basics - Ruby
    • Understanding the problem statement
    • User stories
    • Pair programming
    • The ATM challenge
      • Step 1 - Setting the stage
      • Step 2 - The core functionality
      • Step 3 - Interacting with objects
      • Step 4 - Refactoring
      • Step 5 - Testing the sad path
      • Step 6 - Cash is King
      • Step 7 - The Account
      • Step 8 - The Person
      • Step 9 - Making it all work together
    • Library Challenge
      • Important Topics
    • Extras
  • Week 2 -Programming Basics - JavaScript
  • Week 3 - TypeScript and Angular
  • Week 4 - Ruby on Rails Basics
  • Week 5 - Working With Legacy Code
  • Week 6 - Midcourse Project
  • Week 7 - Going Mobile
  • Week 8 & 9 - Advanced SaaS Applications
  • Week 10 - Expose and Consume API's
  • Configuring RSpec
Powered by GitBook
On this page
  • Week 1 Ruby challenge
  • Instructions
  • Learning objective
  • Requirements
  • Tasks
  • Tips
  • Some hints:
  • What we are looking for
  • I'm hoping to see that:
  • In your Pull Request, I'm hoping to see:
  1. Week 1 - Programming Basics - Ruby

Library Challenge

PreviousStep 9 - Making it all work togetherNextImportant Topics

Last updated 7 years ago

Week 1 Ruby challenge

Instructions

Read this entire README carefully and follow all instructions. Go to and fork that repository to your own GitHub account.

  • Challenge time: this weekend, until Monday 9am

  • Feel free to use Google, Stack Overflow, your notes, previously written code, books, etc.

  • If you refer to or have in whole or partially used the solution of another coach or student, please put a link to that in your README

  • If you have a partial solution, still check in a partial solution to GitHub and create a Pull Request

  • You must submit a Pull Request to this repository with your code by 9.30am Monday morning - before the stand-up

  • You need to plan the weekend with your pairing partner so that you can work efficiently.

Learning objective

This challenge will provide you with an opporunity to practice a lot of your newly acquired technical skills.

  • Practice TDD to drive your development process

  • Adopt to a new domain

  • Work with data stored in hashes and perform

  • Learn about YAML

  • Learn about storing information in a text file

  • Practice writing documentation

  • Learn to write user stories

  • Practice Pair programming

Requirements

We are approached by a newly built library. They need an app to keep track of all their books. Luckily they have only received an handful of books so far and this is the perfect time to create a prototype application that will keep track of the books.

Let's see what they have to say:

"We need an app where both the visitors and the library can see if a list of books are available, it would be nice to see both the title and the author of the book. The library needs to store these books in a file where we can easily check if a book is available or not. The library also needs the visitors to check out books after finding the title they want. Depending on the time of the checkout the library needs the books to be returned within a month and obviously it would be nice for the visitor to know which date to return the book."

You and your pairing partner needs to extract the user stories from the text above remember to keep it simple. Being a prototype we just need to see if the app works in IRB.

Tasks

  • Write appropriate user stories from the requirements

  • Run the command 'bundle' in the project directory to ensure you have all the gems

  • Write your specs and implementation

  • Be smart about using Git: commit and push often. Use feature branches.

  • Create a Pull Request as soon as possible

Tips

Some hints:

  • A Person needs to have a list of books that he currently has in his possession. That list needs to include the return date.

  • The return date can be calculated using the Date object. Out of the box, there are methods you can use to add days to the current date.

  • Make use of doubles when writing your specs

What we are looking for

I'm hoping to see that:

  • You can take a problem set and write a well tested implementation.

  • You understand how to define Ruby Classes and work with objects.

  • You understand how classes can interact with each other.

  • You know how to make use of arrays, hashes, and associated methods to create dynamic lists.

  • You know how to write specs and use them as a blueprint in your development.

  • I can track your work by following you commit history - so please commit as soon you are done with a feature or when you have made a test pass.

In your Pull Request, I'm hoping to see:

  • That you are testing the right thing in the right spec file.

  • That all tests passing - green is good!

  • High test coverage (above 95% is accepted)

  • The code is easy to follow: every class has a clear responsibility, methods are short, code is nicely formatted, etc.

  • The README.md includes information on how to use your solution with command examples in irb.

Happy coding!

Fork the challenge repo:

Follow the for methods and variables

CraftAcademy/library-challenge
https://github.com/CraftAcademy/library-challenge
naming conventions/standards