module PhTools

© ANB Andrew Bizyaev

Constants

FILE_TYPE_AUDIO
FILE_TYPE_IMAGE
FILE_TYPE_IMAGE_NORMAL

media type constants

FILE_TYPE_IMAGE_RAW
FILE_TYPE_VIDEO
VERSION

Public Class Methods

about() click to toggle source
# File lib/phtools.rb, line 17
  def self.about
    about = <<TEXT
phtools v#{VERSION} is a bundle of small CLI tools for arranging, renaming, tagging
of the photo and video files. Helps to keep your photo-video assets in order.
Please run phtools in a terminal via CLI commands:
    phls\t(#{Phls.about}),
    phmove\t(#{Phmove.about}),
    phbackup\t(#{Phbackup.about}),
    phrename\t(#{Phrename.about}),
    phevent\t(#{Phevent.about}),
    phfixdto\t(#{Phfixdto.about}),
    phfixfmd\t(#{Phfixfmd.about}),
    phgettags\t(#{Phgettags.about}),
    phtagset\t(#{Phtagset.about}).
For more information run these commands with -h option.
General info about phtools usage see at https://github.com/AndrewBiz/phtools.git
TEXT
    about
  end
debug() click to toggle source
# File lib/phtools/error.rb, line 12
def self.debug
  @debug
end
debug=(val) click to toggle source
# File lib/phtools/error.rb, line 8
def self.debug=(val)
  @debug = val
end
drill_down_error(e, level, prefix) click to toggle source
# File lib/phtools/error.rb, line 16
def self.drill_down_error(e, level, prefix)
  return if e.nil?
  STDERR.puts "#{prefix}: CAUSE#{level}: #{e.class} - #{e.message}"
  e.backtrace.each do |b|
    STDERR.puts "#{prefix}: CAUSE#{level} BACKTRACE: #{b}"
  end
  drill_down_error(e.cause, level + 1, prefix)
end
puts_error(msg, e = nil) click to toggle source
# File lib/phtools/error.rb, line 25
def self.puts_error(msg, e = nil)
  prefix = File.basename($PROGRAM_NAME, '.rb')
  STDERR.puts "#{prefix}: #{msg}"
  drill_down_error(e, 0, prefix) if @debug
end