Class: Lazibi::Runner

Inherits:
Object
  • Object
show all
Includes:
Task
Defined in:
lib/lazibi.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Task

#get_metas, #init_meta, #load_config, #make_py, #update_rb

Methods included from Helper::TaskHelper

#convert_path, #get_filters, #original_path, #sep_line, #skip_path?, #sort_filter

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



10
11
12
# File 'lib/lazibi.rb', line 10

def config
  @config
end

Instance Method Details

#runObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/lazibi.rb', line 12

def run
  puts '-' * 40
  load_config
  init_meta
  @metas = {}
  while true
    current_metas = get_metas
    current_metas.each_pair do |meta, m_time|
      if @metas[meta] != m_time
        update_rb meta
        puts "+ #{meta}..."
      end
    end
    @metas = current_metas
    sleep 1
  end
end