Class: HBQueue
- Inherits:
-
YAMLConfig
- Object
- YAMLConfig
- HBQueue
- Defined in:
- lib/hb-runner/hb_queue.rb
Overview
This class processes a yaml file queue of items with handbrake, using the given HBConfig configuration
Instance Attribute Summary collapse
-
#queue ⇒ Object
Returns the value of attribute queue.
Attributes inherited from YAMLConfig
Instance Method Summary collapse
Methods inherited from YAMLConfig
Constructor Details
This class inherits a constructor from YAMLConfig
Instance Attribute Details
#queue ⇒ Object
Returns the value of attribute queue.
5 6 7 |
# File 'lib/hb-runner/hb_queue.rb', line 5 def queue @queue end |
Instance Method Details
#executable ⇒ Object
7 8 9 |
# File 'lib/hb-runner/hb_queue.rb', line 7 def executable 'HandBrakeCLI' end |
#read ⇒ Object
11 12 13 14 |
# File 'lib/hb-runner/hb_queue.rb', line 11 def read @queue ||= open(filename) { |f| YAML.load f } puts "#{queue.size} item(s) in the queue." end |
#run ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/hb-runner/hb_queue.rb', line 16 def run queue.each do |q| markers = q.delete 'markers' q['input'] = File. q['input'] if q['input'] q['output'] = File. q['output'] if q['output'] = q.map { |k,v| "--#{k} #{v.inspect}" }.join(' ').gsub('true', '') if markers and markers == true += ' --markers' elsif markers += " --markers=#{ markers }" end execute "#{ executable } #{ } #{ @options }" end end |