Add an after_bundle callback in Rails templates

Closes #16292.

The following Rails template (taken from the Rails guides) does not work well with binstubs:

```ruby
# template.rb
generate(:scaffold, "person name:string")
route "root to: 'people#index'"
rake("db:migrate")
 
git :init
git add: "."
git commit: %Q{ -m 'Initial commit' }
```

Since it is executed before Bundler and Spring binstub generation, the generated stubs are not added to version control. Executing the templates later wouldn't work either – that way it won't be able to add gems.

Adding an `after_bundle` callback seems to solve the issue. That way, the version control commands can be postponed after the binstubs have been generated:

```ruby
# template.rb
generate(:scaffold, "person name:string")
route "root to: 'people#index'"
rake("db:migrate")
 
after_bundle do
  git :init
  git add: "."
  git commit: %Q{ -m 'Initial commit' }
end
```

This pull request implements that callback. The test is a mouthful – I'm open to suggestions for improvements :smile: 

/cc @senny 
I can try, but I'm not sure how. I arrived at this code by following the style of the surrounding tests. I want to check that:

1. `bundle gets run
2. ...then binstubs get generated
3. ...then the `after_bundle` callbacks get executed

Surely the test cannot invoke `bundle`, since it will make them (1) nondeterministic and (2) dependant on internet connection. Also, (3) very slow. Calls to the first two need to get stubbed in some way.

If I'm not allowed to use Mocha, I'm not sure how to handle it. I can define singleton methods on `generator`, but that will surely get messier and harder to understand.

There is also the business of supplying a template. Since a string containing code cannot be passed to `generator`, there's this `path` and `template.instance_eval` business that I borrowed from a test in the same suite. If I'm to remove Mocha, we should also figure out how to do that.

Finally, if the other tests in the suite can benefit from the same approach. Maybe there are a few nice abstractions that can be extracted and all the tests can benefit from them. This feels like another, larger task. I'd love to do it also (in a separate PR possibly), but I'll definitely need some hints on how to do it :)