Class: Torba::RemoteSources::GithubRelease

Inherits:
Zip
  • Object
show all
Defined in:
lib/torba/remote_sources/github_release.rb

Overview

Represents / Github release.

Since:

  • 0.1.0

Instance Attribute Summary collapse

Attributes inherited from Zip

#digest, #url

Instance Method Summary collapse

Methods included from Common

#[], #digest

Constructor Details

#initialize(source, tag) ⇒ GithubRelease

Returns a new instance of GithubRelease.

Parameters:

Since:

  • 0.1.0



29
30
31
32
33
34
35
# File 'lib/torba/remote_sources/github_release.rb', line 29

def initialize(source, tag)
  @source = source
  @tag = tag
  @repository_user, @repository_name = source.split("/")
  super("https://github.com/#{source}/archive/#{tag}.zip")
  @digest = "#{repository_name}-#{Torba.digest(url)}"
end

Instance Attribute Details

#repository_nameString (readonly)

Returns:

  • (String)

Since:

  • 0.2.0



16
17
18
# File 'lib/torba/remote_sources/github_release.rb', line 16

def repository_name
  @repository_name
end

#repository_userString (readonly)

Returns:

  • (String)

Since:

  • 0.2.0



20
21
22
# File 'lib/torba/remote_sources/github_release.rb', line 20

def repository_user
  @repository_user
end

#sourceString (readonly)

Returns repository user and name.

Examples:

"jashkenas/underscore"

Returns:

  • (String)

    repository user and name.

See Also:

Since:

  • 0.1.0



12
13
14
# File 'lib/torba/remote_sources/github_release.rb', line 12

def source
  @source
end

#tagString (readonly)

Returns repository tag.

Examples:

"v1.8.3"

Returns:

  • (String)

    repository tag.

Since:

  • 0.1.0



25
26
27
# File 'lib/torba/remote_sources/github_release.rb', line 25

def tag
  @tag
end