aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2015-09-10 14:22:54 +0200
committerYves Senn <yves.senn@gmail.com>2015-09-10 14:22:54 +0200
commitb6537e430e9581fefe6992dc44732ee6b7947523 (patch)
treee3a55e793582ef17b0ba4594756e826e3e850f7d /guides
parent4828408f0a82211731a02f62007ac99fd6bbd73a (diff)
parent8b7950e25ebe7db4ee13788714173959bf771a44 (diff)
downloadrails-b6537e430e9581fefe6992dc44732ee6b7947523.tar.gz
rails-b6537e430e9581fefe6992dc44732ee6b7947523.tar.bz2
rails-b6537e430e9581fefe6992dc44732ee6b7947523.zip
Merge pull request #21575 from y-yagi/description_of_passing_block_to_add_source
add description of passing a block to `add_source` [ci skip]
Diffstat (limited to 'guides')
-rw-r--r--guides/source/rails_application_templates.md10
1 files changed, 9 insertions, 1 deletions
diff --git a/guides/source/rails_application_templates.md b/guides/source/rails_application_templates.md
index b7364536c3..edd54826cf 100644
--- a/guides/source/rails_application_templates.md
+++ b/guides/source/rails_application_templates.md
@@ -78,7 +78,7 @@ gem_group :development, :test do
end
```
-### add_source(source, options = {})
+### add_source(source, options={}, &block)
Adds the given source to the generated application's `Gemfile`.
@@ -88,6 +88,14 @@ For example, if you need to source a gem from `"http://code.whytheluckystiff.net
add_source "http://code.whytheluckystiff.net"
```
+If block is given, gem entries in block are wrapped into the source group.
+
+```ruby
+add_source "http://gems.github.com/" do
+ gem "rspec-rails"
+end
+```
+
### environment/application(data=nil, options={}, &block)
Adds a line inside the `Application` class for `config/application.rb`.