Module: ProgramTV

Defined in:
lib/program-tv.rb,
lib/program-tv/parser.rb,
lib/program-tv/writer.rb

Defined Under Namespace

Classes: Parser, Writer

Constant Summary collapse

VERSION =

"0.0.3"
SUMMARY =
"TV Channel parser"
DESCRIPTION =
"Downloads TV channel list in XML format"

Class Method Summary collapse

Class Method Details

.gem_rootObject



26
27
28
# File 'lib/program-tv.rb', line 26

def self.gem_root
  File.expand_path '../..', __FILE__
end

.run!(options = {}) ⇒ Object

Initilizes Runner which controls all the magic stuff.



18
19
20
21
22
# File 'lib/program-tv.rb', line 18

def self.run!(options = {})
  @@options = options
  data = Parser.new.run
  puts Writer.new(data).run
end

.selected_channelsObject



30
31
32
# File 'lib/program-tv.rb', line 30

def self.selected_channels
  @channels ||= YAML::load(File.open(@@options[:channel_list] || File.join(gem_root, 'channels.yml')))
end