<commit_before>
def cyber_dojo_update
  help = [
    '',
    "Use: #{me} update",
    '',
    'Updates all cyber-dojo server and language images and the cyber-dojo script file',
  ]

  if ARGV[1] == '--help'
    show help
    exit succeeded
  end

  # unknown arguments?
  args = ARGV[1..-1]
  args.each do |arg|
    STDERR.puts "FAILED: unknown argument [#{arg}]"
  end
  exit failed unless args == []

  cyber_dojo_update_server
  cyber_dojo_update_languages
  # cyber-dojo script updates itself
end

# - - - - - - - - - - - - - - - - - - - - - - - - - - -

def cyber_dojo_update_server
  # I'd like to get these image names directly from docker-compose.yml
  # but there does not seem to be a simple way to do that :-(
  service_images = %w(
    nginx
    web
    runner-stateless
    starter
    saver
    mapper
    differ<commit_msg>allow -h as well as --help to get help<commit_after>
def cyber_dojo_update
  help = [
    '',
    "Use: #{me} update",
    '',
    'Updates all cyber-dojo server and language images and the cyber-dojo script file',
  ]

  if ARGV[1] == '-h' || ARGV[1] == '--help'
    show help
    exit succeeded
  end

  # unknown arguments?
  args = ARGV[1..-1]
  args.each do |arg|
    STDERR.puts "FAILED: unknown argument [#{arg}]"
  end
  exit failed unless args == []

  cyber_dojo_update_server
  cyber_dojo_update_languages
  # cyber-dojo script updates itself
end

# - - - - - - - - - - - - - - - - - - - - - - - - - - -

def cyber_dojo_update_server
  # I'd like to get these image names directly from docker-compose.yml
  # but there does not seem to be a simple way to do that :-(
  service_images = %w(
    nginx
    web
    runner-stateless
    starter
    saver
    mapper
    differ
{'fraction_non_alphanumeric': 0.1207897793263647, 'fraction_numerical': 0.0040650406504065045, 'mean_word_length': 2.2205607476635514, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1416572', 'n_tokens_mistral': 622, 'n_tokens_neox': 610, 'n_words': 179}