<commit_before>module Doctor
  class ReleasePathAnalyser
    def analyse
      result = []
      result << check_path
      result
    end

    private

    def check_path
      path = /(\d+)$/.match(Rails.root.to_s)[0]
      last = Dir.entries("#{Rails.root}/..").sort_by { |x| File.basename(x) }.reverse[0]
      status = last == path ? 'ok' : 'error'
      result = {
        status: status,
        last_release: last,
        path: path
      }
      OpenStruct.new(result)
    end
  end
end<commit_msg>remove te regex and code improvement<commit_after>module Doctor
  class ReleasePathAnalyser
    def analyse
      [check_path]
    end

    private

    def check_path
      path = File.basename(Rails.root)
      last = Dir.entries("#{Rails.root}/..").sort_by { |x| File.basename(x) }.reverse[0]
      status = last == path ? 'ok' : 'error'
      OpenStruct.new(
        status: status,
        last_release: last,
        path: path
      )
    end
  end
end
{'fraction_non_alphanumeric': 0.12202688728024819, 'fraction_numerical': 0.0031023784901758012, 'mean_word_length': 2.112540192926045, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7477024', 'n_tokens_mistral': 320, 'n_tokens_neox': 315, 'n_words': 74}