Class: Pomo::GithubTask
Instance Attribute Summary collapse
-
#labels ⇒ Object
Labels array.
-
#number ⇒ Object
Issue number.
-
#project ⇒ Object
Project name.
-
#url ⇒ Object
Absolute URI.
-
#username ⇒ Object
Username.
Attributes inherited from Task
#complete, #description, #length, #name, #running
Class Method Summary collapse
-
.import(user, project, number = nil) ⇒ Object
Import Github issue(s) with user, project, number as GithubTask(s).
Instance Method Summary collapse
-
#initialize(name = nil, options = {}) ⇒ GithubTask
constructor
Initialize with name and options.
-
#to_s ⇒ Object
Quoted github issue name and number.
-
#verbose_output(format) ⇒ Object
Output verbose task information.
Methods inherited from Task
Constructor Details
#initialize(name = nil, options = {}) ⇒ GithubTask
Initialize with name and options.
41 42 43 44 |
# File 'lib/pomo/github_task.rb', line 41 def initialize(name = nil, = {}) super .each { |k,v| send :"#{k}=", v } end |
Instance Attribute Details
#labels ⇒ Object
Labels array.
26 27 28 |
# File 'lib/pomo/github_task.rb', line 26 def labels @labels end |
#number ⇒ Object
Issue number.
31 32 33 |
# File 'lib/pomo/github_task.rb', line 31 def number @number end |
#project ⇒ Object
Project name.
21 22 23 |
# File 'lib/pomo/github_task.rb', line 21 def project @project end |
#url ⇒ Object
Absolute URI.
36 37 38 |
# File 'lib/pomo/github_task.rb', line 36 def url @url end |
#username ⇒ Object
Username.
16 17 18 |
# File 'lib/pomo/github_task.rb', line 16 def username @username end |
Class Method Details
.import(user, project, number = nil) ⇒ Object
Import Github issue(s) with user, project, number as GithubTask(s).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/pomo/github_task.rb', line 66 def self.import(user, project, number=nil) tasks = [] issues = get_issues(user, project, number) issues.each do |issue| tasks << new(issue.title, :username => user, :project => project, :description => issue.body, :labels => issue.labels.map(&:name), :number => issue.number, :url => issue.html_url ) end return tasks end |
Instance Method Details
#to_s ⇒ Object
Quoted github issue name and number.
49 50 51 |
# File 'lib/pomo/github_task.rb', line 49 def to_s "#%-3s %s" % [ number, name] end |
#verbose_output(format) ⇒ Object
Output verbose task information.
56 57 58 59 60 61 |
# File 'lib/pomo/github_task.rb', line 56 def verbose_output(format) super(format) say format % ['labels', labels.join(', ')] if labels and not labels.empty? say format % ['project', [username, project].join('/')] say format % ['url', url ] end |