Sha256: 9a84cbfb4fcc08d2082300021d08ddbff914e5e757650e72639b50d8751afbab

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

#
#
# = Jeeves CLI
#
# == Listings related actions
#
# Author:: Robert Sharp
# Copyright:: Copyright (c) 2014 Robert Sharp
# License:: Open Software Licence v3.0
#
# This software is licensed for use under the Open Software Licence v. 3.0
# The terms of this licence can be found at http://www.opensource.org/licenses/osl-3.0.php
# and in the file copyright.txt. Under the terms of this licence, all derivative works
# must themselves be licensed under the Open Software Licence v. 3.0
#
# 
#
require 'optplus/nested'

class ListingCLI < Optplus::NestedParser
  
  usage "listings [update|clean]"
  
  description "manage TV listings in Jeeves PVR"
  
  def before_actions
    @jeeves_config = @_parent.jeeves_config
  end
  
  describe :update, 'update TV listings'
  help :update, 'download TV listings data and load into Jeeves'
  
  def update
    @jeeves_config[:jeeves_uri_timeout] = get_option(:timeout) if option?(:timeout)
    @jeeves_config[:update_listings] = get_option(:update_listings) if option?(:update_listings)
    Jeeves.update_listings(@jeeves_config)
  rescue Jeeves::ListingError => e
    exit_on_error "Error while updating listings #{e}"
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jeeves-pvr-0.2.0 lib/jeeves/parser/listings.rb