Skip to content

Commit

Permalink
Merge pull request #41 from masutaka/status-closed
Browse files Browse the repository at this point in the history
Add status `**closed!**`
  • Loading branch information
masutaka committed Mar 22, 2016
2 parents 45ff7a7 + f947143 commit 4e1aa55
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/github/nippou/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ class Commands < Thor
def list
nippous.each do |url, detail|
line = "* [#{detail[:title]} - #{detail[:repo_basename]}](#{url}) by #{detail[:username]}"
line << ' **merged!**' if detail[:merged]
if detail[:merged]
line << ' **merged!**'
elsif detail[:state] == 'closed'
line << ' **closed!**'
end
puts line
end
end
Expand Down Expand Up @@ -103,13 +107,15 @@ def access_token
def hash_for_issue(repo, issue)
title = issue.title.markdown_escape
merged = client.pull_merged?(repo.name, issue.number)
{title: title, repo_basename: repo.name, username: issue.user.login, merged: merged}
state = client.issue(repo.name, issue.number).state
{title: title, repo_basename: repo.name, username: issue.user.login, merged: merged, state: state}
end

def hash_for_pr(repo, pr)
title = pr.title.markdown_escape
merged = client.pull_merged?(repo.name, pr.number)
{title: title, repo_basename: repo.name, username: pr.user.login, merged: merged}
state = client.pull_request(repo.name, pr.number).state
{title: title, repo_basename: repo.name, username: pr.user.login, merged: merged, state: state}
end
end
end
Expand Down

0 comments on commit 4e1aa55

Please sign in to comment.