class MultimediaParadise::StoreAvailableVideoFiles

Constants

STORE_INTO_THIS_FILE
#

STORE_INTO_THIS_FILE

#

Public Class Methods

[](i = '') click to toggle source
#

MultimediaParadise::StoreAvailableVideoFiles[]

#
# File lib/multimedia_paradise/video/store_available_video_files.rb, line 130
def self.[](i = '')
  new(i)
end
new( i = nil, run_already = true ) click to toggle source
#

initialize

#
# File lib/multimedia_paradise/video/store_available_video_files.rb, line 37
def initialize(
    i           = nil,
    run_already = true
  )
  reset
  set_input(i)
  run if run_already
end

Public Instance Methods

filter_select_all_videos() click to toggle source
#

filter_select_all_videos

#
# File lib/multimedia_paradise/video/store_available_video_files.rb, line 73
def filter_select_all_videos
  @all_available_videos.select! {|entry| is_video_file?(entry)}
end
gather_all_available_videos( from_this_directory = DEPOT_VIDEO ) click to toggle source
#

gather_all_available_videos

This method will collect all available video-files.

#
# File lib/multimedia_paradise/video/store_available_video_files.rb, line 82
def gather_all_available_videos(
    from_this_directory = DEPOT_VIDEO
  )
  @all_available_videos = Dir[from_this_directory+'**/**']
end
input?() click to toggle source
#

input?

#
# File lib/multimedia_paradise/video/store_available_video_files.rb, line 66
def input?
  @input
end
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method MultimediaParadise::Base#reset
# File lib/multimedia_paradise/video/store_available_video_files.rb, line 49
def reset
  super()
  infer_the_namespace
end
run() click to toggle source
#

run (run tag)

#
# File lib/multimedia_paradise/video/store_available_video_files.rb, line 121
def run
  gather_all_available_videos
  filter_select_all_videos
  store_results
end
set_input(i = '') click to toggle source
#

set_input

#
# File lib/multimedia_paradise/video/store_available_video_files.rb, line 57
def set_input(i = '')
  i = i.first if i.is_a? Array
  i = i.to_s.dup
  @input = i
end
store_results() click to toggle source
#

store_results

This method will store the results into a .md file.

#
# File lib/multimedia_paradise/video/store_available_video_files.rb, line 93
def store_results
  ensure_that_the_output_directory_exists
  # ======================================================================= #
  # We aggregate the String that has to be saved into the variable
  # what. This will also include the file-size of the video file
  # at hand.
  # ======================================================================= #
  what = @all_available_videos.map {|entry|
    "#{entry} # file size: #{File.size(entry)}"
  }
  what = what.join(N)
  into = STORE_INTO_THIS_FILE
  opnn; e "Now storing into the file at `#{sfile(into)}`."
  write_what_into(what, into)
  # ======================================================================= #
  # Also store silently for my home system:
  # ======================================================================= #
  _ = '/home/x/data/personal/video/'
  if File.directory? _
    into = _+File.basename(into)
    opnn; e "Storing into the file at `#{sfile(into)}` as well."
    write_what_into(what, into)
  end
end