Class: Autoproj::Jenkins::Credentials::Credential

Inherits:
Struct
  • Object
show all
Defined in:
lib/autoproj/jenkins/credentials.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hostObject

Returns the value of attribute host



5
6
7
# File 'lib/autoproj/jenkins/credentials.rb', line 5

def host
  @host
end

#protocolObject

Returns the value of attribute protocol



5
6
7
# File 'lib/autoproj/jenkins/credentials.rb', line 5

def protocol
  @protocol
end

#vcsObject

Returns the value of attribute vcs



5
6
7
# File 'lib/autoproj/jenkins/credentials.rb', line 5

def vcs
  @vcs
end

Instance Method Details

#jenkins_idObject

The ID of the jenkins credential



17
18
19
# File 'lib/autoproj/jenkins/credentials.rb', line 17

def jenkins_id
    "autoproj-#{vcs}-#{protocol}-#{host}"
end

#matches?(vcs) ⇒ Boolean

Whether this credential object matches the given VCS



9
10
11
12
13
14
# File 'lib/autoproj/jenkins/credentials.rb', line 9

def matches?(vcs)
    return if vcs.type.to_sym != self.vcs
    vcs_url = URI.parse(vcs.url)
    vcs_url.scheme == protocol &&
        vcs_url.host == host
end