Class: Pluto::Updater

Inherits:
Object
  • Object
show all
Includes:
LogUtils::Logging
Defined in:
lib/pluto/updater.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts, config) ⇒ Updater

Returns a new instance of Updater.



7
8
9
10
# File 'lib/pluto/updater.rb', line 7

def initialize( opts, config )
  @opts    = opts
  @config  = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



12
13
14
# File 'lib/pluto/updater.rb', line 12

def config
  @config
end

#optsObject (readonly)

Returns the value of attribute opts.



12
13
14
# File 'lib/pluto/updater.rb', line 12

def opts
  @opts
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/pluto/updater.rb', line 14

def run
  ###################
  # step 1) update subscriptions
  subscriber = Subscriber.new

  # pass along debug/verbose setting/switch
  subscriber.debug = true    if opts.verbose?
  subscriber.update_subscriptions( config )

  ##############################
  # step 2) update feeds
  refresher = Refresher.new

  # pass along debug/verbose setting/switch
  refresher.debug = true    if opts.verbose?
  refresher.update_feeds
end