Class: YoutubeDL::Runner
- Inherits:
-
Object
- Object
- YoutubeDL::Runner
- Includes:
- Support
- Defined in:
- lib/youtube-dl/runner.rb
Overview
Utility class for running and managing youtube-dl
Direct Known Subclasses
Instance Attribute Summary collapse
-
#executable ⇒ String
Executable name to use.
-
#executable_path ⇒ String
readonly
Returns usable executable path for youtube-dl.
-
#options ⇒ YoutubeDL::Options
Options access.
-
#url ⇒ String
URL to download.
Instance Method Summary collapse
-
#backend_runner ⇒ CommandLineRunner
Returns Cocaine’s runner engine.
-
#backend_runner=(cocaine_runner) ⇒ Object
Sets Cocaine’s runner engine.
-
#configure(*a, &b) {|config| ... } ⇒ Object
Options configuration.
-
#initialize(url, options = {}) ⇒ Runner
constructor
Command Line runner initializer.
-
#run ⇒ String
(also: #download)
Runs the command.
-
#to_command ⇒ String
(also: #command)
Returns the command string without running anything.
Methods included from Support
#cocaine_line, #quoted, #usable_executable_path_for, #which
Constructor Details
Instance Attribute Details
#executable ⇒ String
Returns Executable name to use.
16 17 18 |
# File 'lib/youtube-dl/runner.rb', line 16 def executable @executable end |
#executable_path ⇒ String (readonly)
Returns usable executable path for youtube-dl
13 14 15 |
# File 'lib/youtube-dl/runner.rb', line 13 def executable_path @executable_path end |
#options ⇒ YoutubeDL::Options
Returns Options access.
10 11 12 |
# File 'lib/youtube-dl/runner.rb', line 10 def @options end |
#url ⇒ String
Returns URL to download.
7 8 9 |
# File 'lib/youtube-dl/runner.rb', line 7 def url @url end |
Instance Method Details
#backend_runner ⇒ CommandLineRunner
Returns Cocaine’s runner engine
38 39 40 |
# File 'lib/youtube-dl/runner.rb', line 38 def backend_runner Cocaine::CommandLine.runner end |
#backend_runner=(cocaine_runner) ⇒ Object
Sets Cocaine’s runner engine
46 47 48 |
# File 'lib/youtube-dl/runner.rb', line 46 def backend_runner=(cocaine_runner) Cocaine::CommandLine.runner = cocaine_runner end |
#configure(*a, &b) {|config| ... } ⇒ Object
Options configuration. Just aliases to options.configure
72 73 74 |
# File 'lib/youtube-dl/runner.rb', line 72 def configure(*a, &b) .configure(*a, &b) end |
#run ⇒ String Also known as: download
Runs the command
61 62 63 |
# File 'lib/youtube-dl/runner.rb', line 61 def run cocaine_line().run(@options.store) end |
#to_command ⇒ String Also known as: command
Returns the command string without running anything
53 54 55 |
# File 'lib/youtube-dl/runner.rb', line 53 def to_command cocaine_line().command(@options.store) end |