diff --git a/.gitignore b/.gitignore index 4f06bb9b..8af1da5b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ tmp/ .DS_Store *.swp .redcar +bin/ diff --git a/.rvmrc b/.rvmrc deleted file mode 100644 index 751e0242..00000000 --- a/.rvmrc +++ /dev/null @@ -1 +0,0 @@ -rvm use --create ruby-1.9.3@hackety-hack.com diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..049e26d1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,24 @@ +# Thanks for helping! # + +## Questions ## + +If you're asking a question about Hackety Hack itself, check out the [Hackety +Hack repository][hh]. +Otherwise, go ahead and open an [issue][issues] and let us know! + +## Bugs ## + +If you notice a bug in Hackety-Hack.com, this is the place to let us know. +Please tell us: + +- Which url the bug occurred at +- What steps we can take to reproduce this bug +- If the bug is visual, including a screenshot is really helpful. + +## Pull Requests ## + +We :heart: pull requests; We :heart::blue_heart::green_heart: Pull Requests with tests. In fact, we don't want to accept pull requests without relevant tests. If you're not sure if the feature you want is welcome and you want to check with us, feel free to create [an issue][issues] or if you're just totally driven to make it happen, spike it out and open a pull request, but we'll ask you to add tests before it's merged. + + +[hh]: https://github.com/hacketyhack/hacketyhack +[issues]: https://github.com/hacketyhack/hackety-hack.com/issues diff --git a/Gemfile b/Gemfile index 343d656d..50f8b79d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,10 @@ source 'http://rubygems.org' +#ruby=1.9.3-p392 +#ruby-gemset=hackety-hack.com + +ruby '1.9.3' + gem 'rails', '3.1.11' gem 'json' diff --git a/README.md b/README.md index 877b1272..d89618b1 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,24 @@ If you have any experience writing Rails apps, feel free to help out, we're open + **Test your code**, we really can't stress this enough, ideally you should be practicing [TDD][tdd] and writing tests before you even write your code. If you don't test your code, we have no way of knowing if it works properly so please do test. + **If it's a major feature, file an issue**, if you file an issue we can discuss certain aspects of the new feature with you and ensure it's a good fit for hackety-hack.com. -Additionally, if you're _not_ a developer and you have a feature you'd really like to see on the site, file an issue and we'll be sure to look into it on your behalf. +## Getting Started ## + +Once you've cloned this repository, running `script/bootstrap` should tell you everything you need to know. + +Dependencies for the curious: + +- Ruby: 1.9.3 is preferred. +- MongoDB: 2.2.x or 2.4.x + +As long as you have those things, the script will handle the rest as best it can, including installing the gem dependencies with Bundler. + +If the tests aren't passing when you clone, open [an issue][issues] or drop into +[#hacketyhack on freenode][irc]. + +Additionally, if you're _not_ a developer and you have a feature you'd really like to see on the site, file [an issue][issues] and we'll be sure to look into it on your behalf. [hh.com]: http://hackety-hack.com/ [hh]: https://github.com/hacketyhack/hacketyhack -[tdd]: http://en.wikipedia.org/wiki/Test-driven_development \ No newline at end of file +[irc]: http://webchat.freenode.net/#hacketyhack +[issues]: https://github.com/hacketyhack/hackety-hack.com/issues +[tdd]: http://en.wikipedia.org/wiki/Test-driven_development diff --git a/script/bootstrap b/script/bootstrap new file mode 100755 index 00000000..f4cb94b6 --- /dev/null +++ b/script/bootstrap @@ -0,0 +1,58 @@ +#!/bin/dash + +go_go_gadget_bootstrap() { + check_ruby + check_mongo + check_bundler + bail_unless_chill + good_luck_have_fun +} + +check_mongo() { + which mongo > /dev/null 2>&1 + if [ $? -ne 0 ]; then + NOMONGO="Hey, in order to remember stuff I need MongoDB" + fi +} + +check_bundler() { + if [ -z "$NORUBY" ]; then + which bundle > /dev/null 2>&1 + if [ $? -ne 0 ]; then + gem install bundler || exit 2 + fi + fi +} + +good_luck_have_fun() { + bundle install --path .bundle --binstubs bin + bin/rake spec cucumber +} + +check_ruby() { + which ruby > /dev/null 2>&1 + if [ $? -ne 0 ]; then + NORUBY="Whoa there, looks like you're missing Ruby!" + else + ruby -v | grep '^ruby 1.9.3' > /dev/null 2>&1 + if [ $? -ne 0 ]; then + NORUBY="Hrmm, your Ruby version isn't Ruby 1.9.3, that's really what I prefer." + fi + fi +} + +bail_unless_chill() { + if [ "$NORUBY" -a "$NOMONGO" ]; then + echo "$NORUBY" + echo "$NOMONGO" + exit 1 + elif [ "$NORUBY" ]; then + echo "$NORUBY" + exit 1 + elif [ "$NOMONGO" ]; then + echo "$NOMONGO" + exit 1 + fi +} + +go_go_gadget_bootstrap