Skip to content

Commit

Permalink
Autocorrect Performance/RegexpMatch offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Jun 12, 2020
1 parent 059343a commit fe8e23a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion features/step_definitions/cucumber_rails_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
new_content = []

content.each do |line|
next if line =~ /gem ["|']#{gem_name}["|'].*/
next if /gem ["|']#{gem_name}["|'].*/.match?(line)

new_content << line
end
Expand Down
2 changes: 1 addition & 1 deletion features/support/cucumber_rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def add_gem(name, *args)
gem_regexp = /gem ["']#{name}["'].*$/
gemfile_content = File.read(expand_path('Gemfile'))

if gemfile_content =~ gem_regexp
if gemfile_content&.match?(gem_regexp)
updated_gemfile_content = gemfile_content.gsub(gem_regexp, line)
overwrite_file('Gemfile', updated_gemfile_content)
else
Expand Down

0 comments on commit fe8e23a

Please sign in to comment.