mendicant-original / puzzlenode

Quiz application inspired by Project Euler and the Internet Problem Solving Contest (IPSC)
puzzlenode.com
81 stars 43 forks source link

Create a setup rake task #44

Closed jordanbyron closed 12 years ago

jordanbyron commented 13 years ago

For an example look at the one I wrote for Mission of Mercy

The setup rake task will help first time developers get up and running faster so they can get down to coding. As best it can, it should automate the steps in "Setting Up a Development Copy: Step by Step" from the README

justinramel commented 12 years ago

Hi Jordan, I've had a first crack at this and issued a pull request.

justinramel commented 12 years ago

Hmm it appears my pull request has created a new issue.

Is the some way to attach pull request to a current issue?

jordanbyron commented 12 years ago

Hey @justinramel,

This ticket was already assigned to @jduan. He was going to work on it as part of his Mendicant Community service assignment.

Hmm it appears my pull request has created a new issue.

All pull requests created new issues. You mention the issue number in the pull request, and that will "link" it to the existing issue.

justinramel commented 12 years ago

Ah sorry I thought the tickets without comments where up for grabs, I'll take a look for something else this isn't already assigned!

On Sat, Jan 14, 2012 at 2:04 AM, Jordan Byron reply@reply.github.com wrote:

Hey @justinramel,

This ticket was already assigned to @jduan. He was going to work on it as part of his Mendicant Community service assignment.

Hmm it appears my pull request has created a new issue.

All pull requests created new issues. You mention the issue number in the pull request, and that will "link" it to the existing issue.


Reply to this email directly or view it on GitHub: https://github.com/mendicant-university/puzzlenode/issues/44#issuecomment-3489706

jordanbyron commented 12 years ago

That's ok it's no biggie. I wish more people accidentally contributed patches :wink:

@jduan why don't you review pull request #65, make sure everything looks good.

On Jan 14, 2012, at 3:40 AM, Justin Ramelreply@reply.github.com wrote:

Ah sorry I thought the tickets without comments where up for grabs, I'll take a look for something else this isn't already assigned!

On Sat, Jan 14, 2012 at 2:04 AM, Jordan Byron reply@reply.github.com wrote:

Hey @justinramel,

This ticket was already assigned to @jduan. He was going to work on it as part of his Mendicant Community service assignment.

Hmm it appears my pull request has created a new issue.

All pull requests created new issues. You mention the issue number in the pull request, and that will "link" it to the existing issue.


Reply to this email directly or view it on GitHub: https://github.com/mendicant-university/puzzlenode/issues/44#issuecomment-3489706


Reply to this email directly or view it on GitHub: https://github.com/mendicant-university/puzzlenode/issues/44#issuecomment-3490950

jduan commented 12 years ago

Sorry I have been working on my personal project and exercise. Will take a look at the pull request

Sent from my iPhone

On Jan 14, 2012, at 5:32 AM, Jordan Byronreply@reply.github.com wrote:

That's ok it's no biggie. I wish more people accidentally contributed patches :wink:

@jduan why don't you review pull request #65, make sure everything looks good.

On Jan 14, 2012, at 3:40 AM, Justin Ramelreply@reply.github.com wrote:

Ah sorry I thought the tickets without comments where up for grabs, I'll take a look for something else this isn't already assigned!

On Sat, Jan 14, 2012 at 2:04 AM, Jordan Byron reply@reply.github.com wrote:

Hey @justinramel,

This ticket was already assigned to @jduan. He was going to work on it as part of his Mendicant Community service assignment.

Hmm it appears my pull request has created a new issue.

All pull requests created new issues. You mention the issue number in the pull request, and that will "link" it to the existing issue.


Reply to this email directly or view it on GitHub: https://github.com/mendicant-university/puzzlenode/issues/44#issuecomment-3489706


Reply to this email directly or view it on GitHub: https://github.com/mendicant-university/puzzlenode/issues/44#issuecomment-3490950


Reply to this email directly or view it on GitHub: https://github.com/mendicant-university/puzzlenode/issues/44#issuecomment-3492140

jordanbyron commented 12 years ago

@jduan no rush, this doesn't have to happen right now.

jduan commented 12 years ago

Hi Justin,

I took a look at your code. It looks good to me. Please see a few comments I added.

jordanbyron commented 12 years ago

@jduan I have an idea. :bulb: Do you want to try extracting out some of the common functions all rake setup tasks would perform into a gem which can be included into a project and extended based on that projects needs. All projects will need a database.yml file if they don't exist, and databases will need to be created and seeded.

Plus we won't have to keep coping and pasting this script from project to project. If that seems like something you think you can handle then let's go for it.

jduan commented 12 years ago

Jordan,

That sounds interesting to me. Here's my plan of a minimum version of it. What do you think?

  1. Create a gem
  2. The gem, when installed, will install a script to the host env
  3. The script takes a parameter which is the root of a rails env
  4. When it runs, the script will create a $RAILS_ROOT/lib/tasks/setup.rake. If setup.rake already exists, prompt the user and exit

The setup.rake will be a copy of yours:-) Of course, there will be documentation on what this gem does and how to use it etc.

jordanbyron commented 12 years ago

@jduan my idea was to create something a little more robust then just a simple generator. I was thinking of moving most of the code from the setup.rake file and adding it to it's own helper file which is then included in a skeleton setup.rake file.

For example, lines 78-104 would all be part of the gem's library and not duplicated in the setup.rake file. Some common methods, like checking if a file exists and performing different actions depending on that result, could also be rolled into the gem's code.

Then the gem would also have a generator rake task which would perform just as you outlined above. Please reach out to @sandal and @semmons99 for feedback on this.

jduan commented 12 years ago

I'll ponder on it and see what I come up with.

justinramel commented 12 years ago

@jduan I've read your comments they all seem relevant thanks.

Looks like your going to be creating a gem for this so I'll leave it with you.

jduan commented 12 years ago

Jordan,

Do we still want to create a gem which extracts the common functions from the setup.rake?

For my own reference: https://github.com/mendicant-university/community/blob/master/lib/tasks/setup.rake

jordanbyron commented 12 years ago

@jduan let's start off with getting a proper setup.rake task created for PuzzleNode. Then if you want, we can work together on a gemified solution later. Sound good?

jduan commented 12 years ago

I can't seem to figure out how to make String#underline work. It looks String#underline is from HighLine. I tried to do the following in the setup.rake file but when I run 'bundle exec rake setup' it complains that "undefined method `colorize_strings' for HighLine:Class"

require 'highline'

HighLine.colorize_strings # right after requires, outside task

It seems the 'community' project is able to use underline without doing anything. What did I miss? Thanks.

jordanbyron commented 12 years ago

That is from the rainbow gem. I don't think we need highlife for this project. Thanks for working on this :smile:

practicingruby commented 12 years ago

Right, HighLine provides colorize_strings but not String#underline. Patching core classes is evil!