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.
-
#asset_patterns ⇒ Object
Returns the value of attribute asset_patterns.
-
#bin_path_pattern ⇒ Object
Returns the value of attribute bin_path_pattern.
-
#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 |
#asset_patterns ⇒ Object
Returns the value of attribute asset_patterns
33 34 35 |
# File 'lib/pandoc_binary.rb', line 33 def asset_patterns @asset_patterns end |
#bin_path_pattern ⇒ Object
Returns the value of attribute bin_path_pattern
33 34 35 |
# File 'lib/pandoc_binary.rb', line 33 def bin_path_pattern @bin_path_pattern 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
#asset_name_patterns ⇒ Object
34 35 36 |
# File 'lib/pandoc_binary.rb', line 34 def asset_name_patterns return asset_patterns || [name] end |
#fetch_executable(asset:) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/pandoc_binary.rb', line 38 def fetch_executable(asset:) Open3.pipeline_r( [*%w[curl --silent --location], asset.browser_download_url], [*%w[bsdtar --to-stdout -xf -], bin_path_pattern], ) 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 |