Skip to content

Commit

Permalink
Refactor command.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexB52 committed Dec 11, 2024
1 parent 4576241 commit a9d7594
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions lib/retest/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@ def command
options_command || default_command
end

private

def options_command
if params[:command]
return hardcoded_command(params[:command])
if params[:command] then hardcoded_command(params[:command])
elsif params[:rspec] then rspec_command
elsif params[:rails] then rails_command
elsif params[:ruby] then ruby_command
elsif params[:rake] then rake_command
end
end

if params[:rspec] then rspec_command
elsif params[:rails] then rails_command
elsif params[:ruby] then ruby_command
elsif params[:rake] then rake_command
else
end
def default_command
log "Setup identified: [#{type.upcase}]. Using command: '#{setup_command}'"
setup_command
end

def setup_command
Expand All @@ -50,13 +53,6 @@ def setup_command
end
end

def default_command
log "Setup identified: [#{type.upcase}]. Using command: '#{setup_command}'"
setup_command
end

private

def log(message)
@stdout&.puts(message)
end
Expand Down

0 comments on commit a9d7594

Please sign in to comment.