Class: RedmineCLI::Subcommands::Issue
Overview
All methods for working with issues, e.g. listing, linking, updating…
Instance Method Summary
collapse
erb, message, print_object_list, print_prompt_message
Instance Method Details
#create ⇒ Object
67
68
69
70
71
72
73
74
75
|
# File 'lib/redmine_cli/subcommands/issue.rb', line 67
def create
self.class.include Helpers::Issue::Create
@issue = Models::Issue.new
set_attributes
@issue.save
puts 'Done.'
end
|
#list(id = 'current') ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'lib/redmine_cli/subcommands/issue.rb', line 16
def list(id = 'current')
fail('new config') if Config.new?
user = InputParser.parse_user(id)
puts erb('issue/list', issues: user.issues)
rescue UserNotFound
puts "User #{m(:not_found)}"
end
|
#show(id) ⇒ Object
27
28
29
30
31
32
|
# File 'lib/redmine_cli/subcommands/issue.rb', line 27
def show(id)
puts erb('issue/show', issue: Models::Issue.find(id), journals_limit: options[:limit])
rescue ActiveResource::ResourceNotFound puts m(:not_found)
end
|
#update(id) ⇒ Object
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/redmine_cli/subcommands/issue.rb', line 51
def update(id)
self.class.include Helpers::Issue::Update
issue = Models::Issue.find(id)
if update_issue(issue) puts m(issue.save ? :success : :error)
else
@errors.each { |e| puts e }
end
rescue ActiveResource::ResourceNotFound
puts m(:not_found)
end
|