Method: GitIssue::Github#add

Defined in:
lib/git_issue/github.rb

#add(options = {}) ⇒ Object



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/git_issue/github.rb', line 105

def add(options = {})
  property_names = [:title, :body, :assignee, :milestone, :labels]

  message = <<-MSG
### Write title here ###

### descriptions here ###
  MSG

  unless options[:title]
    options[:title], options[:body] = get_title_and_body_from_editor(message)
  end

  json = build_issue_json(options, property_names)
  url = to_url("repos", @repo, 'issues')

  issue = post_json(url, json, options)
  puts "created issue #{oneline_issue(issue)}"
end