Class: Popper::Action::Git

Inherits:
Base
  • Object
show all
Defined in:
lib/popper/action/git.rb

Direct Known Subclasses

Ghe

Class Method Summary collapse

Methods inherited from Base

action_name, do_action?, next_action, next_run, run

Class Method Details

.check_paramsObject



24
25
26
27
# File 'lib/popper/action/git.rb', line 24

def self.check_params
  @action_config.respond_to?(:repo) &&
  @action_config.respond_to?(:token)
end

.octkitObject



19
20
21
22
# File 'lib/popper/action/git.rb', line 19

def self.octkit
  Octokit.reset!
  Octokit::Client.new(:access_token => @action_config.token)
end

.task(mail, params = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/popper/action/git.rb', line 5

def self.task(mail, params={})
  issue_options = {}
  issue_options[:labels] = @action_config.labels if @action_config.labels

  url = octkit.create_issue(
    @action_config.repo,
    mail.subject,
    mail.utf_body,
    issue_options
  )
  params["#{action_name}_url".to_sym] = url[:html_url] if url
  params
end