class Bundler::Injector
def is_not_within_comment?(line, match_data)
-
match_data
(MatchData
) -- Data about Regex match. -
line
(String
) -- Individual line of gemfile content.
def is_not_within_comment?(line, match_data) match_start_index = match_data.offset(0).first !line[0..match_start_index].include?("#") end