diff options
author | Stefan Kanev <stefan.kanev@gmail.com> | 2014-07-31 12:05:07 +0200 |
---|---|---|
committer | Stefan Kanev <stefan.kanev@gmail.com> | 2014-08-03 00:29:29 +0200 |
commit | 097b2101897af447591d00fb2809d91894572b87 (patch) | |
tree | 7e93565be3c211ce0eb8339b93e2464ecae56591 /guides | |
parent | dc1a6614dca69a8ec7a368c5a0d7bc32660c1c1d (diff) | |
download | rails-097b2101897af447591d00fb2809d91894572b87.tar.gz rails-097b2101897af447591d00fb2809d91894572b87.tar.bz2 rails-097b2101897af447591d00fb2809d91894572b87.zip |
Add an after_bundle callback in Rails templates
The template runs before the generation of binstubs – this does not
allow to write one, that makes an initial commit to version control.
It is solvable by adding an after_bundle callback.
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/rails_application_templates.md | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/guides/source/rails_application_templates.md b/guides/source/rails_application_templates.md index 0bd608c007..7a3bd35a22 100644 --- a/guides/source/rails_application_templates.md +++ b/guides/source/rails_application_templates.md @@ -38,9 +38,11 @@ generate(:scaffold, "person name:string") route "root to: 'people#index'" rake("db:migrate") -git :init -git add: "." -git commit: %Q{ -m 'Initial commit' } +after_bundle do + git :init + git add: "." + git commit: %Q{ -m 'Initial commit' } +end ``` The following sections outline the primary methods provided by the API: @@ -228,6 +230,22 @@ git add: "." git commit: "-a -m 'Initial commit'" ``` +### after_bundle(&block) + +Registers a callback to be executed after bundler and binstub generation have +run. Useful for adding the binstubs to version control: + +```ruby +after_bundle do + git :init + git add: '.' + git commit: "-a -m 'Initial commit'" +end +``` + +The callbacks gets executed even if `--skip-bundle` and/or `--skip-spring` has +been passed. + Advanced Usage -------------- |