Class: MatrixCi::Project

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, adapter, token) ⇒ Project

Returns a new instance of Project.



11
12
13
14
15
# File 'lib/project.rb', line 11

def initialize(name, adapter, token)
  @name = name
  @adapter = MatrixCi::Adapter[adapter].new(token)
  @token = token
end

Class Method Details

.allObject



5
6
7
8
9
# File 'lib/project.rb', line 5

def self.all
  conf = YAML.load(File.open(File.expand_path("~/.matrixci.conf")).read)

  conf.keys.map {|key| Project.new(key, conf[key]["adapter"], conf[key]["token"])}
end

Instance Method Details

#all_recent_buildsObject



17
18
19
# File 'lib/project.rb', line 17

def all_recent_builds
  projects = @adapter.all_recent_builds 
end