Skip to content

Commit

Permalink
Fix RuboCop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Feb 28, 2021
1 parent d76ca22 commit b215a7c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/aruba/config/jruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

env["JRUBY_OPTS"] = jruby_opts

if /solaris|sunos/i.match(RbConfig::CONFIG["host_os"])
if /solaris|sunos/i =~ RbConfig::CONFIG["host_os"]
java_opts = env["JAVA_OPTS"] || ""

# force jRuby to use client JVM for faster startup times
Expand Down
2 changes: 1 addition & 1 deletion lib/aruba/initializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def add_gem

content = if File.exist? file
file_ends_with_carriage_return =
File.open(file, "r").readlines.last.match(/.*\n$/)
File.open(file, "r").readlines.last =~ /.*\n$/

prefix = file_ends_with_carriage_return ? "" : "\n"

Expand Down
2 changes: 1 addition & 1 deletion lib/aruba/matchers/base/message_indenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module MessageIndenter
def indent_multiline_message(message)
message = message.sub(/\n+\z/, "")
message.lines.map do |line|
/\S/.match(line) ? " #{line}" : line
/\S/ =~ line ? " #{line}" : line
end.join
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/aruba/platforms/unix_platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def default_shell
end

def detect_ruby(cmd)
if /^ruby\s/.match(cmd)
if /^ruby\s/ =~ cmd
cmd.gsub(/^ruby\s/, "#{current_ruby} ")
else
cmd
Expand Down
2 changes: 1 addition & 1 deletion lib/aruba/platforms/windows_command_string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def to_a

def escaped_arguments
@arguments.map { |arg| arg.gsub(/"/, '"""') }
.map { |arg| / /.match(arg) ? "\"#{arg}\"" : arg }
.map { |arg| / / =~ arg ? "\"#{arg}\"" : arg }
end

def escaped_command
Expand Down

0 comments on commit b215a7c

Please sign in to comment.