Class: Spade::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/spade/repository.rb

Direct Known Subclasses

Local, Remote

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRepository

Returns a new instance of Repository.



5
6
7
8
# File 'lib/spade/repository.rb', line 5

def initialize
  self.env   = Environment.new
  self.creds = Credentials.new(@env)
end

Instance Attribute Details

#credsObject

Returns the value of attribute creds.



3
4
5
# File 'lib/spade/repository.rb', line 3

def creds
  @creds
end

#envObject

Returns the value of attribute env.



3
4
5
# File 'lib/spade/repository.rb', line 3

def env
  @env
end

Instance Method Details

#dependency_for(packages) ⇒ Object



14
15
16
# File 'lib/spade/repository.rb', line 14

def dependency_for(packages)
  Gem::Dependency.new(/(#{packages.join('|')})/, Gem::Requirement.default)
end

#logged_in?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/spade/repository.rb', line 10

def logged_in?
  !self.creds.api_key.nil?
end