class MultimediaParadise::Video::ReportMissingVideosInTheYamlFile

Constants

MAX_ENTRY
#

MAX_ENTRY

#
NAMESPACE
#

NAMESPACE

#

Public Class Methods

new( i = ARGV, run_already = true ) click to toggle source
#

initialize

#
# File lib/multimedia_paradise/video/report_missing_videos_in_the_yaml_file.rb, line 35
def initialize(
    i           = ARGV,
    run_already = true
  )
  reset
  run if run_already
end

Public Instance Methods

reset() click to toggle source
#

reset

#
Calls superclass method MultimediaParadise::Base#reset
# File lib/multimedia_paradise/video/report_missing_videos_in_the_yaml_file.rb, line 46
def reset
  super()
  # ======================================================================= #
  # === @namespace
  # ======================================================================= #
  @namespace = NAMESPACE
  # ======================================================================= #
  # === @dataset
  # ======================================================================= #
  @dataset = dataset_from_file_video_collection
  # ======================================================================= #
  # === @max_entry
  # ======================================================================= #
  @max_entry = @dataset.keys.size
  # ======================================================================= #
  # === @all_is_fine
  #
  # Of this variable is true then all is fine - no video is missing.
  # ======================================================================= #
  @all_is_fine = true
end
run() click to toggle source
#

run

#
# File lib/multimedia_paradise/video/report_missing_videos_in_the_yaml_file.rb, line 71
def run
  1.upto(@max_entry).each {|this_number|
    if @dataset.has_key? this_number
      # =================================================================== #
      # all is fine in this case.
      # =================================================================== #
    else
      # =================================================================== #
      # else it must be missing
      # =================================================================== #
      e steelblue(this_number.to_s)+
        slateblue(': vakant')
      @all_is_fine = false
    end
  }
  if @all_is_fine
    e rev+
      'Everything is fine - no video is missing in the file '+
      sfile('video_collection.yml')+'. \o/'
  end
end