backlog 0.17.1 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,17 @@
1
+ == 0.17.2 2008-01-07
2
+
3
+ === Fixes
4
+
5
+ * Made task listing a bit prettier.
6
+ * Changed to redirect to start page after registering.
7
+ * Made welcome view slightly more welcoming :)
8
+ * Fixed workflow to return from detour after updating backlog properties.
9
+
10
+ === Internal
11
+
12
+ * Updated gem dependencies.
13
+ * Added test of WAR file by running it with Jetty.
14
+
1
15
  == 0.17.1 2008-01-04
2
16
 
3
17
  === Fixes
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
1
  # Add your own tasks in files placed in lib/tasks ending in .rake,
2
2
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
3
 
4
+ require 'erb'
5
+
4
6
  require(File.join(File.dirname(__FILE__), 'config', 'boot'))
5
7
 
6
8
  require 'rake'
@@ -30,7 +32,7 @@ Hoe.new("backlog", APP::VERSION) do |p|
30
32
  }
31
33
  p.need_zip = true
32
34
  p.url = 'http://rubyforge.org/projects/backlog/'
33
- p.extra_deps = [['rails', '>= 1.2.3'], ['gruff', '>= 0.2.8'], ['rmagick', '>= 1.15.10'], ['postgres', '>= 0.7.1']]
35
+ p.extra_deps = [['rails', '>= 1.2.4'], ['gruff', '>= 0.2.9'], ['rmagick', '>= 1.15.12'], ['postgres', '>= 0.7.9']]
34
36
  p.rsync_args = "-av --delete --exclude=wiki*"
35
37
  end
36
38
 
@@ -45,8 +47,13 @@ end
45
47
 
46
48
  desc 'Release the application as a Java EE WAR file to RubyForge'
47
49
  task :release_war do
50
+ FileUtils.rm_rf 'WEB-INF' if File.exists? 'WEB-INF'
48
51
  Dir.mkdir 'WEB-INF' unless File.exists? 'WEB-INF'
49
- FileUtils.cp 'vendor/plugins/goldspike/generators/goldspike/templates/web.xml.erb', 'WEB-INF/web.xml.erb' unless File.exists? 'WEB-INF/web.xml.erb'
52
+ unless File.exists? 'WEB-INF/web.xml.erb'
53
+ File.open('WEB-INF/web.xml.erb', 'w') do |f|
54
+ f << ERB.new(File.read('vendor/plugins/goldspike/generators/goldspike/templates/web.xml.erb')).result
55
+ end
56
+ end
50
57
  Rake::Task['war:standalone:create'].invoke
51
58
  war_pkg_file = "pkg/backlog-#{APP::VERSION}.war"
52
59
  if File.exists? 'backlog.war'
@@ -71,7 +71,7 @@ class BacklogsController < ApplicationController
71
71
  @backlog = Backlog.find(params[:id])
72
72
  if @backlog.update_attributes(params[:backlog])
73
73
  flash[:notice] = 'Backlog was successfully updated.'
74
- redirect_to :action => 'show', :id => @backlog
74
+ back_or_redirect_to :action => :show, :id => @backlog
75
75
  else
76
76
  render :action => 'edit'
77
77
  end
@@ -134,12 +134,14 @@ class UserController < ApplicationController
134
134
  @user.update_attribute( :deleted, true )
135
135
  logout
136
136
  rescue Exception => ex
137
- flash.now[:notice] = "Error: #{@ex}."
137
+ flash.now[:notice] = "Error: #{ex}."
138
138
  redirect_back_or_default :action => 'welcome'
139
139
  end
140
140
  end
141
141
 
142
142
  def welcome
143
+ flash.keep
144
+ back_or_redirect_to :controller => 'welcome'
143
145
  end
144
146
 
145
147
  def set_group
@@ -1,12 +1,15 @@
1
1
  <li>
2
2
  <div style="font-weight: bold">
3
- <span style="float: left" />
4
- <span style="float: left; width: 2em; text-align: center; padding-left: 2px"><%=active ? 'ID' : l(:resolution_abr)%></span>
5
- <span style="float: left"><%=l :task %></span>
6
- <span style="float: left"><%=l :start if active && backlog.track_times? %></span>
7
- <span style="float: left"/>
8
- <span style="float: left"><%=l :done if (active && backlog.track_done?) || work_done %></span>
9
- <span style="float: left" width="*"><%=l :todo if active && backlog.track_todo? %></span>
3
+ <div style="float: left" />
4
+ <div class="task_id"><%=active ? 'ID' : l(:resolution_abr)%></div>
5
+ <div class="task_description"><%=l :task %></div>
6
+ <div style="float: right">
7
+ <div class="task_start"><%=l :start if active && backlog.track_times? %></div>
8
+ <div class="task_end_work">&nbsp;</div>
9
+ <div class="task_done"><%=l :done if (active && backlog.track_done?) || work_done %></div>
10
+ <div class="task_todo"><%=l :todo if active && backlog.track_todo? %></div>
11
+ <div class="task_buttons"></div>
12
+ </div>
10
13
  </div>
11
14
  <br clear="all"/>
12
15
  </li>
@@ -7,22 +7,22 @@
7
7
  <% end %>
8
8
  <% end %>
9
9
  </div>
10
- <div style="float: left" style="border: 0px">
10
+ <div style="float: left" style="border: 3px solid red">
11
11
  <%=("&nbsp;" * @task.depth * 4) if @task.depth > 0 %>
12
12
  <%=resolution_image(@task.resolution) if @task.finished_at %>
13
13
  <%="-" if @task.children.size > 0 %>
14
14
  </div>
15
- <div id="task_<%=@task.id%>_id" style="float: left; padding-left: 2px; width: 2em; text-align: center">
15
+ <div id="task_<%=@task.id%>_id" class="task_id">
16
16
  <%=detour_to "##{@task.id}", :controller => 'tasks', :action => :edit, :id => @task.id, :style => 'border: 0px; margin: 0px; padding: 0px' if @task.position || @task.depth == 0 %>
17
17
  </div>
18
- <div id="task_<%=@task.id%>_description" style="float: left; padding: 2px; ">
18
+ <div id="task_<%=@task.id%>_description" class="task_description">
19
19
  <%=h(@task.description) %>
20
20
  </div>
21
21
 
22
22
 
23
23
 
24
24
  <div style="float: right" style="border: 1px solid black">
25
- <div style="float: left" style="border: 1px solid black">
25
+ <div class="task_start">
26
26
  <% if active && @task.loggable? -%>
27
27
  <% if @task.work_started? -%>
28
28
  <% remote_form_for(:work, :url => {:controller => 'works', :action => 'update_time', :id => @task.started_work}) do |f| %>
@@ -35,15 +35,18 @@
35
35
  <% end -%>
36
36
  <% end -%>
37
37
  </div>
38
- <div style="float: left" style="border: 1px solid black">
38
+ <div class="task_end_work">
39
39
  <% if active && @task.loggable? && @task.work_started? -%>
40
40
  <% form_tag({:controller => 'works', :action => 'update', :id => @task.started_work}) do %>
41
41
  <%= image_detour_to('ernes_stop.png', l(:end_work), {:controller => 'tasks', :action => :end_work, :id => @task.id}, nil, true) %>
42
42
  <% end -%>
43
+ <% else %>
44
+ &nbsp;
43
45
  <% end -%>
44
46
  </div>
45
- <div style="float: left" style="border: 1px solid black" align="<%=active && @task.loggable? && @task.track_done? ? 'left' : 'right'%>">
46
- <% if @task.track_done? || @task.total_done != 0 %>
47
+ <div class="task_done" align="<%=active && @task.loggable? && @task.track_done? ? 'left' : 'right'%>">
48
+ &nbsp;
49
+ <% if @task.track_done? || @task.total_done != 0 %>
47
50
  <% if @task.loggable? || @task.finished_at -%>
48
51
  <% unless !@task.track_done? || @task.track_times? || @task.work_started? || @task.finished_at -%>
49
52
  <% form_tag({:controller => 'works', :action => (@task.work_started? ? :edit : :create), :id => @task.started_work}) do %>
@@ -58,7 +61,7 @@
58
61
  <% end -%>
59
62
  <% end -%>
60
63
  </div>
61
- <div style="float: left" style="border: 1px solid black">
64
+ <div class="task_todo">
62
65
  <% if active && @task.loggable? -%>
63
66
  <% if @task.track_todo? -%>
64
67
  <% if @task.period.nil? || @task.period.active_or_future? -%>
@@ -74,7 +77,7 @@
74
77
  <% end -%>
75
78
  <% end -%>
76
79
  </div>
77
- <div style="float: left" align="right" style="border: 1px solid black">
80
+ <div class="task_buttons">
78
81
  <% if @task.active? -%>
79
82
  <% if @task.loggable? -%>
80
83
  <% unless @task.work_started? -%>
@@ -2,9 +2,7 @@
2
2
  <%= head_helper 'Welcome', :notice => false, :message => false %>
3
3
  <p>You are now logged into the system...</p>
4
4
  <p>
5
- Since you are here it's safe to assume the application never
6
- called store_location, otherwise you would have been redirected
7
- somewhere else after a successful login.
5
+ Welcome to Backlog!
8
6
  </p>
9
- <%= link_to 'logout', :action => 'logout' %>
7
+ <%=link_to l(:welcome_link), :controller => 'welcome' %>
10
8
  </div>
data/lang/en.yaml CHANGED
@@ -110,5 +110,6 @@ view_fullscreen: View fullscreen
110
110
  wednesday: Wednesday
111
111
  week: Week
112
112
  weekly_work_sheet: Weekly work sheet
113
+ welcome_link: Start getting things done.
113
114
  work: Work
114
115
  work_account: Work Account
data/lang/no.yaml CHANGED
@@ -109,5 +109,6 @@ view_fullscreen: Vis fullskjerm
109
109
  wednesday: Onsdag
110
110
  week: Uke
111
111
  weekly_work_sheet: Timeoversikt for uke
112
+ welcome_link: Få ting gjort.
112
113
  work: Arbeid
113
114
  work_account: Timeføringskonto
@@ -53,7 +53,7 @@ class ActiveRecord::Base
53
53
  proxy_class.class_eval(&block) if block_given?
54
54
  end
55
55
 
56
- has_one_without_cti proxy_symbol, :class_name => proxy_class.name, :foreign_key => primary_key_name, :dependent => true
56
+ has_one_without_cti proxy_symbol, :class_name => proxy_class.name, :foreign_key => primary_key_name, :dependent => :destroy
57
57
 
58
58
  if options[:save_before_superclass_callbacks] || true
59
59
  # We need the after_save filter for this association to run /before/ any other after_save's already registered on a superclass,
@@ -13,8 +13,16 @@ table.input td {vertical-align: top; margin: 0; border: 0; padding: 0 1px;}
13
13
  #maincontent div.btitle img.image-submit {float: right;}
14
14
  #maincontent div.btitle h4 {margin-top: 6px;}
15
15
  .highlight {background: yellow;}
16
- .task_list {width: 95%; text-align: left; list-style-type: none}
17
- .tasks {cursor: move;}
16
+ .task_list {width: 95%; text-align: left; list-style-type: none; padding-left: 0}
17
+ .task_list li {margin-left: 0}
18
+ .tasks {cursor: move}
19
+ .task_id {float: left; padding-left: 2px; width: 3em; text-align: center}
20
+ .task_description {float: left; padding: 1px; width: auto}
21
+ .task_start {float: left; width: 4em; text-align: center}
22
+ .task_end_work {float: left; width: 2em}
23
+ .task_done {float: left; width: 3em}
24
+ .task_todo {float: left; width: 3em; padding: 1px}
25
+ .task_buttons {float: left; width: 5em}
18
26
  .dragable-hover {background: yellow; border: 1px solid black;}
19
27
  .dropzone-hover {background: yellow; border: 1px solid black;}
20
28
  th.hours {text-align: right;}
@@ -231,7 +231,8 @@ class UserControllerTest < Test::Unit::TestCase
231
231
  @request.cookies['autologin'] = CGI::Cookie.new('autologin', {:value => ['no_password_user'], :expires =>30.days.from_now})
232
232
  get :welcome
233
233
  assert_logged_in users(:no_password_user)
234
- assert_response :ok
234
+ assert_response :redirect
235
+ assert_redirected_to :controller => 'welcome'
235
236
  end
236
237
 
237
238
  def test_autologin_with_token
@@ -239,7 +240,8 @@ class UserControllerTest < Test::Unit::TestCase
239
240
  @request.cookies['token'] = CGI::Cookie.new('autologin', {:value => ['random_token_string'], :expires =>30.days.from_now})
240
241
  get :welcome
241
242
  assert_logged_in users(:no_password_user)
242
- assert_response :ok
243
+ assert_response :redirect
244
+ assert_redirected_to :controller => 'welcome'
243
245
  end
244
246
 
245
247
  def test_autologin_unverified_user_with_token
@@ -248,7 +250,8 @@ class UserControllerTest < Test::Unit::TestCase
248
250
  get :welcome
249
251
  assert_logged_in users(:no_password_user)
250
252
  assert current_user.verified?
251
- assert_response :ok
253
+ assert_response :redirect
254
+ assert_redirected_to :controller => 'welcome'
252
255
  end
253
256
 
254
257
  private
@@ -0,0 +1,91 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ module Backlog
4
+ module Performance
5
+ module Tests
6
+ def start_server
7
+ @port = 4000
8
+ @factor = 1.0
9
+ @server_thread = IO.popen("script/server -e test -p #{@port}")
10
+ Thread.start do
11
+ loop do
12
+ lines = @server_thread.readline
13
+ #puts lines
14
+ end
15
+ end
16
+ sleep 4
17
+ end
18
+
19
+ def stop_server
20
+ if @server_thread
21
+ Process.kill("TERM", @server_thread.pid)
22
+ end
23
+ end
24
+
25
+ def start_jetty
26
+ @port = 8080
27
+ @context = '/backlog'
28
+ @factor = 2.0
29
+ ENV['RAILS_ENV'] = 'test'
30
+ @jetty_thread = IO.popen("rake war:standalone:run")
31
+ Thread.start do
32
+ loop do
33
+ lines = @jetty_thread.readline
34
+ puts lines
35
+ end
36
+ end
37
+ sleep 20
38
+ end
39
+
40
+ def stop_jetty
41
+ if @jetty_thread
42
+ Process.kill("TERM", @jetty_thread.pid)
43
+ Process.kill("KILL", @jetty_thread.pid)
44
+ end
45
+ end
46
+
47
+ def test_lots_of_requests
48
+ runs = 3
49
+ no_of_threads = 2
50
+ hits_per_thread = 5
51
+
52
+ duration = with_timing("First") {get_burn_down_chart}
53
+ first_hit_limit = 12 * @factor
54
+ assert duration <= first_hit_limit, "Request took #{duration} seconds. Should be less than #{first_hit_limit} seconds."
55
+
56
+ runs.times do |run_no|
57
+ duration = with_timing((run_no+1)*no_of_threads*hits_per_thread, no_of_threads*hits_per_thread) do
58
+ threads = (1..no_of_threads).map do |i|
59
+ Thread.new do
60
+ hits_per_thread.times {get_burn_down_chart}
61
+ end
62
+ end
63
+ threads.each {|thread| thread.join}
64
+ end
65
+ maximum_duration = 6.0 * no_of_threads * hits_per_thread * @factor
66
+ assert duration <= maximum_duration, "Performance to low. Expected #{maximum_duration} or less, took #{duration}."
67
+ end
68
+ end
69
+
70
+ private
71
+
72
+ def with_timing title = "Time", count = 1
73
+ start = Time.now
74
+ yield
75
+ stop = Time.now
76
+ duration = stop-start
77
+ puts "#{title}: #{'%.1f' % duration}s, #{(count/duration).to_i if count}/s"
78
+ duration
79
+ end
80
+
81
+ def get_burn_down_chart
82
+ path = "#{@context}/parties/burn_down_chart/1"
83
+ Net::HTTP::start('localhost', @port) do |http|
84
+ response = http.get path
85
+ assert response.body =~ /^.PNG/, response.body
86
+ end
87
+ end
88
+
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,15 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+ require File.dirname(__FILE__) + '/common'
3
+
4
+ class JettyTest < Test::Unit::TestCase
5
+ include Backlog::Performance::Tests
6
+
7
+ def setup
8
+ start_jetty
9
+ end
10
+
11
+ def teardown
12
+ stop_jetty
13
+ end
14
+
15
+ end
@@ -0,0 +1,17 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+ require File.dirname(__FILE__) + '/common'
3
+
4
+ class ServerTest < Test::Unit::TestCase
5
+ include Backlog::Performance::Tests
6
+
7
+ PORT = 4000
8
+
9
+ def setup
10
+ start_server
11
+ end
12
+
13
+ def teardown
14
+ stop_server
15
+ end
16
+
17
+ end
@@ -39,7 +39,7 @@ module RedHillConsulting::Core::ActiveRecord
39
39
  end
40
40
 
41
41
  def indexes
42
- @indexes ||= connection.indexes(table_name, "#{name} Indexes")
42
+ @indexes ||= connection.indexes(table_name)
43
43
  end
44
44
 
45
45
  def foreign_keys
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uwe Kubosch
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-01-05 00:00:00 +01:00
12
+ date: 2008-01-07 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -19,7 +19,7 @@ dependencies:
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 1.2.3
22
+ version: 1.2.4
23
23
  version:
24
24
  - !ruby/object:Gem::Dependency
25
25
  name: gruff
@@ -28,7 +28,7 @@ dependencies:
28
28
  requirements:
29
29
  - - ">="
30
30
  - !ruby/object:Gem::Version
31
- version: 0.2.8
31
+ version: 0.2.9
32
32
  version:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rmagick
@@ -37,7 +37,7 @@ dependencies:
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.15.10
40
+ version: 1.15.12
41
41
  version:
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: postgres
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 0.7.1
49
+ version: 0.7.9
50
50
  version:
51
51
  - !ruby/object:Gem::Dependency
52
52
  name: hoe
@@ -283,8 +283,9 @@ files:
283
283
  - test/fixtures/customers.yml
284
284
  - test/fixtures/tasks.yml
285
285
  - test/performance
286
- - test/performance/test_threaded.rb
287
- - test/performance/test.rb
286
+ - test/performance/server_test.rb
287
+ - test/performance/common.rb
288
+ - test/performance/jetty_test.rb
288
289
  - LICENSE_LOCALIZATION
289
290
  - README_LOCALIZATION
290
291
  - History.txt
@@ -627,4 +628,3 @@ specification_version: 2
627
628
  summary: Application to aid collecting, processing, organizing, reviewing and doing tasks.
628
629
  test_files:
629
630
  - test/test_helper.rb
630
- - test/performance/test_threaded.rb
@@ -1,6 +0,0 @@
1
- count = 100
2
- puts "Running #{count} times"
3
- count.times do
4
- `GET http://localhost:3000/parties/burn_down_chart/1 >/dev/null`
5
- end
6
- puts "Finished."
@@ -1,65 +0,0 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
-
3
- class BacklogsControllerTest < Test::Unit::TestCase
4
- PORT = 4000
5
-
6
- def setup
7
- @server_thread = IO.popen("script/server -e test -p #{PORT}")
8
- Thread.start do
9
- loop do
10
- lines = @server_thread.readline
11
- #puts lines
12
- end
13
- end
14
- sleep 4
15
- end
16
-
17
- def teardown
18
- if @server_thread
19
- Process.kill("TERM", @server_thread.pid)
20
- end
21
- end
22
-
23
- def test_lots_of_requests
24
- runs = 3
25
- no_of_threads = 2
26
- hits_per_thread = 5
27
-
28
- duration = with_timing("First") {get_burn_down_chart}
29
- first_hit_limit = 12
30
- assert duration <= first_hit_limit, "Request took #{duration} seconds. Should be less than #{first_hit_limit} seconds."
31
-
32
- runs.times do |run_no|
33
- duration = with_timing((run_no+1)*no_of_threads*hits_per_thread, no_of_threads*hits_per_thread) do
34
- threads = (1..no_of_threads).map do |i|
35
- Thread.new do
36
- hits_per_thread.times {get_burn_down_chart}
37
- end
38
- end
39
- threads.each {|thread| thread.join}
40
- end
41
- maximum_duration = 6.0 * no_of_threads * hits_per_thread
42
- assert duration <= maximum_duration, "Performance to low. Expected #{maximum_duration} or less, took #{duration}."
43
- end
44
- end
45
-
46
- private
47
-
48
- def with_timing title = "Time", count = 1
49
- start = Time.now
50
- yield
51
- stop = Time.now
52
- duration = stop-start
53
- puts "#{title}: #{'%.1f' % duration}s, #{(count/duration).to_i if count}/s"
54
- duration
55
- end
56
-
57
- def get_burn_down_chart
58
- path = '/parties/burn_down_chart/1'
59
- Net::HTTP::start('localhost', port = PORT) do |http|
60
- response = http.get path
61
- assert response.body =~ /^.PNG/
62
- end
63
- end
64
-
65
- end