GithubHelp home page GithubHelp logo

fruit_exercise's Introduction

Fruit Exercise

This was an interesting experience, I learned a lot. I've never used the Sequel gem so a big portion of my time was spent exploring the documentation and learning about the gem.

How to use

Getting rid of ActiveRecord meant no fancy generators or tasks for models. I have therefore added a sequel rake file in order to automate certian database tasks.

  • 'db:create' - Create the database if it does not exist.
  • 'db:drop' - Drop the database if it exists.
  • 'db:migrate' - Run the Sequel migrations.
  • 'db:reset' - Reset the database (drop the tables and migrate).
  • 'db:populate' - Reset and then populate the database with 1 million records.

Running db:create and then db:populate should be all you need to get going. Population of the database takes ~2 minutes on my machine.

The Dataset Model

The model has a bunch of methods that go unused in the actual implementation, but I can see them being useful if the requirements were different. I wrote them because I thought they would be useful in solving the problem at hand but in the end I thought of better solutions which I used instead. Since I bothered to write tests for them I left them in, I didn't think it would hurt.

Other comments

I would have attempted to write tests for the rake tasks but that is another area where I do not have any experience. I may get around to it but it seems to work as expected in my manual testing.

fruit_exercise's People

Contributors

jbttn avatar

Watchers

 avatar James Cloos 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.