Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Loc#source to display the source content form a RBI location #127

Merged
merged 1 commit into from
Mar 10, 2022

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented Mar 10, 2022

See related tests.

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar added the feature New feature label Mar 10, 2022
@Morriar Morriar requested a review from a team March 10, 2022 21:21
@Morriar Morriar self-assigned this Mar 10, 2022
@Morriar Morriar merged commit 0da1ee1 into main Mar 10, 2022
@Morriar Morriar deleted the at-loc-source branch March 10, 2022 21:37
Comment on lines +45 to +47
::File.foreach(file).with_index do |line, line_number|
string << line if line_number + 1 >= begin_line && line_number + 1 <= end_line
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be more readable as:

range = (begin_line..end_line)
::File.foreach(file).with_index do |line, line_number|
  string << line if range.include?(line_number + 1)
end

@shopify-shipit shopify-shipit bot temporarily deployed to production March 15, 2022 13:30 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants