Skip to content

Commit d07d1fd

Browse files
Clarify indentation and with_indentation docs [ci-skip]
1 parent 44b1470 commit d07d1fd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

railties/lib/rails/generators/actions.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,16 @@ def optimize_indentation(value, amount = 0) # :doc:
489489
end
490490
alias rebase_indentation optimize_indentation
491491

492-
# Indent the +Gemfile+ to the depth of @indentation
492+
# Returns a string corresponding to the current indentation level
493+
# (i.e. 2 * <code>@indentation</code> spaces). See also
494+
# #with_indentation, which can be used to manage the indentation level.
493495
def indentation # :doc:
494496
" " * @indentation
495497
end
496498

497-
# Manage +Gemfile+ indentation for a DSL action block
499+
# Increases the current indentation indentation level for the duration
500+
# of the given block, and decreases it after the block ends. Call
501+
# #indentation to get an indentation string.
498502
def with_indentation(&block) # :doc:
499503
@indentation += 1
500504
instance_eval(&block)

0 commit comments

Comments
 (0)