damagecontrol 0.5.0 → 0.5.0.1391

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. data/README +67 -11
  2. data/Rakefile +15 -6
  3. data/app/controllers/admin_controller.rb +0 -3
  4. data/app/controllers/application.rb +42 -163
  5. data/app/controllers/build_controller.rb +33 -0
  6. data/app/controllers/files_controller.rb +1 -1
  7. data/app/controllers/project_controller.rb +23 -65
  8. data/app/controllers/rails_ext.rb +247 -0
  9. data/app/controllers/rscm_ext.rb +52 -0
  10. data/app/helpers/build_helper.rb +2 -0
  11. data/app/views/build/email.rhtml +18 -0
  12. data/app/views/build/status.rhtml +20 -0
  13. data/app/views/build/tests.rhtml +2 -0
  14. data/app/views/layouts/{rscm.rhtml → default.rhtml} +10 -4
  15. data/app/views/project/_changesets_list.rhtml +2 -2
  16. data/app/views/project/_cvs.rhtml +4 -5
  17. data/app/views/project/_project.rhtml +9 -9
  18. data/app/views/project/_select_pane.rhtml +26 -0
  19. data/app/views/project/_tab_pane.rhtml +23 -0
  20. data/app/views/project/changeset.rhtml +35 -0
  21. data/app/views/project/view.rhtml +18 -32
  22. data/app/views/setup/welcome.rhtml +118 -0
  23. data/config/database.yml +20 -20
  24. data/config/environment.rb +66 -60
  25. data/config/environments/development.rb +3 -2
  26. data/config/environments/production.rb +3 -2
  27. data/config/environments/test.rb +3 -2
  28. data/config/routes.rb +15 -0
  29. data/lib/damagecontrol/app.rb +11 -40
  30. data/lib/damagecontrol/build.rb +50 -8
  31. data/lib/damagecontrol/directories.rb +7 -6
  32. data/lib/damagecontrol/poller.rb +11 -20
  33. data/lib/damagecontrol/project.rb +83 -16
  34. data/lib/damagecontrol/publisher/ambient_orb.rb +16 -0
  35. data/lib/damagecontrol/publisher/archive.rb +16 -0
  36. data/lib/damagecontrol/publisher/base.rb +25 -0
  37. data/lib/damagecontrol/publisher/build_duration.rb +16 -0
  38. data/lib/damagecontrol/publisher/email.rb +59 -0
  39. data/lib/damagecontrol/publisher/execute.rb +49 -0
  40. data/lib/damagecontrol/publisher/ftp.rb +16 -0
  41. data/lib/damagecontrol/publisher/growl.rb +44 -0
  42. data/lib/damagecontrol/publisher/irc.rb +31 -0
  43. data/lib/damagecontrol/publisher/jabber.rb +68 -0
  44. data/lib/damagecontrol/publisher/scp.rb +16 -0
  45. data/lib/damagecontrol/publisher/x10cm11a.rb +17 -0
  46. data/lib/damagecontrol/publisher/x10cm17a.rb +17 -0
  47. data/lib/damagecontrol/publisher/yahoo.rb +16 -0
  48. data/lib/damagecontrol/standard_persister.rb +2 -2
  49. data/lib/damagecontrol/tracker.rb +48 -6
  50. data/lib/damagecontrol/visitor/rss_writer.rb +1 -1
  51. data/lib/damagecontrol/visitor/yaml_persister.rb +10 -1
  52. data/public/404.html +5 -5
  53. data/public/500.html +5 -5
  54. data/public/dispatch.cgi +2 -2
  55. data/public/dispatch.fcgi +1 -1
  56. data/public/dispatch.rb +2 -2
  57. data/public/images/growlicon.png +0 -0
  58. data/public/images/megaphone.png +0 -0
  59. data/public/images/monotone-logo.png +0 -0
  60. data/public/images/publisher/ambient_orb.png +0 -0
  61. data/public/images/publisher/build_duration.png +0 -0
  62. data/public/images/publisher/email.png +0 -0
  63. data/public/images/publisher/execute.png +0 -0
  64. data/public/images/publisher/growl.png +0 -0
  65. data/public/images/publisher/irc.png +0 -0
  66. data/public/images/publisher/jabber.png +0 -0
  67. data/public/images/publisher/x10cm11a.png +0 -0
  68. data/public/images/publisher/x10cm17a.png +0 -0
  69. data/public/images/publisher/yahoo.png +0 -0
  70. data/public/index.html +70 -1
  71. data/public/javascripts/dateFormat.js +283 -0
  72. data/public/javascripts/jscalendar/ChangeLog +500 -0
  73. data/public/javascripts/jscalendar/README +33 -0
  74. data/public/javascripts/jscalendar/bugtest-hidden-selects.html +108 -0
  75. data/public/javascripts/jscalendar/calendar-blue.css +231 -0
  76. data/public/javascripts/jscalendar/calendar-blue2.css +235 -0
  77. data/public/javascripts/jscalendar/calendar-brown.css +224 -0
  78. data/public/javascripts/jscalendar/calendar-green.css +228 -0
  79. data/public/javascripts/jscalendar/calendar-setup.js +181 -0
  80. data/public/javascripts/jscalendar/calendar-setup_stripped.js +21 -0
  81. data/public/javascripts/jscalendar/calendar-system.css +250 -0
  82. data/public/javascripts/jscalendar/calendar-tas.css +238 -0
  83. data/public/javascripts/jscalendar/calendar-win2k-1.css +270 -0
  84. data/public/javascripts/jscalendar/calendar-win2k-2.css +270 -0
  85. data/public/javascripts/jscalendar/calendar-win2k-cold-1.css +264 -0
  86. data/public/javascripts/jscalendar/calendar-win2k-cold-2.css +270 -0
  87. data/public/javascripts/jscalendar/calendar.js +1715 -0
  88. data/public/javascripts/jscalendar/calendar.php +119 -0
  89. data/public/javascripts/jscalendar/calendar_stripped.js +12 -0
  90. data/public/javascripts/jscalendar/doc/html/reference-Z-S.css +0 -0
  91. data/public/javascripts/jscalendar/doc/html/reference.css +34 -0
  92. data/public/javascripts/jscalendar/doc/html/reference.html +1316 -0
  93. data/public/javascripts/jscalendar/doc/reference.pdf +0 -0
  94. data/public/javascripts/jscalendar/img.gif +0 -0
  95. data/public/javascripts/jscalendar/index.html +333 -0
  96. data/public/javascripts/jscalendar/lang/calendar-af.js +39 -0
  97. data/public/javascripts/jscalendar/lang/calendar-br.js +45 -0
  98. data/public/javascripts/jscalendar/lang/calendar-ca.js +45 -0
  99. data/public/javascripts/jscalendar/lang/calendar-cs-win.js +34 -0
  100. data/public/javascripts/jscalendar/lang/calendar-da.js +63 -0
  101. data/public/javascripts/jscalendar/lang/calendar-de.js +100 -0
  102. data/public/javascripts/jscalendar/lang/calendar-du.js +45 -0
  103. data/public/javascripts/jscalendar/lang/calendar-el.js +89 -0
  104. data/public/javascripts/jscalendar/lang/calendar-en.js +123 -0
  105. data/public/javascripts/jscalendar/lang/calendar-es.js +114 -0
  106. data/public/javascripts/jscalendar/lang/calendar-fi.js +98 -0
  107. data/public/javascripts/jscalendar/lang/calendar-fr.js +86 -0
  108. data/public/javascripts/jscalendar/lang/calendar-hr-utf8.js +49 -0
  109. data/public/javascripts/jscalendar/lang/calendar-hr.js +0 -0
  110. data/public/javascripts/jscalendar/lang/calendar-hu.js +45 -0
  111. data/public/javascripts/jscalendar/lang/calendar-it.js +79 -0
  112. data/public/javascripts/jscalendar/lang/calendar-jp.js +45 -0
  113. data/public/javascripts/jscalendar/lang/calendar-ko-utf8.js +120 -0
  114. data/public/javascripts/jscalendar/lang/calendar-ko.js +120 -0
  115. data/public/javascripts/jscalendar/lang/calendar-lt-utf8.js +114 -0
  116. data/public/javascripts/jscalendar/lang/calendar-lt.js +114 -0
  117. data/public/javascripts/jscalendar/lang/calendar-nl.js +45 -0
  118. data/public/javascripts/jscalendar/lang/calendar-no.js +45 -0
  119. data/public/javascripts/jscalendar/lang/calendar-pl-utf8.js +93 -0
  120. data/public/javascripts/jscalendar/lang/calendar-pl.js +56 -0
  121. data/public/javascripts/jscalendar/lang/calendar-pt.js +45 -0
  122. data/public/javascripts/jscalendar/lang/calendar-ro.js +66 -0
  123. data/public/javascripts/jscalendar/lang/calendar-ru.js +45 -0
  124. data/public/javascripts/jscalendar/lang/calendar-si.js +94 -0
  125. data/public/javascripts/jscalendar/lang/calendar-sk.js +99 -0
  126. data/public/javascripts/jscalendar/lang/calendar-sp.js +63 -0
  127. data/public/javascripts/jscalendar/lang/calendar-sv.js +93 -0
  128. data/public/javascripts/jscalendar/lang/calendar-tr.js +58 -0
  129. data/public/javascripts/jscalendar/lang/calendar-zh.js +45 -0
  130. data/public/javascripts/jscalendar/menuarrow.gif +0 -0
  131. data/public/javascripts/jscalendar/menuarrow2.gif +0 -0
  132. data/public/javascripts/jscalendar/release-notes.html +334 -0
  133. data/public/javascripts/jscalendar/simple-1.html +244 -0
  134. data/public/javascripts/jscalendar/simple-2.html +108 -0
  135. data/public/javascripts/jscalendar/simple-3.html +130 -0
  136. data/public/javascripts/jscalendar/test-position.html +40 -0
  137. data/public/javascripts/jscalendar/test.php +116 -0
  138. data/public/javascripts/toggle_div.js +18 -0
  139. data/public/stylesheets/niceones.txt +1 -0
  140. data/public/stylesheets/style.css +8 -1
  141. data/script/breakpointer +4 -5
  142. data/script/console +19 -27
  143. data/script/console_sandbox.rb +7 -0
  144. data/script/destroy +5 -0
  145. data/script/generate +3 -68
  146. data/script/server +6 -16
  147. data/test/damagecontrol/build_test.rb +8 -8
  148. data/test/damagecontrol/poller_test.rb +10 -18
  149. data/test/damagecontrol/project_test.rb +49 -13
  150. data/test/damagecontrol/publisher/base_test.rb +26 -0
  151. data/test/damagecontrol/publisher/build/email.rhtml +0 -0
  152. data/test/damagecontrol/publisher/email_test.rb +26 -0
  153. data/test/damagecontrol/publisher/fixture.rb +34 -0
  154. data/test/damagecontrol/publisher/growl_test.rb +15 -0
  155. data/test/damagecontrol/publisher/jabber_test.rb +15 -0
  156. data/test/damagecontrol/scm_web_test.rb +1 -1
  157. data/test/damagecontrol/visitor/changesets.rss +1 -1
  158. data/test/damagecontrol/visitor/diff_persister_test.rb +4 -4
  159. data/test/functional/build_controller_test.rb +17 -0
  160. data/test/test_helper.rb +13 -13
  161. metadata +185 -24
  162. data/app/views/project/_bugzilla.rhtml +0 -13
  163. data/app/views/project/_jira.rhtml +0 -19
  164. data/app/views/project/_mooky.rhtml +0 -23
  165. data/app/views/project/_rubyforge.rhtml +0 -19
  166. data/app/views/project/_scarab.rhtml +0 -19
  167. data/app/views/project/_scms.rhtml +0 -15
  168. data/app/views/project/_sourceforge.rhtml +0 -19
  169. data/app/views/project/_starteam.rhtml +0 -43
  170. data/app/views/project/_svn.rhtml +0 -22
  171. data/app/views/project/_trac.rhtml +0 -13
  172. data/app/views/project/_trackers.rhtml +0 -18
  173. data/app/views/project/changesets.rhtml +0 -31
@@ -3,6 +3,7 @@ var project_name_page_tip = "<div class='tp1'>The project name should not use sp
3
3
  var build_command_tip = "<div class='tp1'>The command-line that will execute the build.</div>";
4
4
  var project_description_tip = "<div class='tp1'>A short description of the project. Will be used in various notifications such as RSS.</div>";
5
5
  var project_home_page_tip = "<div class='tp1'>URL to the project's home page or documentation.</div>";
6
+ var project_start_time_tip = "<div class='tp1'>Date from which changesets will be retrieved.</div>";
6
7
  </script>
7
8
 
8
9
  <input name="project" type="hidden" value="<%= project.class.name %>"/>
@@ -12,25 +13,24 @@ var project_home_page_tip = "<div class='tp1'>URL to the project's home page or
12
13
  <td width="25%" class="setting-name">Project name</td>
13
14
  <td><%= tip(:txt => 'project_name_page_tip') %></td>
14
15
  <td width="75%">
15
- <%= text_or_input(@new_project, :name => "DamageControl::Project[name]", :value => project.name) %>
16
+ <%= text_or_input(@new_project, :name => "DamageControl::Project[@name]", :value => project.name) %>
16
17
  <% if(@edit) %>
17
- <%= tag("input", :type => "hidden", :name => "DamageControl::Project[name]", :value => project.name) %>
18
+ <%= tag("input", :type => "hidden", :name => "DamageControl::Project[@name]", :value => project.name) %>
18
19
  <% end %>
19
20
  </td>
20
21
  </tr>
21
22
  <tr>
22
23
  <td>Build command</td>
23
24
  <td><%= tip(:txt => 'build_command_tip') %></td>
24
- <td><%= text_or_input(@edit, :name => "DamageControl::Project[build_command]", :value => project.build_command) %></td>
25
- </tr>
26
- <tr>
27
- <td>Project description</td>
28
- <td><%= tip(:txt => 'project_description_tip') %></td>
29
- <td><%= text_or_input(@edit, :name => "DamageControl::Project[description]", :value => project.description) %></td>
25
+ <td><%= text_or_input(@edit, :name => "DamageControl::Project[@build_command]", :value => project.build_command) %></td>
30
26
  </tr>
31
27
  <tr>
32
28
  <td>Project home page</td>
33
29
  <td><%= tip(:txt => 'project_home_page_tip') %></td>
34
- <td><%= text_or_input(@edit, :name => "DamageControl::Project[home_page]", :value => project.home_page) %></td>
30
+ <td><%= text_or_input(@edit, :name => "DamageControl::Project[@home_page]", :value => project.home_page) %></td>
35
31
  </tr>
32
+ <tr>
33
+ <td>Start date</td>
34
+ <td><%= tip(:txt => 'project_start_time_tip') %></td>
35
+ <td><%= calendar(:name => "DamageControl::Project[@start_time]", :time => project.start_time ? project.start_time : Time.new.utc) %></td>
36
36
  </table>
@@ -0,0 +1,26 @@
1
+ <script>
2
+ <%= select_pane.name %>_array = [
3
+ <% select_pane.each do |o| %>
4
+ "<%= o.class.name %>",
5
+ <% end %> "" ];
6
+ </script>
7
+
8
+ <table>
9
+ <tr>
10
+ <td>
11
+ <%= select_pane.description %>
12
+ </td>
13
+ <td>
14
+ <%= text_or_select(@edit,
15
+ :name => "#{select_pane.name}_selected",
16
+ :values => select_pane,
17
+ :onchange => "showElement(this.value, #{select_pane.name}_array)") %>
18
+ </td>
19
+ </tr>
20
+ </table>
21
+
22
+ <% select_pane.each do |o| %>
23
+ <div id="<%= o.class.name %>" style="<% if(o.selected?)%>display:block<%else%>display:none<%end%>">
24
+ <%= render_object(o, select_pane.name, @edit) %>
25
+ </div>
26
+ <% end %>
@@ -0,0 +1,23 @@
1
+ <script><!--
2
+ <%= tab_pane.name %> = [
3
+ <% tab_pane.each do |o| %>
4
+ "<%= o.class.name %>",
5
+ <% end %> "" ];
6
+ --></script>
7
+
8
+ <ul id="foldertab">
9
+ <% tab_pane.each do |o| %>
10
+ <li>
11
+ <a alt="<%= o.name %>" href="javascript:showElement('<%= o.class.name %>', <%= tab_pane.name %>)">
12
+ <img src="/images/publisher/<%= underscore(demodulize(o.class.name)) %>.png">
13
+ </a>
14
+ <%= text_or_checkbox(:name => "#{tab_pane.name}[#{o.class.name}][@enabled]", :value => o.enabled, :editable => @edit) %>
15
+ </li>
16
+ <% end %>
17
+ </ul>
18
+
19
+ <% tab_pane.each do |o| %>
20
+ <div id="<%= o.class.name %>" style="<% if(o.selected?)%>display:block<%else%>display:none<%end%>">
21
+ <%= render_object(o, tab_pane.name, @edit) %>
22
+ </div>
23
+ <% end %>
@@ -0,0 +1,35 @@
1
+ <ul id="foldertab">
2
+ <li><a href="javascript:setTab('changesets')"><img src="/images/16x16/document_exchange.png"> Changesets</a></li>
3
+ <% @project.builds(@changeset.identifier).each do |build| %>
4
+ <li><%= link_to(build.identifier,
5
+ :controller => "build", :action => "status", :id => @project.name, :params =>
6
+ {"changeset" => @changeset.identifier, "build" => build.identifier}) %></li>
7
+ <% end %>
8
+ </ul>
9
+
10
+ <table class="pane">
11
+ <tr class="pane">
12
+ <td colspan="3" class="changeset">
13
+ <div class="changeset-message">
14
+ <b><%= @changeset.developer %></b>
15
+ (<%= @changeset.time.to_human %> UTC)<br>
16
+ <%= @project.tracker.highlight(@changeset.message) %>
17
+ </div>
18
+ </td>
19
+ </tr>
20
+ <%
21
+ @changeset.each do |change|
22
+ %>
23
+ <tr>
24
+ <td width="5%"><%= tag("img", :src => change.icon) %></td>
25
+ <td width="5%"><%= change.revision %></td>
26
+ <td width="90%">
27
+ <a class="diff-toggle" href="#" onclick="toggleCode('<%= change.path %>');return false"><%= change.path %></a>
28
+ <br>
29
+ <div class="diff" id="<%= change.path %>">
30
+ <%= change.html_diff %>
31
+ </div>
32
+ </td>
33
+ </tr>
34
+ <% end %>
35
+ </table>
@@ -1,10 +1,5 @@
1
1
  <script><!--
2
2
 
3
- function setTab(tab) {
4
- stickyTab = tab
5
- showElement(stickyTab, tabs)
6
- }
7
-
8
3
  function executeOnLoad() {
9
4
  <% @scms.each do |scm| %>
10
5
  <%= scm.short %>_init();
@@ -13,30 +8,7 @@ function executeOnLoad() {
13
8
  setTab(tab)
14
9
  }
15
10
 
16
- function showElement(selected, elements) {
17
- // hide all divs in the group unless selected
18
- for(element in elements) {
19
- id = elements[element]
20
- style = "none"
21
- if(id == selected) {
22
- style = "block"
23
- }
24
- document.getElementById(id).style.display = style
25
- }
26
- }
27
-
28
- tabs = ["projects", "scms", "trackers", "changesets"]
29
-
30
- scms = [
31
- <% @scms.each do |scm| %>
32
- "<%= scm.class.name %>",
33
- <% end %> "" ];
34
- scm_tip = "<div class='tp1'>If you don't find your SCM here, file a feature request in DamageControl's JIRA</div>";
35
-
36
- trackers = [
37
- <% @trackers.each do |tracker| %>
38
- "<%= tracker.class.name %>",
39
- <% end %> "" ];
11
+ tabs = ["projects", "scms", "publishers", "trackers"]
40
12
 
41
13
  // -->
42
14
  </script>
@@ -44,11 +16,12 @@ trackers = [
44
16
  <ul id="foldertab">
45
17
  <li><a href="javascript:setTab('projects')"><img src="/images/16x16/wrench.png"> General</a></li>
46
18
  <li><a href="javascript:setTab('scms')"><img src="/images/16x16/safe.png"> Source Control</a></li>
19
+ <li><a href="javascript:setTab('publishers')"><img src="/images/megaphone.png"> Publishers</a></li>
47
20
  <li><a href="javascript:setTab('trackers')"><img src="/images/16x16/scroll_information.png"> Issue Tracker</a></li>
48
21
  </ul>
49
22
 
50
23
  <% if(@edit) %>
51
- <form action="/project/save">
24
+ <form name="project_form" action="/project/save">
52
25
  <% end %>
53
26
 
54
27
  <div id="projects" style="display:block">
@@ -56,11 +29,24 @@ trackers = [
56
29
  </div>
57
30
 
58
31
  <div id="scms" style="display:none">
59
- <%= render_partial("scms", @scms) %>
32
+ <p>
33
+ If you don't find your SCM here, file a feature request in DamageControl's
34
+ <a href="http://damagecontrol.codehaus.org/">JIRA</a>.
35
+ </p>
36
+ <p>
37
+ Or better - <a href="http://rscm.rubyforge.org/">implement it yourself</a>.
38
+ </p>
39
+
40
+ <%= select_pane("Source Control", "scms", @scms) %>
41
+ </div>
42
+
43
+ <div id="publishers" style="display:none">
44
+ Publishers give feedback of the results of a build. Publishers run after a build is executed.
45
+ <%= tab_pane("publishers", @project.publishers) %>
60
46
  </div>
61
47
 
62
48
  <div id="trackers" style="display:none">
63
- <%= render_partial("trackers", @trackers) %>
49
+ <%= select_pane("Issue Trackers", "trackers", @trackers) %>
64
50
  </div>
65
51
 
66
52
  <% if(@edit) %>
@@ -0,0 +1,118 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>
5
+
6
+ Instiki Setup
7
+
8
+ </title>
9
+
10
+ <style type="text/css">
11
+ h1#pageName, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, #TextileHelp h3 {
12
+ color: #393;
13
+ }
14
+
15
+ #Container, #Content {
16
+ width: 500px;
17
+ }
18
+
19
+ </style>
20
+
21
+ <link rel="Stylesheet" href="../static_style_sheet/" type="text/css" media="screen" />
22
+
23
+ <style type="text/css">
24
+
25
+
26
+ </style>
27
+ </head>
28
+ <body>
29
+ <div id="Container">
30
+ <div id="Content">
31
+
32
+ <h1 id="pageName">
33
+
34
+ Instiki Setup
35
+
36
+ </h1>
37
+
38
+
39
+
40
+ <p>
41
+ Congratulations on succesfully installing and starting Instiki.
42
+ Since this is the first time Instiki has been run on this port, you'll need to do a brief one-time setup.
43
+ </p>
44
+
45
+ <form action="../create_system" id="setup" method="post" onSubmit="return validateSetup()">
46
+ <ol class="setup">
47
+ <li>
48
+
49
+ <h2 style="margin-bottom: 3px">Name and address for your first web</h2>
50
+ <div class="help">
51
+ The name of the web is included in the title on all pages. The address is the base path that all pages within the web live beneath. Ex: the address "rails" gives URLs like <i>/rails/show/HomePage</i>. The address can only consist of letters & digits.
52
+ </div>
53
+ <div class="inputBox">
54
+ Name: <input type="text" id="web_name" name="web_name" value="Wiki" onChange="proposeAddress();"
55
+ onClick="this.value == 'Wiki' ? this.value = '' : true"> &nbsp;&nbsp;
56
+ Address: <input type="text" id="web_address" name="web_address" onChange="cleanAddress();" value="wiki">
57
+ </div>
58
+ </li>
59
+
60
+ <li>
61
+ <h2 style="margin-bottom: 3px">Password for creating and changing webs</h2>
62
+ <div class="help">
63
+ Administrative access allows you to make new webs and change existing ones.<br/>
64
+ Everyone with this password will be able to do this, so pick it carefully.
65
+ </div>
66
+ <div class="inputBox">
67
+ Password: <input type="password" id="password" name="password"> &nbsp;&nbsp;
68
+ Verify: <input type="password" id="password_check" name="password_check">
69
+ </div>
70
+ </li>
71
+ </ol>
72
+
73
+ <p align="right">
74
+ <input type="submit" value="Setup" style="margin-left: 40px">
75
+ </p>
76
+ </form>
77
+
78
+ <script>
79
+ function proposeAddress() {
80
+ document.getElementById('web_address').value =
81
+ document.getElementById('web_name').value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
82
+ }
83
+
84
+ function cleanAddress() {
85
+ document.getElementById('web_address').value =
86
+ document.getElementById('web_address').value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
87
+ }
88
+
89
+ function validateSetup() {
90
+ if (document.getElementById('web_name').value == "") {
91
+ alert("You must pick a name for the first web");
92
+ return false;
93
+ }
94
+
95
+ if (document.getElementById('web_address').value == "") {
96
+ alert("You must pick an address for the first web");
97
+ return false;
98
+ }
99
+
100
+ if (document.getElementById('password').value == "") {
101
+ alert("You must pick a system password");
102
+ return false;
103
+ }
104
+
105
+ if (document.getElementById('password_check').value == "" ||
106
+ document.getElementById('password').value != document.getElementById('password_check').value) {
107
+ alert("The password and its verification doesn't match");
108
+ return false;
109
+ }
110
+
111
+ return true;
112
+ }
113
+ </script>
114
+
115
+ </div>
116
+ </div>
117
+ </body>
118
+ </html>
@@ -1,20 +1,20 @@
1
- development:
2
- adapter: mysql
3
- database: rails_development
4
- host: localhost
5
- username: root
6
- password:
7
-
8
- test:
9
- adapter: mysql
10
- database: rails_test
11
- host: localhost
12
- username: root
13
- password:
14
-
15
- production:
16
- adapter: mysql
17
- database: rails_production
18
- host: localhost
19
- username: root
20
- password:
1
+ development:
2
+ adapter: mysql
3
+ database: rails_development
4
+ host: localhost
5
+ username: root
6
+ password:
7
+
8
+ test:
9
+ adapter: mysql
10
+ database: rails_test
11
+ host: localhost
12
+ username: root
13
+ password:
14
+
15
+ production:
16
+ adapter: mysql
17
+ database: rails_production
18
+ host: localhost
19
+ username: root
20
+ password:
@@ -1,60 +1,66 @@
1
- RAILS_ROOT = File.dirname(__FILE__) + "/../"
2
- RAILS_ENV = ENV['RAILS_ENV'] || 'development'
3
-
4
-
5
- # Mocks first.
6
- ADDITIONAL_LOAD_PATHS = ["#{RAILS_ROOT}/test/mocks/#{RAILS_ENV}"]
7
-
8
- # Then model subdirectories.
9
- ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[_a-z]*"])
10
-
11
- # Followed by the standard includes.
12
- ADDITIONAL_LOAD_PATHS.concat %w(
13
- app
14
- app/models
15
- app/controllers
16
- app/helpers
17
- config
18
- lib
19
- vendor
20
- ).map { |dir| "#{RAILS_ROOT}/#{dir}" }
21
-
22
- # Prepend to $LOAD_PATH
23
- ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) }
24
-
25
-
26
- # Require Rails gems.
27
- require 'rubygems'
28
- require_gem 'activerecord'
29
- require_gem 'actionpack'
30
- require_gem 'actionmailer'
31
- require_gem 'rails'
32
-
33
-
34
- # Environment-specific configuration.
35
- require_dependency "environments/#{RAILS_ENV}"
36
- ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
37
- ActiveRecord::Base.establish_connection
38
-
39
-
40
- # Configure defaults if the included environment did not.
41
- begin
42
- RAILS_DEFAULT_LOGGER = Logger.new("#{RAILS_ROOT}/log/#{RAILS_ENV}.log")
43
- rescue StandardError
44
- RAILS_DEFAULT_LOGGER = Logger.new(STDERR)
45
- RAILS_DEFAULT_LOGGER.level = Logger::WARN
46
- RAILS_DEFAULT_LOGGER.warn(
47
- "Rails Error: Unable to access log file. Please ensure that log/#{RAILS_ENV}.log exists and is chmod 0777. " +
48
- "The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
49
- )
50
- end
51
-
52
- [ActiveRecord::Base, ActionController::Base, ActionMailer::Base].each do |klass|
53
- klass.logger ||= RAILS_DEFAULT_LOGGER
54
- end
55
- [ActionController::Base, ActionMailer::Base].each do |klass|
56
- klass.template_root ||= "#{RAILS_ROOT}/app/views/"
57
- end
58
-
59
-
60
- # Include your app's configuration here:
1
+ RAILS_ROOT = File.dirname(__FILE__) + "/../"
2
+ RAILS_ENV = ENV['RAILS_ENV'] || 'development'
3
+
4
+
5
+ # Mocks first.
6
+ ADDITIONAL_LOAD_PATHS = ["#{RAILS_ROOT}/test/mocks/#{RAILS_ENV}"]
7
+
8
+ # Then model subdirectories.
9
+ ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[_a-z]*"])
10
+ ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/components/[_a-z]*"])
11
+
12
+ # Followed by the standard includes.
13
+ ADDITIONAL_LOAD_PATHS.concat %w(
14
+ app
15
+ app/models
16
+ app/controllers
17
+ app/helpers
18
+ app/apis
19
+ config
20
+ components
21
+ lib
22
+ vendor
23
+ ).map { |dir| "#{RAILS_ROOT}/#{dir}" }
24
+
25
+ # Prepend to $LOAD_PATH
26
+ ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) }
27
+
28
+
29
+ # Require Rails gems.
30
+ require 'rubygems'
31
+ require_gem 'activesupport'
32
+ require_gem 'activerecord'
33
+ require_gem 'actionpack'
34
+ require_gem 'actionmailer'
35
+ require_gem 'actionwebservice'
36
+ require_gem 'rails'
37
+
38
+
39
+ # Environment-specific configuration.
40
+ require_dependency "environments/#{RAILS_ENV}"
41
+ ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
42
+ ActiveRecord::Base.establish_connection
43
+
44
+
45
+ # Configure defaults if the included environment did not.
46
+ begin
47
+ RAILS_DEFAULT_LOGGER = Logger.new("#{RAILS_ROOT}/log/#{RAILS_ENV}.log")
48
+ rescue StandardError
49
+ RAILS_DEFAULT_LOGGER = Logger.new(STDERR)
50
+ RAILS_DEFAULT_LOGGER.level = Logger::WARN
51
+ RAILS_DEFAULT_LOGGER.warn(
52
+ "Rails Error: Unable to access log file. Please ensure that log/#{RAILS_ENV}.log exists and is chmod 0666. " +
53
+ "The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
54
+ )
55
+ end
56
+
57
+ [ActiveRecord, ActionController, ActionMailer].each { |mod| mod::Base.logger ||= RAILS_DEFAULT_LOGGER }
58
+ [ActionController, ActionMailer].each { |mod| mod::Base.template_root ||= "#{RAILS_ROOT}/app/views/" }
59
+ ActionController::Routing::Routes.reload
60
+
61
+ Controllers = Dependencies::LoadingModule.root(
62
+ File.expand_path(File.join(RAILS_ROOT, 'app', 'controllers')),
63
+ File.expand_path(File.join(RAILS_ROOT, 'components'))
64
+ )
65
+
66
+ # Include your app's configuration here: