backlog 0.8.0 → 0.8.1

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.
Files changed (124) hide show
  1. data/History.txt +14 -0
  2. data/app/controllers/backlogs_controller.rb +4 -10
  3. data/app/controllers/tasks_controller.rb +15 -6
  4. data/app/views/backlogs/_tasks.rhtml +3 -1
  5. data/app/views/backlogs/edit.rhtml +0 -5
  6. data/app/views/backlogs/list.rhtml +1 -1
  7. data/app/views/backlogs/show.rhtml +3 -88
  8. data/app/views/periods/_title.rhtml +1 -1
  9. data/app/views/tasks/_backlog_header.rhtml +3 -2
  10. data/app/views/tasks/_form.rhtml +5 -0
  11. data/app/views/tasks/_period_header.rhtml +1 -1
  12. data/app/views/tasks/new.rhtml +1 -1
  13. data/cruise_config.rb +1 -1
  14. data/doc/classes/BacklogsController.src/M000043.html +4 -6
  15. data/doc/classes/BacklogsController.src/M000044.html +1 -1
  16. data/doc/classes/BacklogsController.src/M000045.html +1 -1
  17. data/doc/classes/BacklogsController.src/M000046.html +1 -5
  18. data/doc/classes/BacklogsController.src/M000047.html +1 -1
  19. data/doc/classes/BacklogsController.src/M000048.html +1 -1
  20. data/doc/classes/BacklogsController.src/M000049.html +1 -1
  21. data/doc/classes/BacklogsController.src/M000050.html +1 -1
  22. data/doc/classes/BacklogsController.src/M000051.html +1 -1
  23. data/doc/classes/BacklogsController.src/M000054.html +4 -6
  24. data/doc/classes/BacklogsController.src/M000055.html +1 -1
  25. data/doc/classes/BacklogsController.src/M000056.html +1 -1
  26. data/doc/classes/BacklogsController.src/M000057.html +1 -5
  27. data/doc/classes/BacklogsController.src/M000058.html +1 -1
  28. data/doc/classes/BacklogsController.src/M000059.html +1 -1
  29. data/doc/classes/BacklogsController.src/M000060.html +1 -1
  30. data/doc/classes/BacklogsController.src/M000061.html +1 -1
  31. data/doc/classes/BacklogsController.src/M000062.html +1 -1
  32. data/doc/classes/TasksController.src/M000105.html +6 -0
  33. data/doc/classes/TasksController.src/M000106.html +1 -1
  34. data/doc/classes/TasksController.src/M000107.html +10 -7
  35. data/doc/classes/TasksController.src/M000108.html +1 -1
  36. data/doc/classes/TasksController.src/M000109.html +1 -1
  37. data/doc/classes/TasksController.src/M000110.html +1 -1
  38. data/doc/classes/TasksController.src/M000111.html +1 -1
  39. data/doc/classes/TasksController.src/M000112.html +1 -1
  40. data/doc/classes/TasksController.src/M000113.html +1 -1
  41. data/doc/classes/TasksController.src/M000114.html +1 -1
  42. data/doc/classes/TasksController.src/M000115.html +1 -1
  43. data/doc/classes/TasksController.src/M000116.html +1 -1
  44. data/doc/classes/TasksController.src/M000117.html +1 -1
  45. data/doc/classes/TasksController.src/M000118.html +1 -1
  46. data/doc/classes/TasksController.src/M000119.html +1 -1
  47. data/doc/classes/TasksController.src/M000120.html +1 -1
  48. data/doc/classes/TasksController.src/M000121.html +1 -1
  49. data/doc/classes/TasksController.src/M000122.html +1 -1
  50. data/doc/classes/TasksController.src/M000125.html +6 -0
  51. data/doc/classes/TasksController.src/M000126.html +1 -1
  52. data/doc/classes/TasksController.src/M000127.html +10 -7
  53. data/doc/classes/TasksController.src/M000128.html +1 -1
  54. data/doc/classes/TasksController.src/M000129.html +1 -1
  55. data/doc/classes/TasksController.src/M000130.html +1 -1
  56. data/doc/classes/TasksController.src/M000131.html +1 -1
  57. data/doc/classes/TasksController.src/M000132.html +1 -1
  58. data/doc/classes/TasksController.src/M000133.html +1 -1
  59. data/doc/classes/TasksController.src/M000134.html +1 -1
  60. data/doc/classes/TasksController.src/M000135.html +1 -1
  61. data/doc/classes/TasksController.src/M000136.html +1 -1
  62. data/doc/classes/TasksController.src/M000137.html +1 -1
  63. data/doc/classes/TasksController.src/M000138.html +1 -1
  64. data/doc/classes/TasksController.src/M000139.html +1 -1
  65. data/doc/classes/TasksController.src/M000140.html +1 -1
  66. data/doc/classes/TasksController.src/M000141.html +1 -1
  67. data/doc/classes/TasksController.src/M000142.html +1 -1
  68. data/doc/created.rid +1 -1
  69. data/doc/dot/f_0.png +0 -0
  70. data/doc/dot/f_1.png +0 -0
  71. data/doc/dot/f_2.png +0 -0
  72. data/doc/dot/f_24.png +0 -0
  73. data/doc/dot/f_25.png +0 -0
  74. data/doc/dot/f_26.png +0 -0
  75. data/doc/dot/f_27.png +0 -0
  76. data/doc/dot/f_28.png +0 -0
  77. data/doc/dot/f_29.png +0 -0
  78. data/doc/dot/f_3.png +0 -0
  79. data/doc/dot/f_30.png +0 -0
  80. data/doc/dot/f_31.png +0 -0
  81. data/doc/dot/f_32.png +0 -0
  82. data/doc/dot/f_33.png +0 -0
  83. data/doc/dot/f_34.png +0 -0
  84. data/doc/dot/f_4.png +0 -0
  85. data/doc/dot/f_46.png +0 -0
  86. data/doc/dot/f_47.png +0 -0
  87. data/doc/dot/f_48.png +0 -0
  88. data/doc/dot/f_49.png +0 -0
  89. data/doc/dot/f_5.png +0 -0
  90. data/doc/dot/f_50.png +0 -0
  91. data/doc/dot/f_51.png +0 -0
  92. data/doc/dot/f_52.png +0 -0
  93. data/doc/dot/f_53.png +0 -0
  94. data/doc/dot/f_54.png +0 -0
  95. data/doc/dot/f_55.png +0 -0
  96. data/doc/dot/f_56.png +0 -0
  97. data/doc/dot/f_6.png +0 -0
  98. data/doc/dot/f_68.png +0 -0
  99. data/doc/dot/f_69.png +0 -0
  100. data/doc/dot/f_7.png +0 -0
  101. data/doc/dot/f_70.png +0 -0
  102. data/doc/dot/f_71.png +0 -0
  103. data/doc/dot/f_72.png +0 -0
  104. data/doc/dot/f_73.png +0 -0
  105. data/doc/dot/f_74.png +0 -0
  106. data/doc/dot/f_75.png +0 -0
  107. data/doc/dot/f_76.png +0 -0
  108. data/doc/dot/f_77.png +0 -0
  109. data/doc/dot/f_78.png +0 -0
  110. data/doc/dot/f_79.png +0 -0
  111. data/doc/dot/m_50_0.png +0 -0
  112. data/doc/files/History_txt.html +41 -2
  113. data/doc/files/app/controllers/backlogs_controller_rb.html +1 -1
  114. data/doc/files/app/controllers/tasks_controller_rb.html +1 -1
  115. data/doc/index.html +2 -2
  116. data/lang/en.yaml +1 -0
  117. data/lang/no.yaml +1 -0
  118. data/test/fixtures/tasks.yml +13 -1
  119. data/test/functional/backlogs_controller_test.rb +5 -2
  120. data/test/functional/tasks_controller_test.rb +14 -0
  121. metadata +2 -5
  122. data/post-clean.rb +0 -12
  123. data/post-install.rb +0 -51
  124. data/post-setup.rb +0 -254
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File app/controllers/tasks_controller.rb, line 203</span>
13
+ <pre><span class="ruby-comment cmt"># File app/controllers/tasks_controller.rb, line 212</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reopen</span>
15
15
  <span class="ruby-identifier">task</span> = <span class="ruby-constant">Task</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
16
16
  <span class="ruby-identifier">task</span>.<span class="ruby-identifier">reopen</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File app/controllers/tasks_controller.rb, line 209</span>
13
+ <pre><span class="ruby-comment cmt"># File app/controllers/tasks_controller.rb, line 218</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_work</span>
15
15
  <span class="ruby-identifier">task</span> = <span class="ruby-constant">Task</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
16
16
  <span class="ruby-identifier">task</span>.<span class="ruby-identifier">start_work</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File app/controllers/tasks_controller.rb, line 215</span>
13
+ <pre><span class="ruby-comment cmt"># File app/controllers/tasks_controller.rb, line 224</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">end_work</span>
15
15
  <span class="ruby-ivar">@task</span> = <span class="ruby-constant">Task</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
16
16
  <span class="ruby-identifier">next_quarter</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">next_quarter</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File app/controllers/tasks_controller.rb, line 243</span>
13
+ <pre><span class="ruby-comment cmt"># File app/controllers/tasks_controller.rb, line 252</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">specify</span>
15
15
  <span class="ruby-identifier">parent_task</span> = <span class="ruby-constant">Task</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
16
16
  <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Task is not open&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">parent_task</span>.<span class="ruby-identifier">active?</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">parent_task</span>.<span class="ruby-identifier">period</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">parent_task</span>.<span class="ruby-identifier">period</span>.<span class="ruby-identifier">active_or_future?</span>)
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File app/controllers/tasks_controller.rb, line 272</span>
13
+ <pre><span class="ruby-comment cmt"># File app/controllers/tasks_controller.rb, line 281</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_task_description</span>
15
15
  <span class="ruby-identifier">task</span> = <span class="ruby-constant">Task</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
16
16
  <span class="ruby-identifier">task</span>.<span class="ruby-identifier">description</span> = <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:value</span>]
data/doc/created.rid CHANGED
@@ -1 +1 @@
1
- Mon, 03 Sep 2007 19:35:44 +0200
1
+ Wed, 05 Sep 2007 00:00:43 +0200
data/doc/dot/f_0.png CHANGED
Binary file
data/doc/dot/f_1.png CHANGED
Binary file
data/doc/dot/f_2.png CHANGED
Binary file
data/doc/dot/f_24.png CHANGED
Binary file
data/doc/dot/f_25.png CHANGED
Binary file
data/doc/dot/f_26.png CHANGED
Binary file
data/doc/dot/f_27.png CHANGED
Binary file
data/doc/dot/f_28.png CHANGED
Binary file
data/doc/dot/f_29.png CHANGED
Binary file
data/doc/dot/f_3.png CHANGED
Binary file
data/doc/dot/f_30.png CHANGED
Binary file
data/doc/dot/f_31.png CHANGED
Binary file
data/doc/dot/f_32.png CHANGED
Binary file
data/doc/dot/f_33.png CHANGED
Binary file
data/doc/dot/f_34.png CHANGED
Binary file
data/doc/dot/f_4.png CHANGED
Binary file
data/doc/dot/f_46.png CHANGED
Binary file
data/doc/dot/f_47.png CHANGED
Binary file
data/doc/dot/f_48.png CHANGED
Binary file
data/doc/dot/f_49.png CHANGED
Binary file
data/doc/dot/f_5.png CHANGED
Binary file
data/doc/dot/f_50.png CHANGED
Binary file
data/doc/dot/f_51.png CHANGED
Binary file
data/doc/dot/f_52.png CHANGED
Binary file
data/doc/dot/f_53.png CHANGED
Binary file
data/doc/dot/f_54.png CHANGED
Binary file
data/doc/dot/f_55.png CHANGED
Binary file
data/doc/dot/f_56.png CHANGED
Binary file
data/doc/dot/f_6.png CHANGED
Binary file
data/doc/dot/f_68.png CHANGED
Binary file
data/doc/dot/f_69.png CHANGED
Binary file
data/doc/dot/f_7.png CHANGED
Binary file
data/doc/dot/f_70.png CHANGED
Binary file
data/doc/dot/f_71.png CHANGED
Binary file
data/doc/dot/f_72.png CHANGED
Binary file
data/doc/dot/f_73.png CHANGED
Binary file
data/doc/dot/f_74.png CHANGED
Binary file
data/doc/dot/f_75.png CHANGED
Binary file
data/doc/dot/f_76.png CHANGED
Binary file
data/doc/dot/f_77.png CHANGED
Binary file
data/doc/dot/f_78.png CHANGED
Binary file
data/doc/dot/f_79.png CHANGED
Binary file
data/doc/dot/m_50_0.png CHANGED
Binary file
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Sep 03 15:49:58 +0200 2007</td>
59
+ <td>Tue Sep 04 22:56:19 +0200 2007</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -74,7 +74,46 @@
74
74
  </div>
75
75
 
76
76
  <div id="description">
77
- <h2>0.8.0 2007-09-03</h2>
77
+ <h2>0.8.1 2007-09-04</h2>
78
+ <ul>
79
+ <li>Localized &quot;Notes&quot; string.
80
+
81
+ </li>
82
+ <li>Split <a href="../classes/Backlog.html">Backlog</a> Edit View into Edit for
83
+ options and Show for tasks for less clutter. Tasks are probably viewed way
84
+ more often than options.
85
+
86
+ </li>
87
+ <li>Added file upload to create task view.
88
+
89
+ </li>
90
+ <li>Changed to allow editing of tasks not in any sprint.
91
+
92
+ </li>
93
+ <li>Fixed bug where estimates were not updated in the <a
94
+ href="../classes/Task.html">Task</a> update view.
95
+
96
+ </li>
97
+ <li>Fixed bug when finishing a task by setting estimate to 0 in the task edit
98
+ view.
99
+
100
+ </li>
101
+ <li>Added links to edit and show a backlog in the backlog and sprint views.
102
+
103
+ </li>
104
+ <li>Changed link in the <a href="../classes/Backlog.html">Backlog</a> List view
105
+ to go to the backlog Show view instead of the backlog edit view.
106
+
107
+ </li>
108
+ <li>Improved work flow when adding a task from the show sprint view.
109
+
110
+ </li>
111
+ <li>Removed faulty link from <a href="../classes/Backlog.html">Backlog</a> view
112
+ for Unplanned tasks.
113
+
114
+ </li>
115
+ </ul>
116
+ <h2>0.8.0 2007-09-03</h2>
78
117
  <ul>
79
118
  <li>FEATURE: Added notes and files to tasks.
80
119
 
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri Aug 17 00:33:54 +0200 2007</td>
59
+ <td>Tue Sep 04 09:09:43 +0200 2007</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Sep 03 12:23:59 +0200 2007</td>
59
+ <td>Tue Sep 04 09:10:55 +0200 2007</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
data/doc/index.html CHANGED
@@ -5,12 +5,12 @@
5
5
 
6
6
  <!--
7
7
 
8
- backlog's backlog-0.8.0 Documentation
8
+ backlog's backlog-0.8.1 Documentation
9
9
 
10
10
  -->
11
11
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
12
12
  <head>
13
- <title> backlog's backlog-0.8.0 Documentation</title>
13
+ <title> backlog's backlog-0.8.1 Documentation</title>
14
14
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
15
15
  </head>
16
16
  <frameset rows="20%, 80%">
data/lang/en.yaml CHANGED
@@ -58,6 +58,7 @@ new_task: Add new task
58
58
  new_work: Add new work record
59
59
  next: Next
60
60
  no_pending_tasks: There are no pending tasks in this sprint.
61
+ notes: Notes
61
62
  password: Password
62
63
  period: Sprint
63
64
  periods: Sprints
data/lang/no.yaml CHANGED
@@ -58,6 +58,7 @@ new_task: Legg til ny oppgave
58
58
  new_work: Registrer arbeid
59
59
  next: Neste
60
60
  no_pending_tasks: Det er ingen ventende oppgaver i denne perioden.
61
+ notes: Notater
61
62
  password: Passord
62
63
  period: Periode
63
64
  periods: Perioder
@@ -42,4 +42,16 @@ not_planned:
42
42
  backlog_id: 1
43
43
  description: unplanned task
44
44
  position: 1
45
-
45
+ supertask:
46
+ id: 7
47
+ created_at: 2007-06-12
48
+ backlog_id: 1
49
+ period_id: 2
50
+ description: super task
51
+ position: 3
52
+ subtask:
53
+ id: 8
54
+ created_at: 2007-06-12
55
+ parent_id: 7
56
+ description: sub task
57
+ position: 1
@@ -42,8 +42,11 @@ class BacklogsControllerTest < Test::Unit::TestCase
42
42
  def test_show
43
43
  get :show, :id => 1
44
44
 
45
- assert_response :redirect
46
- assert_redirected_to :controller => 'periods', :action => :show
45
+ assert_response :success
46
+ assert_template 'show'
47
+
48
+ assert_not_nil assigns(:backlog)
49
+ assert assigns(:backlog).valid?
47
50
  end
48
51
 
49
52
  def test_new
@@ -90,6 +90,20 @@ class TasksControllerTest < Test::Unit::TestCase
90
90
  assert assigns(:task).valid?
91
91
  end
92
92
 
93
+ def test_set_task_description
94
+ post :set_task_description, "id"=>"2", :value => 'New value'
95
+
96
+ after = Task.find(2)
97
+ assert_equal 'New value', after.description
98
+ end
99
+
100
+ def test_set_task_description_on_subtask
101
+ post :set_task_description, "id"=>"8", :value => 'New value'
102
+
103
+ after = Task.find(8)
104
+ assert_equal 'New value', after.description
105
+ end
106
+
93
107
  def test_specify
94
108
  post :specify, "id"=>"2"
95
109
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: backlog
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.8.0
7
- date: 2007-09-03 00:00:00 +02:00
6
+ version: 0.8.1
7
+ date: 2007-09-05 00:00:00 +02:00
8
8
  summary: Application to aid collecting, processing, organizing, reviewing and doing tasks.
9
9
  require_paths:
10
10
  - lib
@@ -136,7 +136,6 @@ files:
136
136
  - db/migrate/005_add_field_work_started_at.rb
137
137
  - db/migrate/006_works_data_fix.rb
138
138
  - db/schema.rb
139
- - post-clean.rb
140
139
  - test
141
140
  - test/integration
142
141
  - test/integration/user_system_test.rb
@@ -2485,8 +2484,6 @@ files:
2485
2484
  - app/views/periods/_title.rhtml
2486
2485
  - app/views/periods/_link.rhtml
2487
2486
  - app/views/periods/_burn_down_chart.rhtml
2488
- - post-setup.rb
2489
- - post-install.rb
2490
2487
  test_files:
2491
2488
  - test/test_helper.rb
2492
2489
  rdoc_options:
data/post-clean.rb DELETED
@@ -1,12 +0,0 @@
1
- # delete RMagick documentation created by post-setup.rb
2
- # doc/*.rb.html
3
- # doc/ex/* (!rb)
4
- # Bug #246: Don't use chdir!
5
- require 'ftools'
6
-
7
- targets = Dir['doc/*.rb.html']
8
- File.safe_unlink(*targets) unless targets.empty?
9
-
10
- targets = Dir['doc/ex/*']
11
- targets.delete_if { |entry| File.directory?(entry) || %r{\.rb\z}.match(entry) }
12
- File.safe_unlink(*targets) unless targets.empty?
data/post-install.rb DELETED
@@ -1,51 +0,0 @@
1
- # install RMagick documentation
2
-
3
- require 'ftools'
4
- require 'find'
5
-
6
- if defined?(Installer) && self.class == Installer
7
-
8
- BUILD_HTMLDOC = get_config('disable-htmldoc') != 'yes'
9
-
10
- $docdir = nil
11
-
12
- # Where to install the documentation
13
- def docdir
14
- return $docdir if $docdir
15
- dir = get_config('doc-dir')+'/'
16
- dir.sub!(/\A$prefix/, get_config('prefix'))
17
- $docdir = dir
18
- end
19
- else
20
-
21
- BUILD_HTMLDOC = true
22
-
23
- def docdir
24
- return ARGV[0]
25
- end
26
- end
27
-
28
- if BUILD_HTMLDOC
29
-
30
- puts "\npost-install.rb: installing documentation..."
31
-
32
- Find.find('doc') do |file|
33
- next if FileTest.directory? file
34
- target = file.sub(/^doc\//,docdir())
35
- unless FileTest.exists? File.dirname(target)
36
- File.makedirs(File.dirname(target), true)
37
- # Mark this directory as one we created so
38
- # that uninstall.rb knows it's okay to delete
39
- f = File.new("#{File.dirname(target)}/.rmagick", "w")
40
- f.close
41
- end
42
- File.install(file, target, 0644)
43
- end
44
-
45
- else
46
-
47
- puts "\npost-install.rb: --disable-htmldoc specified. No documentation will be installed."
48
-
49
- end
50
-
51
- exit
data/post-setup.rb DELETED
@@ -1,254 +0,0 @@
1
- #===============================================================================
2
- # post-setup.rb - setup documentation
3
- #===============================================================================
4
-
5
- EXAMPLES = '.examples'
6
- STD_URI = 'http:\/\/www.imagemagick.org'
7
- STD_URI_RE = /"#{STD_URI}/
8
- DONT_RUN = ['fonts.rb'] # never run these examples
9
- ENTITY = Hash['&' => '&amp;', '>' => '&gt;', '<' => '&lt;']
10
-
11
- if defined?(Installer) && self.class == Installer
12
-
13
- RUBYPROG = get_config('ruby-prog')
14
- SRCDIR = curr_srcdir()
15
- ALLOW_EXAMPLE_ERRORS = get_config('allow-example-errors') == 'yes'
16
- BUILD_HTMLDOC = get_config('disable-htmldoc') != 'yes'
17
-
18
- else
19
-
20
- RUBYPROG = 'ruby'
21
- SRCDIR = '.'
22
- ALLOW_EXAMPLE_ERRORS = true
23
- BUILD_HTMLDOC = true
24
-
25
- end
26
-
27
-
28
- #
29
- # A set of example programs in a directory and the output image each example produces.
30
- #
31
-
32
- class ExampleSet
33
- def initialize(of)
34
- @status_quo = get_status_quo()
35
- @errs = 0
36
- begin
37
- File.open(EXAMPLES) do |f|
38
- @targets = Marshal.load(f)
39
- end
40
- rescue
41
- @targets = Hash.new
42
- @n = 0
43
- @of = of
44
- @first_time = true
45
- else
46
- @first_time = false
47
- end
48
- end
49
-
50
- def persist
51
- File.open(EXAMPLES, 'w') do |f|
52
- Marshal.dump(@targets, f)
53
- end
54
- end
55
-
56
- def targets(example)
57
- @targets[example] || Array.new
58
- end
59
-
60
- def get_status_quo
61
- sq = Dir["*"]
62
- sq.delete_if { |entry| File.directory?(entry) }
63
- end
64
-
65
- def update_targets(example, new)
66
- t = targets(example) + new
67
- @targets[example] = t.uniq
68
- end
69
-
70
- def update_status_quo(example)
71
- new_status_quo = get_status_quo()
72
- new = new_status_quo - @status_quo
73
- update_targets(example, new)
74
- @status_quo = new_status_quo
75
- end
76
-
77
- def build(example)
78
- cmd = "#{RUBYPROG} -I #{SRCDIR}/lib -I #{SRCDIR}/ext/RMagick #{example}"
79
- print cmd
80
- print " (example #{@n += 1} of #{@of})" if @first_time
81
- puts
82
- system cmd
83
-
84
- if $? != 0 then
85
- puts("post-setup.rb: #{example} example returned error code #{$?}")
86
- @errs += 1 unless ALLOW_EXAMPLE_ERRORS
87
- if @errs > 4
88
- err(<<-END_EXFAIL
89
- Too many examples failed. Search for "Help!" at
90
- http://rmagick.rubyforge.org/install-faq.html.
91
- END_EXFAIL
92
- )
93
- end
94
- end
95
-
96
- update_status_quo(example)
97
- end
98
-
99
- def update(example)
100
- targets = targets(example)
101
- up_to_date = ! targets.empty?
102
- targets.each do |target|
103
- up_to_date &&= File.exists?(target) && (File.stat(target) >= File.stat(example))
104
- end
105
- build(example) unless up_to_date
106
- end
107
-
108
- #
109
- # print message and exit
110
- #
111
- def err(msg)
112
- $stderr.puts "#{$0}: #{msg}"
113
- exit 1
114
- end
115
-
116
- end
117
-
118
-
119
- #
120
- # Modify file lines via proc. If no lines changed, discard new version.
121
- #
122
- def filter(filename, backup=nil, &filter)
123
- if ! File.writable? filename then
124
- raise ArgumentError, "`#{filename}' is write-protected"
125
- end
126
-
127
- backup_name = filename + '.' + (backup || 'old')
128
- File.rename(filename, backup_name)
129
- changed = false
130
- begin
131
- File.open(filename, 'w') do |output|
132
- File.foreach(backup_name) do |line|
133
- old = line
134
- line = filter.call(line)
135
- output.puts(line)
136
- changed ||= line != old
137
- end
138
- end
139
- rescue
140
- File.rename(backup_name, filename)
141
- raise
142
- end
143
-
144
- if !changed
145
- newname = filename + '.xxx'
146
- File.rename(filename, newname)
147
- File.rename(backup_name, filename)
148
- File.unlink(newname)
149
- elsif !backup
150
- # Don't remove old copy if a backup extension was specified
151
- File.unlink(backup_name) rescue nil
152
- end
153
- end
154
-
155
-
156
- #
157
- # Copy an example to the doc directory, wrap in HTML tags
158
- #
159
- def filetoHTML(file, html)
160
- return if File.exists?(html) && File.stat(html) >= File.stat(file)
161
-
162
- File.open(file) do |src|
163
- File.open(html, 'w') do |dest|
164
- dest.puts <<-END_EXHTMLHEAD
165
- <!DOCTYPE public PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
166
- <html xmlns="http://www.w3.org/1999/xhtml">
167
- <head>
168
- <meta name="generator" content="ex2html.rb" />
169
- <meta http-equiv="Content-Type" content=
170
- "text/html; charset=us-ascii" />
171
- <link rel="stylesheet" type="text/css" href="css/popup.css" />
172
-
173
- <title>RMagick example: #{file}</title>
174
- </head>
175
-
176
- <body>
177
- <h1>#{file}</h1>
178
- <div class="bodybox">
179
- <div class="bodyfloat">
180
- <pre>
181
- END_EXHTMLHEAD
182
-
183
- src.each do |line|
184
- line.gsub!(/[&><]/) { |s| ENTITY[s] }
185
- dest.puts(line)
186
- end
187
-
188
- dest.puts <<-END_EXHTMLTAIL
189
- </pre>
190
- </div>
191
- </div>
192
- <div id="close"><a href="javascript:window.close();">Close window</a></div>
193
- </body>
194
- </html>
195
- END_EXHTMLTAIL
196
- end
197
- File.chmod(0644, html)
198
- end
199
-
200
- end
201
-
202
- puts "setup.rb: entering post-setup phase..."
203
-
204
-
205
- if BUILD_HTMLDOC
206
-
207
- #
208
- # Don't bother if we're in the sandbox
209
- #
210
- if File.exists? 'CVS/Entries'
211
- puts "post-setup.rb: in CVS sandbox - stopping..."
212
- exit
213
- end
214
-
215
- puts "post-setup.rb: setting up documentation..."
216
-
217
- # We're in the source directory. Process the doc in-place. The post-install.rb
218
- # script moves the generated documentation to the ultimate installation directories.
219
-
220
- cwd = Dir.getwd()
221
- Dir.chdir('doc') # need to work with 1.6.x, can't use block form
222
- begin
223
-
224
- # Step 1A: edit the shebang line in the examples
225
- Dir.chdir('ex')
226
- files = Dir['*.rb']
227
- files.each do |file|
228
- filter(file) { |line| line.sub(/\A\#!\s*\S*ruby\s/, '#!'+RUBYPROG+' ') }
229
-
230
- # Step 1B: Make a copy of the example as HTML in the doc directory
231
- filetoHTML(file, "../#{file}.html")
232
- end
233
-
234
- # Step 2: run the examples
235
- examples = Dir['*.rb'].sort
236
- examples -= DONT_RUN
237
- es = ExampleSet.new(examples.length)
238
- begin
239
- examples.each { |example| es.update(example) }
240
- ensure
241
- es.persist
242
- end
243
-
244
- ensure
245
- Dir.chdir(cwd)
246
- end
247
-
248
- else
249
-
250
- puts "post-setup.rb: --disable-htmldoc specified. No documentation will be set up."
251
-
252
- end
253
-
254
- exit