Class: PandocBinary::Architecture
- Inherits:
-
Struct
- Object
- Struct
- PandocBinary::Architecture
- Defined in:
- lib/pandoc_binary.rb
Instance Attribute Summary collapse
-
#archive_suffix ⇒ Object
Returns the value of attribute archive_suffix.
-
#bin_path ⇒ Object
Returns the value of attribute bin_path.
-
#bin_suffix ⇒ Object
Returns the value of attribute bin_suffix.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#archive_suffix ⇒ Object
Returns the value of attribute archive_suffix
33 34 35 |
# File 'lib/pandoc_binary.rb', line 33 def archive_suffix @archive_suffix end |
#bin_path ⇒ Object
Returns the value of attribute bin_path
33 34 35 |
# File 'lib/pandoc_binary.rb', line 33 def bin_path @bin_path end |
#bin_suffix ⇒ Object
Returns the value of attribute bin_suffix
33 34 35 |
# File 'lib/pandoc_binary.rb', line 33 def bin_suffix @bin_suffix end |
#name ⇒ Object
Returns the value of attribute name
33 34 35 |
# File 'lib/pandoc_binary.rb', line 33 def name @name end |
Instance Method Details
#fetch_executable(version:, asset:) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/pandoc_binary.rb', line 34 def fetch_executable(version:, asset:) bin_path_in_archive = Pathname("#{PREFIX}-#{version}") / bin_path # super special case bin_path_in_archive = Pathname("pandoc-2.12/usr/bin/pandoc") if version == "2.12" && name == "linux-arm64" Open3.pipeline_r( [*%w[curl --silent --location], asset.browser_download_url], [*%w[bsdtar --to-stdout -xf -], bin_path_in_archive.to_s], ) do |stdout, wait_threads| result = yield(stdout) process_statuses = wait_threads.map(&:value) raise "Command failed with exit: statuses=#{process_statuses.inspect}" if !process_statuses.all?(&:success?) return result end end |