aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/rails_application_templates.md
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-08-06 08:49:00 +0200
committerYves Senn <yves.senn@gmail.com>2014-08-06 08:49:00 +0200
commita8192119840c62bf2a0e564817c172191711b4b2 (patch)
tree432ae673ce2a219796a634f5769b151f1c0a3af4 /guides/source/rails_application_templates.md
parentec54acd1e01374f0b5b495d7659181d7382e119e (diff)
parentc294e91d00696e910e05ad1428ba3ce4884bc6a3 (diff)
downloadrails-a8192119840c62bf2a0e564817c172191711b4b2.tar.gz
rails-a8192119840c62bf2a0e564817c172191711b4b2.tar.bz2
rails-a8192119840c62bf2a0e564817c172191711b4b2.zip
Merge pull request #16359 from skanev/after-bundle-in-rails-templates
Add an after_bundle callback in Rails templates Conflicts: railties/CHANGELOG.md
Diffstat (limited to 'guides/source/rails_application_templates.md')
-rw-r--r--guides/source/rails_application_templates.md24
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..6512b14e60 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 the gems are bundled and binstubs
+are generated. Useful for all generated files 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
--------------