Class: CiInACan::GithubBuildParser

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

Instance Method Summary collapse

Instance Method Details

#parse(content) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/ci_in_a_can/github_build_parser.rb', line 5

def parse content
  payload = extract_payload_from content
  project = extract_repo_from payload

  CiInACan::Build.new(git_ssh: "[email protected]:#{project}.git",
                      repo:    project,
                      branch:  extract_branch_from(payload),
                      sha:     extract_sha_from(payload))

end