Class: RbYoutubeDL::Runner
- Inherits:
-
Object
- Object
- RbYoutubeDL::Runner
- Includes:
- Support
- Defined in:
- lib/rb-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 ⇒ RbYoutubeDL::Options
Options access.
-
#url ⇒ String
URL to download.
Instance Method Summary collapse
-
#backend_runner ⇒ CommandLineRunner
Returns Terrapin’s runner engine.
-
#backend_runner=(terrapin_runner) ⇒ Object
Sets Terrapin’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
#quoted, #terrapin_line, #usable_executable_path_for, #which
Constructor Details
#initialize(url, options = {}) ⇒ Runner
Command Line runner initializer
22 23 24 25 26 |
# File 'lib/rb-youtube-dl/runner.rb', line 22 def initialize(url, = {}) @url = url @options = RbYoutubeDL::Options.new() @executable = 'youtube-dl' end |
Instance Attribute Details
#executable ⇒ String
Returns Executable name to use.
16 17 18 |
# File 'lib/rb-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/rb-youtube-dl/runner.rb', line 13 def executable_path @executable_path end |
#options ⇒ RbYoutubeDL::Options
Returns Options access.
10 11 12 |
# File 'lib/rb-youtube-dl/runner.rb', line 10 def @options end |
#url ⇒ String
Returns URL to download.
7 8 9 |
# File 'lib/rb-youtube-dl/runner.rb', line 7 def url @url end |
Instance Method Details
#backend_runner ⇒ CommandLineRunner
Returns Terrapin’s runner engine
38 39 40 |
# File 'lib/rb-youtube-dl/runner.rb', line 38 def backend_runner Terrapin::CommandLine.runner end |
#backend_runner=(terrapin_runner) ⇒ Object
Sets Terrapin’s runner engine
46 47 48 |
# File 'lib/rb-youtube-dl/runner.rb', line 46 def backend_runner=(terrapin_runner) Terrapin::CommandLine.runner = terrapin_runner end |
#configure(*a, &b) {|config| ... } ⇒ Object
Options configuration. Just aliases to options.configure
72 73 74 |
# File 'lib/rb-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/rb-youtube-dl/runner.rb', line 61 def run terrapin_line().run(@options.store) end |
#to_command ⇒ String Also known as: command
Returns the command string without running anything
53 54 55 |
# File 'lib/rb-youtube-dl/runner.rb', line 53 def to_command terrapin_line().command(@options.store) end |