summaryrefslogtreecommitdiff
path: root/test/ruby/test_lambda.rb
diff options
context:
space:
mode:
authorUfuk Kayserilioglu <ufuk.kayserilioglu@shopify.com>2023-10-27 18:14:51 +0300
committergit <svn-admin@ruby-lang.org>2023-10-30 14:15:47 +0000
commit1d51e4cadfbc1f445d00887189e06047759c9aec (patch)
treebfccd69e3e1eac646a6f00bb768b8d6dc514f0ed /test/ruby/test_lambda.rb
parentab4781b64d945e962575f2eac20b72185235d23b (diff)
[ruby/prism] Improve comment generation in templates
The existing comment generation was hard to read and was making a lot of string manipulation. However, ERB files are already designed to do string manipulation, so we can use that instead. So, instead of doing a split and a map, I opted to use the `#each_line` method to iterate over the lines of the file. Also, in order to add an optional space padding at the beginning of the line, I opted to pad it with a space and to then right trim it. This makes sure that no space is left behind if the line is empty, but a space is added if the line is not empty. https://github.com/ruby/prism/commit/5736711e70
Diffstat (limited to 'test/ruby/test_lambda.rb')
0 files changed, 0 insertions, 0 deletions