Class: BuildBuddy::Gitter

Inherits:
Object
  • Object
show all
Includes:
Celluloid, Celluloid::Internals::Logger
Defined in:
lib/build_buddy/gitter.rb

Instance Method Summary collapse

Constructor Details

#initializeGitter

Returns a new instance of Gitter.



12
13
14
15
# File 'lib/build_buddy/gitter.rb', line 12

def initialize()
  @gh_client ||= Octokit::Client.new(:access_token => Config.github_api_token)
  info "Connected to Github"
end

Instance Method Details

#set_status(repo_full_name, repo_sha, status, description) ⇒ Object



17
18
19
20
# File 'lib/build_buddy/gitter.rb', line 17

def set_status(repo_full_name, repo_sha, status, description)
  @gh_client.create_status(
      repo_full_name, repo_sha, status.to_s, { :description => description.length > 140 ? "#{description[0..136]}..." : description})
end