class Status::Base

Attributes

qa_status[R]

Public Class Methods

new(options) click to toggle source
# File lib/status/base.rb, line 9
def initialize(options)
  @qa_status = options[:state] || qa_required
  @branch = options[:branch] || branch
  @sha = options[:sha] || nil
  @statuses = Status::Github::Statuses.new(@qa_status, @branch, @sha)
end

Public Instance Methods

branch() click to toggle source
# File lib/status/base.rb, line 16
def branch
  `git rev-parse --abbrev-ref HEAD`.chomp
end
qa_required() click to toggle source
# File lib/status/base.rb, line 28
def qa_required
  Status.qa_required? ? "pending" : "pass"
end
update() click to toggle source
# File lib/status/base.rb, line 20
def update
  puts "Updating..."
  pull = Status::Github::PullRequest.new(@branch)
  pull.create_pull_request unless pull.pull_request_found?
  @statuses.request
  puts "Done."
end