backlog 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/Rakefile +3 -5
- data/app/controllers/backlogs_controller.rb +26 -22
- data/app/controllers/periods_controller.rb +7 -2
- data/app/views/layouts/mwrt002.rhtml +1 -0
- data/config/environment.rb +2 -1
- data/lib/version_from_history.rb +4 -0
- data/test/fixtures/groups_users.yml +3 -0
- data/test/fixtures/periods.yml +2 -2
- data/test/functional/backlogs_controller_test.rb +19 -2
- data/test/functional/groups_controller_test.rb +5 -4
- data/test/functional/periods_controller_test.rb +1 -1
- data/test/functional/tasks_controller_test.rb +1 -1
- data/test/functional/user_controller_test.rb +1 -1
- data/test/functional/works_controller_test.rb +1 -1
- data/test/integration/user_system_test.rb +1 -1
- data/test/unit/estimate_test.rb +1 -1
- data/test/unit/group_test.rb +1 -1
- data/test/unit/task_test.rb +1 -1
- data/test/unit/user_test.rb +1 -1
- metadata +3 -2
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -10,11 +10,9 @@ require 'rake/rdoctask'
|
|
10
10
|
require 'tasks/rails'
|
11
11
|
|
12
12
|
require 'hoe'
|
13
|
+
require 'version_from_history'
|
13
14
|
|
14
|
-
|
15
|
-
version = (/^== (\d+.\d+.\d+) .*$/.match first_history_line)[1]
|
16
|
-
|
17
|
-
Hoe.new("backlog", version) do |p|
|
15
|
+
Hoe.new("backlog", APP::VERSION) do |p|
|
18
16
|
p.rubyforge_name = "backlog"
|
19
17
|
p.summary = "Application to aid collecting, processing, organizing, reviewing and doing tasks."
|
20
18
|
p.description = p.paragraphs_of('README.txt', 0..-1).join("\n\n")
|
@@ -28,7 +26,7 @@ Hoe.new("backlog", version) do |p|
|
|
28
26
|
end
|
29
27
|
|
30
28
|
task :release_and_publish do
|
31
|
-
ENV['VERSION'] =
|
29
|
+
ENV['VERSION'] = APP::VERSION
|
32
30
|
Rake::Task[:release].invoke
|
33
31
|
Rake::Task[:publish_docs].invoke
|
34
32
|
Rake::Task[:post_news].invoke
|
@@ -3,16 +3,20 @@ class BacklogsController < ApplicationController
|
|
3
3
|
|
4
4
|
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
|
5
5
|
verify :method => :post, :only => [ :destroy, :create, :update ],
|
6
|
-
|
7
|
-
|
6
|
+
:redirect_to => { :action => :index }
|
7
|
+
|
8
8
|
def index
|
9
9
|
if Task.find_started(user).size > 0
|
10
10
|
redirect_to :controller => 'tasks', :action => :list_started
|
11
11
|
return
|
12
12
|
end
|
13
|
+
if Backlog.count == 0
|
14
|
+
redirect_to :action => :new
|
15
|
+
return
|
16
|
+
end
|
13
17
|
redirect_to :controller => 'periods', :action => :index
|
14
18
|
end
|
15
|
-
|
19
|
+
|
16
20
|
def show
|
17
21
|
if params[:id]
|
18
22
|
@backlog = Backlog.find(params[:id])
|
@@ -31,11 +35,11 @@ class BacklogsController < ApplicationController
|
|
31
35
|
end
|
32
36
|
redirect_to :controller => 'periods', :action => :show, :id => @period
|
33
37
|
end
|
34
|
-
|
38
|
+
|
35
39
|
def new
|
36
40
|
@backlog = Backlog.new
|
37
41
|
end
|
38
|
-
|
42
|
+
|
39
43
|
def create
|
40
44
|
@backlog = Backlog.new(params[:backlog])
|
41
45
|
if @backlog.save
|
@@ -45,7 +49,7 @@ class BacklogsController < ApplicationController
|
|
45
49
|
render :action => 'new'
|
46
50
|
end
|
47
51
|
end
|
48
|
-
|
52
|
+
|
49
53
|
def edit
|
50
54
|
@backlog = Backlog.find(params[:id])
|
51
55
|
unplanned_tasks = @backlog.tasks.select {|t| t.period.nil? && t.finished_at.nil?}.sort_by {|t| t.position}
|
@@ -59,12 +63,12 @@ class BacklogsController < ApplicationController
|
|
59
63
|
@tasks = planned_tasks + unplanned_tasks
|
60
64
|
@completed_tasks = @backlog.tasks.select {|t| t.finished_at}.sort {|t1, t2| t1.finished_at <=> t2.finished_at}
|
61
65
|
end
|
62
|
-
|
66
|
+
|
63
67
|
def edit_no_layout
|
64
68
|
edit
|
65
69
|
render :partial => 'tasks'
|
66
70
|
end
|
67
|
-
|
71
|
+
|
68
72
|
def update
|
69
73
|
@backlog = Backlog.find(params[:id])
|
70
74
|
if @backlog.update_attributes(params[:backlog])
|
@@ -74,7 +78,7 @@ class BacklogsController < ApplicationController
|
|
74
78
|
render :action => 'edit'
|
75
79
|
end
|
76
80
|
end
|
77
|
-
|
81
|
+
|
78
82
|
def destroy
|
79
83
|
Backlog.find(params[:id]).destroy
|
80
84
|
flash[:notice] = 'Backlog was successfully deleted.'
|
@@ -99,34 +103,34 @@ class BacklogsController < ApplicationController
|
|
99
103
|
g.font = '/usr/share/fonts/bitstream-vera/Vera.ttf'
|
100
104
|
g.hide_dots = true
|
101
105
|
g.colors = %w{blue green}
|
102
|
-
|
106
|
+
|
103
107
|
dates = []
|
104
108
|
backlog.periods.first.start_on.upto(backlog.periods.last.end_on) {|date| dates << date}
|
105
109
|
|
106
110
|
g.data(l(:todo), get_todo_data(dates, backlog))
|
107
111
|
g.data(l(:done), get_work_data(dates, backlog))
|
108
112
|
g.minimum_value = 0
|
109
|
-
|
113
|
+
|
110
114
|
labels = {0 => dates.first.to_s, dates.length-1 => dates.last.to_s}
|
111
115
|
labels.merge({dates.index(Date.today) => Date.today.to_s}) if (dates.index(Date.today).to_f / dates.length) > 0.15
|
112
116
|
g.labels = labels
|
113
|
-
|
117
|
+
|
114
118
|
send_data(g.to_blob,
|
115
|
-
|
116
|
-
|
117
|
-
|
119
|
+
:disposition => 'inline',
|
120
|
+
:type => 'image/png',
|
121
|
+
:filename => "burn_down_chart.png")
|
118
122
|
end
|
119
|
-
|
120
|
-
|
123
|
+
|
124
|
+
def get_todo_data(dates, backlog)
|
121
125
|
dates.map do |date|
|
122
126
|
backlog.get_estimate_data(date)
|
123
127
|
end
|
124
|
-
|
125
|
-
|
126
|
-
|
128
|
+
end
|
129
|
+
|
130
|
+
def get_work_data(dates, backlog)
|
127
131
|
dates.map do |date|
|
128
132
|
backlog.get_work_data(date)
|
129
133
|
end
|
130
|
-
|
131
|
-
|
134
|
+
end
|
135
|
+
|
132
136
|
end
|
@@ -3,8 +3,13 @@ class PeriodsController < ApplicationController
|
|
3
3
|
skip_before_filter :authenticate_user, :only => [:burn_down_chart, :burn_down_chart_thumbnail, :burn_down_chart_large]
|
4
4
|
|
5
5
|
def index
|
6
|
-
|
7
|
-
|
6
|
+
active_periods = Period.find(:all).select {|period| period.active?(true)}
|
7
|
+
my_active_periods = active_periods.select {|period| period.party.includes?(current_user)}
|
8
|
+
unless my_active_periods.empty?
|
9
|
+
most_urgent_period = my_active_periods.sort_by {|p| p.required_speed}.last
|
10
|
+
else
|
11
|
+
most_urgent_period = active_periods.sort_by {|p| p.required_speed}.last
|
12
|
+
end
|
8
13
|
redirect_to :action => 'show', :id => most_urgent_period
|
9
14
|
end
|
10
15
|
|
data/config/environment.rb
CHANGED
@@ -58,8 +58,9 @@ Localization::load_localized_strings
|
|
58
58
|
require 'rubygems'
|
59
59
|
require 'gruff'
|
60
60
|
|
61
|
-
#Mime::Type.register "image/svg", :svg
|
62
61
|
require 'environments/user_environment'
|
63
62
|
require 'array_helper'
|
64
63
|
require 'big_decimal_yaml_fix'
|
65
64
|
require 'class_table_inheritance'
|
65
|
+
|
66
|
+
require 'version_from_history'
|
data/test/fixtures/periods.yml
CHANGED
@@ -5,7 +5,7 @@ require 'backlogs_controller'
|
|
5
5
|
class BacklogsController; def rescue_action(e) raise e end; end
|
6
6
|
|
7
7
|
class BacklogsControllerTest < Test::Unit::TestCase
|
8
|
-
fixtures :parties, :users, :groups, :backlogs, :periods, :tasks, :works, :estimates
|
8
|
+
fixtures :parties, :users, :groups, :groups_users, :backlogs, :periods, :tasks, :works, :estimates
|
9
9
|
|
10
10
|
def setup
|
11
11
|
@user_controller = UserController.new
|
@@ -15,7 +15,24 @@ class BacklogsControllerTest < Test::Unit::TestCase
|
|
15
15
|
@request.session[:user_id] = 1000001
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
18
|
+
def test_index_first_time
|
19
|
+
Work.delete_all
|
20
|
+
Estimate.delete_all
|
21
|
+
Task.delete_all
|
22
|
+
Backlog.delete_all
|
23
|
+
get :index
|
24
|
+
assert_response :redirect
|
25
|
+
assert_redirected_to :action => :new
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_index_active_period
|
29
|
+
Work.delete(works(:started).id)
|
30
|
+
get :index
|
31
|
+
assert_response :redirect
|
32
|
+
assert_redirected_to :controller => 'periods', :action => :index
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_index_list_started
|
19
36
|
get :index
|
20
37
|
assert_response :redirect
|
21
38
|
assert_redirected_to :controller => 'tasks', :action => :list_started
|
@@ -5,7 +5,7 @@ require 'groups_controller'
|
|
5
5
|
class GroupsController; def rescue_action(e) raise e end; end
|
6
6
|
|
7
7
|
class GroupsControllerTest < Test::Unit::TestCase
|
8
|
-
fixtures :parties, :users, :groups, :periods, :tasks, :estimates, :works
|
8
|
+
fixtures :parties, :users, :groups, :groups_users, :periods, :tasks, :estimates, :works
|
9
9
|
|
10
10
|
def setup
|
11
11
|
@controller = GroupsController.new
|
@@ -95,12 +95,13 @@ class GroupsControllerTest < Test::Unit::TestCase
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def test_set_member
|
98
|
-
|
99
|
-
assert groups(:first_group).users.
|
98
|
+
long_user = users(:long_user)
|
99
|
+
assert groups(:first_group).users.size == 1
|
100
100
|
|
101
|
-
post :set_member, :id => @first_id, :user_id =>
|
101
|
+
post :set_member, :id => @first_id, :user_id => long_user.id, :value => 'true'
|
102
102
|
|
103
103
|
assert groups(:first_group).users.include?(users(:tesla))
|
104
|
+
assert groups(:first_group).users.include?(users(:long_user))
|
104
105
|
end
|
105
106
|
|
106
107
|
private
|
@@ -5,7 +5,7 @@ require 'periods_controller'
|
|
5
5
|
class PeriodsController; def rescue_action(e) raise e end; end
|
6
6
|
|
7
7
|
class PeriodsControllerTest < Test::Unit::TestCase
|
8
|
-
fixtures :periods, :tasks, :works, :estimates
|
8
|
+
fixtures :parties, :users, :groups, :groups_users, :periods, :tasks, :works, :estimates
|
9
9
|
|
10
10
|
def setup
|
11
11
|
@controller = PeriodsController.new
|
@@ -5,7 +5,7 @@ require 'tasks_controller'
|
|
5
5
|
class TasksController; def rescue_action(e) raise e end; end
|
6
6
|
|
7
7
|
class TasksControllerTest < Test::Unit::TestCase
|
8
|
-
fixtures :parties, :users, :groups, :backlogs, :periods, :tasks, :works, :estimates
|
8
|
+
fixtures :parties, :users, :groups, :groups_users, :backlogs, :periods, :tasks, :works, :estimates
|
9
9
|
|
10
10
|
def setup
|
11
11
|
@controller = TasksController.new
|
@@ -7,7 +7,7 @@ class UserController; def rescue_action(e) raise e end; end
|
|
7
7
|
|
8
8
|
class UserControllerTest < Test::Unit::TestCase
|
9
9
|
self.use_transactional_fixtures = false
|
10
|
-
fixtures :users
|
10
|
+
fixtures :parties, :users, :groups, :groups_users, :periods, :tasks, :estimates, :works
|
11
11
|
|
12
12
|
def setup
|
13
13
|
@controller = UserController.new
|
@@ -5,7 +5,7 @@ require 'works_controller'
|
|
5
5
|
class WorksController; def rescue_action(e) raise e end; end
|
6
6
|
|
7
7
|
class WorksControllerTest < Test::Unit::TestCase
|
8
|
-
fixtures :users, :backlogs, :periods, :tasks, :works, :estimates
|
8
|
+
fixtures :users, :groups_users, :backlogs, :periods, :tasks, :works, :estimates
|
9
9
|
|
10
10
|
def setup
|
11
11
|
@controller = WorksController.new
|
data/test/unit/estimate_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../test_helper'
|
2
2
|
|
3
3
|
class EstimateTest < Test::Unit::TestCase
|
4
|
-
fixtures :parties, :users, :groups, :backlogs, :periods, :tasks, :works, :estimates
|
4
|
+
fixtures :parties, :users, :groups, :groups_users, :backlogs, :periods, :tasks, :works, :estimates
|
5
5
|
|
6
6
|
# Replace this with your real tests.
|
7
7
|
def test_truth
|
data/test/unit/group_test.rb
CHANGED
data/test/unit/task_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../test_helper'
|
2
2
|
|
3
3
|
class TaskTest < Test::Unit::TestCase
|
4
|
-
fixtures :parties, :users, :groups, :backlogs, :periods, :tasks, :estimates, :works
|
4
|
+
fixtures :parties, :users, :groups, :groups_users, :backlogs, :periods, :tasks, :estimates, :works
|
5
5
|
|
6
6
|
# Replace this with your real tests.
|
7
7
|
def test_truth
|
data/test/unit/user_test.rb
CHANGED
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: backlog
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
6
|
+
version: 0.5.0
|
7
7
|
date: 2007-08-06 00:00:00 +02:00
|
8
8
|
summary: Application to aid collecting, processing, organizing, reviewing and doing tasks.
|
9
9
|
require_paths:
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- test/fixtures/users.yml
|
155
155
|
- test/fixtures/groups.yml
|
156
156
|
- test/fixtures/backlogs.yml
|
157
|
+
- test/fixtures/groups_users.yml
|
157
158
|
- test/fixtures/parties.yml
|
158
159
|
- test/fixtures/estimates.yml
|
159
160
|
- test/fixtures/tasks.yml
|
@@ -167,6 +168,7 @@ files:
|
|
167
168
|
- test/unit/estimate_test.rb
|
168
169
|
- test/unit/big_decimal_yaml_fix_test.rb
|
169
170
|
- lib
|
171
|
+
- lib/version_from_history.rb
|
170
172
|
- lib/class_table_inheritance.rb
|
171
173
|
- lib/clock.rb
|
172
174
|
- lib/big_decimal_yaml_fix.rb
|
@@ -223,7 +225,6 @@ files:
|
|
223
225
|
- config/environments/datek_production.rb
|
224
226
|
- LICENSE_LOCALIZATION
|
225
227
|
- README.txt
|
226
|
-
- doc
|
227
228
|
- Manifest.txt
|
228
229
|
- vendor
|
229
230
|
- vendor/plugins
|