backlog 0.21.2 → 0.21.3
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/History.txt +14 -0
- data/Rakefile +1 -1
- data/app/controllers/user_controller.rb +0 -1
- data/app/helpers/periods_helper.rb +1 -1
- data/app/helpers/tasks_helper.rb +0 -15
- data/app/models/task.rb +4 -2
- data/app/models/work_lock_nagger.rb +7 -4
- data/app/views/works/daily_work_sheet.rhtml +6 -0
- data/bin/backlog +23 -2
- data/config/war.rb +3 -2
- data/lib/clock.rb +1 -1
- data/lib/time_extras.rb +14 -0
- data/lib/user_system.rb +1 -1
- data/test/unit/big_decimal_yaml_fix_test.rb +2 -1
- data/test/unit/task_test.rb +19 -3
- metadata +3 -2
data/History.txt
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
== 0.21.3 2008-02-13
|
2
|
+
|
3
|
+
=== Features
|
4
|
+
|
5
|
+
* Added link to weekly work sheet from daily work sheet.
|
6
|
+
|
7
|
+
=== Fixes
|
8
|
+
|
9
|
+
* Fixed reading the default host/port for Work Lock Nag email from the local network settings and backlog.conf.
|
10
|
+
* Fixed adding startup links on non-redhat unix distributions. Now use "ln -s ..." instead.
|
11
|
+
* Fixed bug that could occur when finishing tasks.
|
12
|
+
* Fixed bug when starting two tasks at the same time.
|
13
|
+
* Added missing dependency for the "slave" gem to WAR cofig.
|
14
|
+
|
1
15
|
== 0.21.2 2008-02-08
|
2
16
|
|
3
17
|
=== Features
|
data/Rakefile
CHANGED
@@ -34,7 +34,7 @@ Hoe.new("backlog", APP::VERSION) do |p|
|
|
34
34
|
p.url = 'http://rubyforge.org/projects/backlog/'
|
35
35
|
p.extra_deps = [['rails', '>= 1.2.4'], ['gruff', '>= 0.2.9'], ['rmagick', '= 1.15.12'],
|
36
36
|
['postgres', '>= 0.7.9'], ['slave', '>= 1.2.1']]
|
37
|
-
p.rsync_args = "-
|
37
|
+
p.rsync_args = "-acuv --delete --exclude=wiki*"
|
38
38
|
end
|
39
39
|
|
40
40
|
desc 'Release the application to RubyForge'
|
@@ -45,7 +45,7 @@ module PeriodsHelper
|
|
45
45
|
page.insert_html :top, period_tag_id, %Q{<ul id="#{list_tag_id}" class="task_list"/>}
|
46
46
|
page.insert_html :top, period_tag_id, :partial => '/tasks/fields_header', :locals => {:backlog => @task.backlog, :active => false, :work_done => work_done}
|
47
47
|
end
|
48
|
-
page.insert_html :top, list_tag_id, :partial => '/tasks/task', :locals => {:active => false, :hidden => true, :highlight_task => false}
|
48
|
+
page.insert_html :top, list_tag_id, :partial => '/tasks/task', :locals => {:active => false, :hidden => true, :highlight_task => false, :show_backlog => true}
|
49
49
|
page.visual_effect :appear, "task_#{@task.id}"
|
50
50
|
|
51
51
|
end
|
data/app/helpers/tasks_helper.rb
CHANGED
@@ -1,17 +1,2 @@
|
|
1
1
|
module TasksHelper
|
2
2
|
end
|
3
|
-
|
4
|
-
class Time
|
5
|
-
def self.next_quarter
|
6
|
-
now = Time.now
|
7
|
-
now -= now.sec
|
8
|
-
next_quarter = now + (15 - now.min % 15).minutes
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.previous_quarter
|
12
|
-
now = Time.now
|
13
|
-
now -= now.sec
|
14
|
-
previous_quarter = now - (now.min % 15).minutes
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
data/app/models/task.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'time_extras'
|
2
|
+
|
1
3
|
class Task < ActiveRecord::Base
|
2
4
|
extend UserSystem
|
3
5
|
include UserSystem
|
@@ -349,9 +351,9 @@ class Task < ActiveRecord::Base
|
|
349
351
|
|
350
352
|
new_work.started_at = Time.previous_quarter
|
351
353
|
if current_user
|
352
|
-
last_work = current_user.works.last
|
354
|
+
last_work = current_user.works.select {|w| w.completed_at}.last
|
353
355
|
else
|
354
|
-
last_work = Work.find(:first, :order => '
|
356
|
+
last_work = Work.find(:first, :conditions => 'completed_at IS NOT NULL', :order => 'completed_at DESC')
|
355
357
|
end
|
356
358
|
if last_work && last_work.completed_at > new_work.started_at
|
357
359
|
new_work.started_at = last_work.completed_at
|
@@ -8,11 +8,14 @@ class WorkLockNagger
|
|
8
8
|
sleep 1.minute
|
9
9
|
puts "Work Lock Nagger started"
|
10
10
|
begin
|
11
|
-
host = Socket::gethostbyname('localhost')[1][1]
|
12
11
|
config = YAML::load(ERB.new(IO.read(APP_CONFIG_FILE)).result) || {}
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
if app_url = config[:app_url]
|
13
|
+
url = app_url + 'works/weekly_work_sheet_by_work_account'
|
14
|
+
else
|
15
|
+
host = Socket::gethostname
|
16
|
+
port = config[:port] || 3000
|
17
|
+
url = url_for(:host => host, :port => port, :controller => 'works', :action => :weekly_work_sheet_by_work_account)
|
18
|
+
end
|
16
19
|
rescue Exception => e
|
17
20
|
puts e.message
|
18
21
|
puts e.backtrace
|
@@ -10,6 +10,12 @@
|
|
10
10
|
<br clear="all" />
|
11
11
|
|
12
12
|
<table sstyle="width: 100%" border="0">
|
13
|
+
<tr>
|
14
|
+
<th align="right" colspan="5">
|
15
|
+
<%=link_to l(:weekly_work_sheet), :action => :weekly_work_sheet_by_work_account%>
|
16
|
+
</th>
|
17
|
+
</tr>
|
18
|
+
|
13
19
|
<tr>
|
14
20
|
<th><%=l :account %></th>
|
15
21
|
<th><%=l :description %></th>
|
data/bin/backlog
CHANGED
@@ -146,10 +146,31 @@ when 'setup_unix'
|
|
146
146
|
File.delete startup_app if File.exists? startup_app
|
147
147
|
`cp -p #{INSTALL_DIR}/bin/backlog_init.d #{startup_app}` unless File.exists? startup_app
|
148
148
|
`chmod a+x #{startup_app}` if File.exists? startup_app
|
149
|
+
(0..6).each do |run_level|
|
150
|
+
link_name = "/etc/rc#{run_level}.d/S88#{APPLICATION}"
|
151
|
+
kill_link_name = "/etc/rc#{run_level}.d/K12#{APPLICATION}"
|
152
|
+
if [3,4,5].include? run_level
|
153
|
+
unless File.exists? link_name
|
154
|
+
puts "Creating startup link for run level #{run_level}."
|
155
|
+
`su - -c "ln -s /etc/init.d/#{APPLICATION} #{link_name}"`
|
156
|
+
end
|
157
|
+
if File.exists? kill_link_name
|
158
|
+
puts "Removing kill link for run level #{run_level}."
|
159
|
+
`su - -c "rm #{kill_link_name}"`
|
160
|
+
end
|
161
|
+
else
|
162
|
+
if File.exists? link_name
|
163
|
+
puts "Removing startup link for run level #{run_level}."
|
164
|
+
`su - -c "rm #{link_name}"`
|
165
|
+
end
|
166
|
+
unless File.exists? kill_link_name
|
167
|
+
puts "Creating kill link for run level #{run_level}."
|
168
|
+
`su - -c "ln -s /etc/init.d/#{APPLICATION} #{kill_link_name}"`
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
149
172
|
end
|
150
173
|
FileUtils.cp "#{INSTALL_DIR}/etc/#{APPLICATION}.conf", config_file unless File.exists? config_file
|
151
|
-
`su - -c "chkconfig --add #{APPLICATION}"`
|
152
|
-
`su - -c "chkconfig #{APPLICATION} on"`
|
153
174
|
puts
|
154
175
|
else
|
155
176
|
puts "Usage: #$0 {start|stop|restart|status|setup_unix [bsd] [debug]}"
|
data/config/war.rb
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
# Goldspike configuration
|
2
2
|
|
3
3
|
# Set the version of JRuby and GoldSpike to use:
|
4
|
-
|
4
|
+
maven_library 'org.jruby', 'jruby-complete', '1.1RC1'
|
5
|
+
maven_library 'backport-util-concurrent', 'backport-util-concurrent', '3.0'
|
5
6
|
#maven_library 'org.jruby.extras', 'goldspike', '1.3-SNAPSHOT'
|
6
7
|
|
7
8
|
# Add a Java library from the Maven repository:
|
8
9
|
maven_library 'postgresql', 'postgresql', '8.2-504.jdbc4'
|
9
10
|
#maven_library 'bouncycastle', 'bcprov-jdk16', '136'
|
10
11
|
|
11
|
-
#add_gem('postgres-pr', '>=0.0.1')
|
12
12
|
add_gem('jruby-openssl', '>=0.0.4')
|
13
13
|
add_gem('rubyforge', '>=0.4.4')
|
14
14
|
add_gem('rmagick4j', '>=0.3.3')
|
15
15
|
add_gem('gruff', '>=0.2.8')
|
16
|
+
add_gem('slave', '>=1.2.1')
|
16
17
|
|
17
18
|
exclude_files('pkg')
|
18
19
|
|
data/lib/clock.rb
CHANGED
data/lib/time_extras.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
class Time
|
2
|
+
def self.next_quarter
|
3
|
+
now = Time.now
|
4
|
+
now -= now.sec
|
5
|
+
next_quarter = now + (15 - now.min % 15).minutes
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.previous_quarter
|
9
|
+
now = Time.now
|
10
|
+
now -= now.sec
|
11
|
+
previous_quarter = now - (now.min % 15).minutes
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
data/lib/user_system.rb
CHANGED
@@ -3,10 +3,11 @@ require 'yaml'
|
|
3
3
|
require 'bigdecimal'
|
4
4
|
require 'rubygems'
|
5
5
|
require 'active_support'
|
6
|
+
require 'big_decimal_yaml_fix'
|
6
7
|
|
7
8
|
class BigDecimalYamlTest < Test::Unit::TestCase
|
8
9
|
def test_to_yaml
|
9
|
-
|
10
|
+
assert_equal "--- 1.0\n", BigDecimal.new('1').to_yaml
|
10
11
|
assert_equal "--- 100000.30020320320000000000000000000000000000001\n", BigDecimal.new('100000.30020320320000000000000000000000000000001').to_yaml
|
11
12
|
assert_equal "--- .Inf\n", BigDecimal.new('Infinity').to_yaml
|
12
13
|
assert_equal "--- .NaN\n", BigDecimal.new('NaN').to_yaml
|
data/test/unit/task_test.rb
CHANGED
@@ -1,10 +1,26 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../test_helper'
|
2
2
|
|
3
3
|
class TaskTest < Test::Unit::TestCase
|
4
|
+
include UserSystem
|
5
|
+
|
4
6
|
main_scenario
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
8
|
+
def setup
|
9
|
+
self.current_user = User.find(1000001)
|
10
|
+
end
|
11
|
+
|
12
|
+
def teardown
|
13
|
+
self.current_user = nil
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_two_started_tasks
|
17
|
+
tasks(:first).start_work
|
18
|
+
tasks(:another).start_work
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_two_started_tasks_anonymous
|
22
|
+
self.current_user = nil
|
23
|
+
tasks(:first).start_work
|
24
|
+
tasks(:another).start_work
|
9
25
|
end
|
10
26
|
end
|
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.21.
|
4
|
+
version: 0.21.3
|
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-02-
|
12
|
+
date: 2008-02-13 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -598,6 +598,7 @@ files:
|
|
598
598
|
- lib/change_column_null_migration_fix.rb
|
599
599
|
- lib/version_from_history.rb
|
600
600
|
- lib/user_system.rb
|
601
|
+
- lib/time_extras.rb
|
601
602
|
- lib/localization.rb
|
602
603
|
- config
|
603
604
|
- config/database.yml
|