Skip to content
This repository has been archived by the owner on Sep 2, 2019. It is now read-only.

Commit

Permalink
Add support for else in begin/rescue/end blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Chippindale committed May 3, 2011
1 parent 6a5538f commit 54713bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Support/lib/rbeautify/config/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

ruby.add_matcher(:begin,
/((#{start_statement_boundary}begin)|(#{continue_statement_boundary}(ensure|rescue)))\b/,
/(((^|;|\s)end)|#{continue_statement_boundary}(rescue|ensure))\b/,
/(((^|;|\s)end)|#{continue_statement_boundary}(rescue|ensure|else))\b/,
:nest_except => [:double_quote, :regex, :backtick])

ruby.add_matcher(:if,
Expand Down
1 change: 1 addition & 0 deletions Support/spec/rbeautify/config/ruby_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@

it { @current_block.parse_block_end('rescue', 0).should be_block_end_like(@current_block, 0, 'rescue', '') }
it { @current_block.parse_block_end('ensure', 0).should be_block_end_like(@current_block, 0, 'ensure', '') }
it { @current_block.parse_block_end('else', 0).should be_block_end_like(@current_block, 0, 'else', '') }
it { @current_block.parse_block_end('end', 0).should be_block_end_like(@current_block, 0, 'end', '') }
end

Expand Down

0 comments on commit 54713bb

Please sign in to comment.