25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
# File 'lib/senju/command.rb', line 25
def exec(repo, command, option)
puts "================= #{repo.name} ====================".colorize(:green).bold
if command.to_i != 0
issue = repo.issue(command.to_i)
print_issue issue
puts "Opened by #{issue.owner} at #{issue.created_at}"
puts "\n" + Rumoji.decode(TTY::Markdown.parse(issue.body))
if option == "-v" || option == "comments"
repo.(command.to_i).each do ||
puts "\nComment: #{.owner} at #{.created_at}".bold
puts Rumoji.decode(TTY::Markdown.parse(.body))
end
elsif option == "diff"
repo.changes(command.to_i).each do |change|
puts "\n#{change.filename}".bold
puts Senju::Diff.print(change.patch)
end
end
return
end
case command
when "issues"
repo.issues.each do |issue|
print_issue(issue)
end
when "mr"
command = option
option = ARGV[3]
issue = repo.pull_request(command.to_i)
print_issue issue
puts "Opened by #{issue.owner} at #{issue.created_at}"
puts "\n" + Rumoji.decode(TTY::Markdown.parse(issue.body))
if option == "-v" || option == "comments"
repo.(command.to_i).each do ||
puts "\nComment: #{.owner} at #{.created_at}".bold
puts Rumoji.decode(TTY::Markdown.parse(.body))
end
elsif option == "diff"
repo.changes(command.to_i).each do |change|
puts "\n#{change.filename}".bold
puts Senju::Diff.print(change.patch)
end
end
when "pr"
repo.pull_requests.each do |issue|
print_issue(issue)
end
end
end
|