Module: XMLTV

Defined in:
lib/xmltv/xmltv.rb,
lib/xmltv/sites/upc.rb,
lib/xmltv/sites/vpro.rb,
lib/xmltv/sites/film1.rb,
lib/xmltv/sites/tvgids.rb,
lib/xmltv/sites/trivial.rb,
lib/xmltv/sites/tvtoday.rb

Defined Under Namespace

Classes: BadChannelError, BadSiteError, DateError, Film1Grabber, Grabber, Progdata, TrivialGrabber, TvgidsGrabber, TvtodayGrabber, UpcGrabber, ValidateError, VproGrabber, XmlWriter, XmltvOptparser

Constant Summary collapse

VERSION =
'0.8.7'
Progdir =
($LOAD_PATH.find {|x| test(?f, "#{x}/xmltv/xmltv.rb")} || 'lib') + '/xmltv/sites'
Sites =
Dir["#{Progdir}/*.rb"].map{|x| x[0..-4]}.map{|x| File.basename(x)}
XmltvOptions =
XmltvOptparser.parse(ARGV)

Class Method Summary collapse

Class Method Details

.goObject



737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
# File 'lib/xmltv/xmltv.rb', line 737

def go
  if XmltvOptions.add || XmltvOptions.del || XmltvOptions.config
    STDERR.puts "You must specify a site to configure channels"
    exit
  end
  configs = Dir["#{XmltvOptions.basedir}/*"].select{|x| File::Stat.new(x).directory? }.map{|x| File.basename(x)}
  if configs.empty?
    STDERR.puts "No configs found in #{XmltvOptions.basedir}"
  end
  todo = configs & Sites
  exit if todo.empty?
  todo.sort.each do |grabber|
#    puts grabber
    begin
      require "xmltv/sites/#{grabber}"
    rescue SystemExit => exc
      raise unless exc.success?
    rescue XMLTV::BadSiteError
    end
  end
end