<commit_before>require 'qml'
require_relative 'pictures_from_directory'

# Link between QML and application logic
class ChoosePictures
  include QML::Access
  register_to_qml under: 'ChoosePictures', version: '1.0'

  def initalize
    super
  end

  def use_directory(directory)
    @pictures = PicturesFromDirectory.new(directory)
  end

  def current_picture
    return '' unless @pictures
    @pictures.current_picture ? @pictures.current_picture : ''
  end

  def first_picture
    @pictures.first_picture
  end

  def previous_picture
    @pictures.previous_picture
  end

  def next_picture
    @pictures.next_picture
  end

  def last_picture
    @pictures.last_picture
  end

  def has_previous
    @pictures.previous?
  end

  def has_next
    @pictures.next?
  end

  def allowed_extensions
    ALL_EXTENSIONS.map { |e| '*.' + e }.join(' ')
  end
end

QML.run do |app|
  app.load_path Pathname(__FILE__) + '../main.qml'
end<commit_msg>Disable a few Rubocop warnings<commit_after>require 'qml'
require_relative 'pictures_from_directory'

# Link between QML and application logic
class ChoosePictures
  include QML::Access
  register_to_qml under: 'ChoosePictures', version: '1.0'

  def initalize
    super
  end

  def use_directory(directory)
    @pictures = PicturesFromDirectory.new(directory)
  end

  def current_picture
    return '' unless @pictures
    @pictures.current_picture ? @pictures.current_picture : ''
  end

  def first_picture
    @pictures.first_picture
  end

  def previous_picture
    @pictures.previous_picture
  end

  def next_picture
    @pictures.next_picture
  end

  def last_picture
    @pictures.last_picture
  end

  # Temporarily disabling a few style warnings from Rubocop. The
  # normal method names for getters (e.g., previous? and next?) are
  # not valid code in QML.
  # rubocop:disable Style/PredicateName
  def has_previous
    @pictures.previous?
  end

  def has_next
    @pictures.next?
  end
  # rubocop:enable Style/PredicateName

  def allowed_extensions
    ALL_EXTENSIONS.map { |e| '*.' + e }.join(' ')
  end
end

QML.run do |app|
  app.load_path Pathname(__FILE__) + '../main.qml'
end
{'fraction_non_alphanumeric': 0.08100558659217877, 'fraction_numerical': 0.00186219739292365, 'mean_word_length': 3.611587982832618, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4786193', 'n_tokens_mistral': 759, 'n_tokens_neox': 705, 'n_words': 181}