Method: Mj::AlternativeFile::ThorCommand#prev

Defined in:
lib/mj/alternative_file/thor_command.rb

#prev(reference_file) ⇒ Object



49
50
51
52
53
54
55
# File 'lib/mj/alternative_file/thor_command.rb', line 49

def prev(reference_file)
  handler = Commands::ListCommandHandler.new(resolvers: self.class.resolvers)
  command = Commands::ListCommand.new(reference_file, options)
  candidates = handler.handle(command)
  candidate = candidates.before(command.file)
  print_candidates([candidate].compact)
end