Skip to content

Commit 2c93709

Browse files
committed
output project name for worktime
1 parent 89ffe55 commit 2c93709

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/redmine_cli/tasks/time.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def out
2727
def current
2828
if worktime = Worktime.current
2929
if worktime.issue?
30-
puts "Signed in for ##{worktime.issue_id}: #{worktime.issue_subject}."
30+
puts "Signed in for #{worktime.project_name} - ##{worktime.issue_id}: #{worktime.issue_subject}."
3131
else
32-
puts "Signed in."
32+
puts "Signed in for #{worktime.project_name}."
3333
end
3434
else
3535
puts "Not signed in."

lib/redmine_cli/worktime.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
module RedmineCLI
22
class Worktime
3-
attr_reader :issue_id, :issue_subject
3+
attr_reader :issue_id, :issue_subject, :project_name
44

55
def initialize(attributes)
6+
@project_name = attributes['project']['name']
7+
@project_identifier = attributes['project']['identifier']
8+
69
if attributes['issue']
710
@issue_id = attributes['issue']['id']
811
@issue_subject = attributes['issue']['subject']

0 commit comments

Comments
 (0)