README.md in effective_developer-0.0.5 vs README.md in effective_developer-0.0.6

- old
+ new

@@ -1,12 +1,12 @@ # Effective Developer -This is a small gem with some developer quality of life scripts. +This gem contains some developer quality of life scripts and rails helpers. ## Getting Started -Add to your Gemfile: +To use the included rails helpers and rake tasks in your current rails project, add to the Gemfile: ```ruby group :development gem 'effective_developer' end @@ -16,16 +16,24 @@ ```console bundle install ``` -To use with any gem, add the following folder to your `PATH` (edit your ~/.bashrc or ~/.profile): +To use the included command line scripts in any directory, clone this repo: ```console +git clone git@github.com:code-and-effect/effective_developer.git +``` + +and add the following to your `PATH` (edit your ~/.bashrc or ~/.profile): + +```console export PATH="$PATH:$HOME/effective_developer/bin" ``` +# Shell scripts + ## gem_release A command line shell script that quickly bumps the version of any ruby gem. It checks for any uncommitted files, updates the gem's `version.rb` with the given version, makes a single file `git commit` with a tag and message, then runs `git push origin master`, `gem build` and `gem push` to rubygems. @@ -58,9 +66,58 @@ ```console > bfg --delete-files id_rsa.pub ``` +# Rake scripts + +## Reset Pk Sequence + +If you ever run into the error `duplicate key violates unique constraint (id) error`, run this script: + +```ruby +rake reset_pk_sequence +``` + +This makes sure that the autoincremented (postgresql) Pk sequence matches the correct `id` value. + +## pg:pull + +Creates a new backup on heroku, downloads that backup to latest.dump, and then calls pg:load + +```ruby +rake pg:pull +rake pg:pull[staging] +``` + +## pg:load + +Drops and re-creates the local database then initializes database with the contents of latest.dump + +```ruby +rake pg:load +rake pg:load[something.dump] +``` + +## pg:save + +Saves the development database to a postgresql .dump file (latest.dump by default) + +```ruby +rake pg:save +rake pg:save[something.dump] +``` + +## pg:clone + +Clones the production (--remote heroku by default) database to staging (--remote staging by default) + +```ruby +rake pg:clone +rake pg:clone[origin,staging] +``` + +# Rails Helpers ## CSV Importer Extend a class from `Effective::CSVImporter` to quickly build a csv importer.