module Utils

require "kaki/utils"

methods

  • Utils.imgexist?(url)
  • Utils.getfile(url, filename, max=0)
  • Utils.key_wait
  • Utils.progress_bar
  • Utils.delete_non_img(file_name)
  • Utils.delete_empty_folder(folder_name = './')
  • Utils.bell    (only Ubuntu)
  • Utils.factorial(n)
  • Utils.permutation(a, b)
  • Utils.combination(a, b)
  • Utils.repeated_permutation(a, b)
  • Utils.repeated_combination(a, b)
  • Utils.generate_random_strings(num, string_length = nil)

Recurring decimal

require "kaki/utils/rec_decimal"

methods

  • Rational#to_rec_decimal
  • String#to_r

image suffix

require "kaki/utils/imgsuffix"

method

  • String#imgsuffix

n times retry

require "kaki/utils/retry"

method

  • Integer#times_retry(message: true, wait: 0)

check overlapping of file names

require "kaki/utils/check_fname_overlapping"

method

  • File.check_fname_overlapping(file_name)

nest loop (like Enumerable#map)

require "kaki/utils/nest_loop"

method

  • Array#nest_loop

add several methods in a module to a class

require "kaki/utils/add_methods"

methods

  • Object#add_methods(module_to_include, *method_names)
  • Module#register_all_methods