old_contents: import re
  
  from coalib.bearlib.abstractions.Lint import Lint
  from coalib.bears.LocalBear import LocalBear
  from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
  
  
  class RubySyntaxBear(LocalBear, Lint):
      executable = 'ruby'
      arguments = '-wc {filename}'
      output_regex = re.compile(
          r'(?P<file_name>.+?):(?P<line>\d+): (?P<message>'
          r'.*?(?P<severity>error|warning)[,:] [^\r\n]+)\r?\n'
          r'(?:^[^\r\n]+\r?\n^(?P<col>.*?)\^)?')
      use_stderr = True
      severity_map = {
          "warning": RESULT_SEVERITY.NORMAL,
          "error": RESULT_SEVERITY.MAJOR}
      LANGUAGES = "Ruby"
  
      def run(self, filename, file):
          '''
          Checks the code with `ruby -wc` on each file separately.
          '''
          return self.lint(filename)
  
new_contents: from coalib.bearlib.abstractions.Linter import linter
  
  
  @linter(executable='ruby',
          use_stdout=False,
          use_stderr=True,
          output_format='regex',
          output_regex=r'.+?:(?P<line>\d+): (?P<message>.*?'
                       r'(?P<severity>error|warning)[,:] \S+)\s?'
                       r'(?:\S+\s(?P<column>.*?)\^)?')
  class RubySyntaxBear:
      """
      Checks the code with ``ruby -wc`` on each file separately.
      """
      LANGUAGES = "Ruby"
  
      @staticmethod
      def create_arguments(filename, file, config_file):
          return '-wc', filename
  
subject: Refactor to Linter v2 API