update docs and fix a regex

This commit is contained in:
John Bintz 2011-09-09 14:41:16 -04:00
parent f7738f3d42
commit af74214e34
2 changed files with 10 additions and 6 deletions

View File

@ -19,11 +19,6 @@ Installs a bunch of scripts into the `scripts` directory of your project:
* `hooks/pre-commit`, one of the hooks the prior script installs * `hooks/pre-commit`, one of the hooks the prior script installs
* `initialize-environment`, which bootstraps your local environment so you can get up and running * `initialize-environment`, which bootstraps your local environment so you can get up and running
## initialize-environment
It will also try to run `rake bootstrap`, so add a `:bootstrap` task for things that should happen when you start going
(make databases, other stuff, etc, whatever). This won't run if the `:bootstrap` task is not there.
## Gemfile.erb?! ## Gemfile.erb?!
Yeah, it's a `Gemfile` with ERB in it: Yeah, it's a `Gemfile` with ERB in it:
@ -43,6 +38,15 @@ It then runs `bundle install`.
You can also run `penchant gemfile ENV`. You can also run `penchant gemfile ENV`.
## initialize-environment
Get new developers up to speed fast! `script/initialize-environment` does the following when run:
* Check out any remote repos found in `Gemfile.erb` to the same directory where your current project lives.
That way, you can have your `Gemfile.erb` set up as above and everything works cleanly.
* Runs `script/gemfile remote` to set your project to using remote repositories.
* Runs `rake bootstrap` for the project if it exists.
### After-`gemfile` hooks? ### After-`gemfile` hooks?
Drop a file called `.penchant` in your project directory. It'll get executed every time you switch environments using Drop a file called `.penchant` in your project directory. It'll get executed every time you switch environments using

View File

@ -5,7 +5,7 @@ if File.file?('Gemfile.erb')
Dir.chdir '..' do Dir.chdir '..' do
File.readlines(File.join(pwd, 'Gemfile.erb')).find_all { |line| line[':git'] }.each do |line| File.readlines(File.join(pwd, 'Gemfile.erb')).find_all { |line| line[':git'] }.each do |line|
repo = line[%r{:git => (['"])(.*)\1}, 2] repo = line[%r{:git => (['"])([^'"]+)\1}, 2]
puts "Installing #{repo}" puts "Installing #{repo}"
system %{git clone #{repo}} system %{git clone #{repo}}