Class: YtDlp::Runner
Overview
Utility class for running and managing yt-dlp
Direct Known Subclasses
Instance Attribute Summary collapse
-
#executable ⇒ String
Executable name to use.
-
#executable_path ⇒ String
readonly
Returns usable executable path for yt-dlp.
-
#options ⇒ YtDlp::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
Instance Attribute Details
#executable ⇒ String
Returns Executable name to use.
18 19 20 |
# File 'lib/yt-dlp/runner.rb', line 18 def executable @executable end |
#executable_path ⇒ String (readonly)
Returns usable executable path for yt-dlp
15 16 17 |
# File 'lib/yt-dlp/runner.rb', line 15 def executable_path @executable_path end |
#options ⇒ YtDlp::Options
Returns Options access.
12 13 14 |
# File 'lib/yt-dlp/runner.rb', line 12 def @options end |
#url ⇒ String
Returns URL to download.
9 10 11 |
# File 'lib/yt-dlp/runner.rb', line 9 def url @url end |
Instance Method Details
#backend_runner ⇒ CommandLineRunner
Returns Terrapin’s runner engine
40 41 42 |
# File 'lib/yt-dlp/runner.rb', line 40 def backend_runner Terrapin::CommandLine.runner end |
#backend_runner=(terrapin_runner) ⇒ Object
Sets Terrapin’s runner engine
48 49 50 |
# File 'lib/yt-dlp/runner.rb', line 48 def backend_runner=(terrapin_runner) Terrapin::CommandLine.runner = terrapin_runner end |
#configure(*a, &b) {|config| ... } ⇒ Object
Options configuration. Just aliases to options.configure
74 75 76 |
# File 'lib/yt-dlp/runner.rb', line 74 def configure(*a, &b) .configure(*a, &b) end |
#run ⇒ String Also known as: download
Runs the command
63 64 65 |
# File 'lib/yt-dlp/runner.rb', line 63 def run terrapin_line().run(@options.store) end |
#to_command ⇒ String Also known as: command
Returns the command string without running anything
55 56 57 |
# File 'lib/yt-dlp/runner.rb', line 55 def to_command terrapin_line().command(@options.store) end |