fresnel 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/fresnel.gemspec +1 -1
- data/lib/fresnel.rb +10 -5
- data/lib/fresnel/lighthouse.rb +2 -0
- metadata +1 -1
data/fresnel.gemspec
CHANGED
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
|
|
3
3
|
s.name = 'fresnel'
|
4
4
|
s.summary = "Fresnel is a console manager to LighthouseApp.com using the official lighthouse api."
|
5
5
|
s.description = s.summary
|
6
|
-
s.version = '0.6.
|
6
|
+
s.version = '0.6.5'
|
7
7
|
s.date = '2010-01-10'
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Gerard de Brieder", "Wes Oldenbeuving"]
|
data/lib/fresnel.rb
CHANGED
@@ -84,6 +84,7 @@ class Fresnel
|
|
84
84
|
config = YAML.load_file(self.project_config_file) || Hash.new
|
85
85
|
unless config.has_key?('project_id') && config.has_key?('account_name')
|
86
86
|
puts Frame.new(:header=>"Warning !",:body=>"project config found but did not validate, recreating ")
|
87
|
+
SetupWizard.project(self)
|
87
88
|
return load_project_config
|
88
89
|
end
|
89
90
|
if config.has_key?('account_name')
|
@@ -152,22 +153,25 @@ class Fresnel
|
|
152
153
|
STDOUT.flush
|
153
154
|
Lighthouse.account=value['account']
|
154
155
|
Lighthouse.token=value['token']
|
155
|
-
|
156
|
+
projects=Lighthouse::Project.find(:all)
|
157
|
+
projects.each{|project|project.nr_of_open_tickets_assigned_to_me=Lighthouse::Ticket.find(:all, :params=>{:project_id=>project.id, :q=>'responsible:me state:open'}).size}
|
158
|
+
projects_data[Lighthouse.account]=projects
|
156
159
|
end
|
157
160
|
puts " [done]"
|
158
161
|
else
|
159
162
|
print "Fetching projects..." unless options[:object]
|
160
163
|
#projects_data=cache.load(:name=>"fresnel_projects"){Lighthouse::Project.find(:all)} #no cache for now
|
161
|
-
|
164
|
+
projects=Lighthouse::Project.find(:all)
|
165
|
+
projects.each{|project|project.nr_of_open_tickets_assigned_to_me=Lighthouse::Ticket.find(:all, :params=>{:project_id=>project.id, :q=>'responsible:me state:open'}).size}
|
166
|
+
projects_data[Lighthouse.account]=projects
|
162
167
|
puts " [done]"
|
163
168
|
end
|
164
|
-
|
165
169
|
#puts " [done] - data is #{projects_data.age}s old , max is #{@@cache_timeout}s" #no cache for now
|
166
170
|
project_table = table do |t|
|
167
171
|
t.headings=[]
|
168
172
|
t.headings << '#' if options[:selectable]
|
169
173
|
t.headings += ["account"] if @@accounts.size>1
|
170
|
-
t.headings += [ 'project name', 'public', 'open tickets']
|
174
|
+
t.headings += [ 'project name', 'public', 'open tickets', 'assigned to you']
|
171
175
|
i=0
|
172
176
|
projects_data.each do |key,value|
|
173
177
|
value.each do |project|
|
@@ -175,7 +179,7 @@ class Fresnel
|
|
175
179
|
row << i if options[:selectable]
|
176
180
|
project_ids<<"#{project.id};#{key}"
|
177
181
|
row+=[key] if @@accounts.size>1
|
178
|
-
row+=[project.name, project.public, {:value=>project.open_tickets_count, :alignment=>:right}]
|
182
|
+
row+=[project.name, project.public, {:value=>project.open_tickets_count, :alignment=>:right}, {:value=>project.nr_of_open_tickets_assigned_to_me, :alignment=>:right}]
|
179
183
|
t << row
|
180
184
|
i+=1
|
181
185
|
end
|
@@ -322,6 +326,7 @@ class Fresnel
|
|
322
326
|
end
|
323
327
|
|
324
328
|
def get_tickets_in_bin(bin)
|
329
|
+
self.bin=bin.to_i
|
325
330
|
bins=cache.load(:name=>"fresnel_project_#{self.current_project_id}_bins",:action=>"Lighthouse::Project.find(#{self.current_project_id}).bins")
|
326
331
|
bins.reject!{|b|true unless b.user_id==self.current_user_id || b.shared}
|
327
332
|
data=bins[bin.to_i].tickets
|
data/lib/fresnel/lighthouse.rb
CHANGED