Giter Site home page Giter Site logo

date-chapter's Introduction

Ruby Practice

Run your Ruby file by typing ruby and then the name of the file you want to run in the Terminal.

If we want to run date_math.rb, we can write the command:

ruby date_math.rb

To re-run this command, you can use the UP and DOWN arrow keys to look at the history of commands you've run in a Terminal.

Date

date_formatted.rb

Should format and identify different parts of todays date.

"The year is: 2020, the calendar day is: 1, and the month is: 7."

date_math.rb

Should output the number of days since Ruby was made.

Ruby released to the public on December 21, 1995.

"Ruby is 108937 days old!"

date_monday.rb

Should output:

"Is today Monday? true"

if today is Monday, or

"Is today Monday? false"

if today is not Monday.

Specs

Click here to see names of each test

date_math.rb should output '8959' when today is Jul 1, 2020

date_math.rb is not 'hard-coded' to the current date'

date_formatted.rb outputs 'The year is: 2020, the calendar day is: 1, and the month is: 7.' when today is July 1, 2020

date_formatted.rb outputs the formatted dates for any past/future date

date_formatted.rb should output 'Is today Monday? false', when today is not Monday

date_monday.rb should output 'Is today Monday? false', when today is not Monday

date_monday.rb should output 'Is today Monday? false', when today is not Monday

date-chapter's People

Contributors

jelaniwoods avatar pmckernin avatar

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.