Class: Enola::Channel
- Inherits:
-
Struct
- Object
- Struct
- Enola::Channel
- Defined in:
- lib/enola/channel.rb
Constant Summary collapse
- UPSTREAM =
Channel.new( name: "upstream", release_base: "https://github.com/enola-labs/enola/releases/download", version: UPSTREAM_VERSION, asset_prefix: "enola" ).freeze
Instance Attribute Summary collapse
-
#asset_prefix ⇒ Object
Returns the value of attribute asset_prefix.
-
#name ⇒ Object
Returns the value of attribute name.
-
#release_base ⇒ Object
Returns the value of attribute release_base.
-
#tag_prefix ⇒ Object
Returns the value of attribute tag_prefix.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #asset(platform) ⇒ Object
- #cache_dir(root) ⇒ Object
- #checksum_asset(platform) ⇒ Object
- #tag ⇒ Object
- #to_s ⇒ Object
- #url(file) ⇒ Object
Instance Attribute Details
#asset_prefix ⇒ Object
Returns the value of attribute asset_prefix
4 5 6 |
# File 'lib/enola/channel.rb', line 4 def asset_prefix @asset_prefix end |
#name ⇒ Object
Returns the value of attribute name
4 5 6 |
# File 'lib/enola/channel.rb', line 4 def name @name end |
#release_base ⇒ Object
Returns the value of attribute release_base
4 5 6 |
# File 'lib/enola/channel.rb', line 4 def release_base @release_base end |
#tag_prefix ⇒ Object
Returns the value of attribute tag_prefix
4 5 6 |
# File 'lib/enola/channel.rb', line 4 def tag_prefix @tag_prefix end |
#version ⇒ Object
Returns the value of attribute version
4 5 6 |
# File 'lib/enola/channel.rb', line 4 def version @version end |
Instance Method Details
#asset(platform) ⇒ Object
5 6 7 |
# File 'lib/enola/channel.rb', line 5 def asset(platform) "#{asset_prefix}-#{version}-#{platform}.tar.gz" end |
#cache_dir(root) ⇒ Object
21 22 23 |
# File 'lib/enola/channel.rb', line 21 def cache_dir(root) File.join(root, name, version) end |
#checksum_asset(platform) ⇒ Object
9 10 11 |
# File 'lib/enola/channel.rb', line 9 def checksum_asset(platform) "#{asset_prefix}-#{version}-#{platform}.sha256" end |
#tag ⇒ Object
13 14 15 |
# File 'lib/enola/channel.rb', line 13 def tag "#{tag_prefix || 'v'}#{version}" end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/enola/channel.rb', line 25 def to_s "#{name} #{version}" end |
#url(file) ⇒ Object
17 18 19 |
# File 'lib/enola/channel.rb', line 17 def url(file) "#{release_base.chomp('/')}/#{tag}/#{file}" end |