Skip to content

Commit

Permalink
Auto corrected by following Format Ruby Code
Browse files Browse the repository at this point in the history
  • Loading branch information
Awesome Code committed Jun 24, 2024
1 parent aa7686b commit be6002e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/synvert/core/rewriter/instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@ def wrap_with_quotes(str)
# @param tab_size [Integer] The number of spaces per tab.
# @return [String] The indented source code.
def indent(source, tab_size: 1)
source.each_line.map { |line| (' ' * NodeMutation.tab_width * tab_size) + line }.join
source.each_line.map { |line| (' ' * NodeMutation.tab_width * tab_size) + line }
.join
end

# Dedents the given source code by removing leading spaces or tabs.
Expand All @@ -467,7 +468,8 @@ def indent(source, tab_size: 1)
# @param tab_size [Integer] The number of spaces per tab (default is 1).
# @return [String] The dedented source code.
def dedent(source, tab_size: 1)
source.each_line.map { |line| line.sub(/^ {#{NodeMutation.tab_width * tab_size}}/, '') }.join
source.each_line.map { |line| line.sub(/^ {#{NodeMutation.tab_width * tab_size}}/, '') }
.join
end

private
Expand Down

0 comments on commit be6002e

Please sign in to comment.