Skip to content

thewatts/primer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Primer

A simple ruby application for finding the nth prime.

More?

More than anything, this is me working to improve my understanding of ruby & testing.

Specifically built to answer Problem 7 from Project Euler

How do I use this and its amazingness?!

  • git clone git@github.com:thewatts/primer.git
  • cd primer
  • bundle install (needed for progress_bar)
  • ruby bin/primer should do the trick, though I'm new at this thing.

Things I've learned/observed thus far (as obvious as they may be)

Methods

  • Keep them small
  • Only a few lines
  • If there is a lot going on -> too complicated

Modules

  • Still kinda confused on this whole deal.
    • Specifically why they used modules over regular classes...
  • I used the same 'layout' for organizing/creating things as The RSPEC Book's codebreaker project

Testing

  • Having a Rake file makes testing easier, instead of having to type the ruby testing commands.
  • Write tests the same way I would test in the command line, makes it easier!

UX

  • even though this is a terminal app, intentional readability is very necessary to show what's clearly going on. without such, the app could be confusing.

Credits

  • @jdtornow for helping me break down my original file lib/primer/prime.rb into smaller chunks & for giving me a 101 on testing!
  • @ernie for giving me perspective on naming conventions and evaluating true use case for the project - command line app vs what I have now (with the messages, outputs, etc)!
  • @steveklabnik for sharing some code smells (ex: require_relative) and pointing me in the directino of some services, such as CodeClimate/TravisCI/Coveralls.io!

About

Find the nth Prime, yo.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages