Giter Site home page Giter Site logo

g5-assessment-ruby's Introduction

gSchool Ruby assessment

You work for a book company that publishes poems. You just inherited a treasure trove of poems in the public domain. Your job is to provide some stats about the poems.

Each poem file looks like this:

In Possum Land
Henry Lawson

In Possum Land the nights are fair,
the streams are fresh and clear;
no dust is in the moonlit air;
no traffic jars the ear.

With Possums gambolling overhead,
'neath western stars so grand,
Ah! would that we could make our bed
tonight in Possum Land

The files contain:

  • A title
  • An author
  • A blank line
  • The poem
  • Each verse is separated by a blank line

Challenge

Write library code that can:

{
  "Henry Lawson" => {
    "In Possum Land" => {
      verses: 2,
      lines: 8,
    },
    "I'll Tell You What You Wanderers" => {
      verses: 1,
      lines: 8,
    },
  },
  "Robert Lee Frost" => {
    "The Lockless Door" => {
      verses: 5,
      lines: 20, 
    }
  }
}

The number of lines should reflect the number of non-blank lines. So the following poem would have 8 lines:

In Possum Land the nights are fair,
the streams are fresh and clear;
no dust is in the moonlit air;
no traffic jars the ear.

With Possums gambolling overhead,
'neath western stars so grand,
Ah! would that we could make our bed
tonight in Possum Land

Notes

We will run this code on a computer that is not yours. Please do not hard-code any full paths on your computer.

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.