Class: MatrixCi::CircleCi

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

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ CircleCi

Returns a new instance of CircleCi.



22
23
24
# File 'lib/adapters/circleci.rb', line 22

def initialize(token)
  @token = token
end

Instance Method Details

#all_recent_buildsObject



14
15
16
17
18
19
20
# File 'lib/adapters/circleci.rb', line 14

def all_recent_builds
  result = open("https://circleci.com/api/v1/recent-builds?circle-token=#{@token}").read
  builds = JSON.parse(result)
  builds.map do |build|
    Build.new(id: build["build_num"], branch: build["branch"], committer: build["committer_name"],started: build["start_time"],ended: build["stop_time"], outcome: build["outcome"], ref: build["vcs_revision"], subject: build["subject"], projectname: build["vcs_url"].split("/").last)
  end
end

#recent_build_for(project_name, username) ⇒ Object



10
11
12
# File 'lib/adapters/circleci.rb', line 10

def recent_build_for(project_name, username)
  result = open("https://circleci.com/api/v1/project/#{username}/#{project_name}?circle-token=#{@token}").read
end

#user_infoObject



7
8
# File 'lib/adapters/circleci.rb', line 7

def 
end