Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 38 lines (30 sloc) 0.997 kb
e4fd866 Add tasks:current rake task
Evan Phoenix authored
1 class Ticket
2
3 def self.user(id)
4 @users ||= Hash.new do |h,k|
5 str = %Q!curl -s -H 'X-LighthouseToken: c2d8226589bdc2e23d025dc39586459ab5da0349' http://rubinius.lighthouseapp.com/users/#{k}.xml!
6 if m = %r!<name>(.*)</name>!.match(`#{str}`)
7 m[1]
8 else
9 "user#{k}"
10 end
11 end
12
13 @users[id]
14 end
15 end
16
0a9bc5a Comment tasks:current
Evan Phoenix authored
17 # Rake tasks for dealing with programming tasks
e4fd866 Add tasks:current rake task
Evan Phoenix authored
18 namespace :tasks do
19
0a9bc5a Comment tasks:current
Evan Phoenix authored
20 desc "Print out the current tasks being worked on from Lighthouse"
e4fd866 Add tasks:current rake task
Evan Phoenix authored
21 task :current do
22 require 'hpricot'
23 str = %q!curl -s -H 'X-LighthouseToken: c2d8226589bdc2e23d025dc39586459ab5da0349' http://rubinius.lighthouseapp.com/projects/5089/tickets.xml\?q="tagged:current"!
24
25 h = Hpricot.parse(`#{str}`)
26
a75d318 @wilson tasks:current now handles multiple users with current tickets
wilson authored
27 (h / 'ticket').each do |e|
28 uid = (e / 'assigned-user-id').text.to_i
29 user = Ticket.user(uid)
e4fd866 Add tasks:current rake task
Evan Phoenix authored
30 tags = (e / 'tag').text
31 title = (e / 'title').text
32
33 puts "== #{title}"
34 puts " #{user} - #{tags.split(" ").join(", ")}"
35 end
36 end
37 end
Something went wrong with that request. Please try again.