Class: YtDlp::Runner
- Inherits:
-
Object
- Object
- YtDlp::Runner
- Defined in:
- lib/yt_dlp/runner.rb
Overview
Wraps the execution of the yt-dlp command.
Instance Attribute Summary collapse
-
#executable_path ⇒ Object
readonly
Returns the value of attribute executable_path.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(executable_path:, url:, options: {}) ⇒ Runner
constructor
Initialize the runner.
-
#run ⇒ String
Run the executable with the specified options.
Constructor Details
#initialize(executable_path:, url:, options: {}) ⇒ Runner
Initialize the runner.
17 18 19 20 21 |
# File 'lib/yt_dlp/runner.rb', line 17 def initialize(executable_path:, url:, options: {}) @executable_path = executable_path @url = url @options = end |
Instance Attribute Details
#executable_path ⇒ Object (readonly)
Returns the value of attribute executable_path.
8 9 10 |
# File 'lib/yt_dlp/runner.rb', line 8 def executable_path @executable_path end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/yt_dlp/runner.rb', line 8 def @options end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
8 9 10 |
# File 'lib/yt_dlp/runner.rb', line 8 def url @url end |
Instance Method Details
#run ⇒ String
Run the executable with the specified options.
28 29 30 31 32 |
# File 'lib/yt_dlp/runner.rb', line 28 def run command_line.run rescue Terrapin::CommandLineError raise Errors::YtDlpError end |