gdonald-railsdb 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. data/LICENSE.txt +674 -0
  2. data/README.txt +40 -0
  3. data/README_RAILS.txt +204 -0
  4. data/Rakefile +31 -0
  5. data/app/controllers/application.rb +24 -0
  6. data/app/controllers/database_controller.rb +274 -0
  7. data/app/controllers/home_controller.rb +366 -0
  8. data/app/helpers/application_helper.rb +43 -0
  9. data/app/helpers/home_helper.rb +2 -0
  10. data/app/models/database.rb +113 -0
  11. data/app/models/driver.rb +8 -0
  12. data/app/models/field.rb +117 -0
  13. data/app/models/group.rb +12 -0
  14. data/app/models/group_permission.rb +6 -0
  15. data/app/models/permission.rb +9 -0
  16. data/app/models/row.rb +26 -0
  17. data/app/models/switch.rb +85 -0
  18. data/app/models/table.rb +155 -0
  19. data/app/models/user.rb +98 -0
  20. data/app/models/user_group.rb +6 -0
  21. data/app/views/database/_field.html.erb +20 -0
  22. data/app/views/database/_field_form.html.erb +28 -0
  23. data/app/views/database/_insert_form.html.erb +37 -0
  24. data/app/views/database/_new_field.html.erb +43 -0
  25. data/app/views/database/_new_field_header.html.erb +12 -0
  26. data/app/views/database/_pagination.html.erb +14 -0
  27. data/app/views/database/_row.html.erb +16 -0
  28. data/app/views/database/_table.html.erb +22 -0
  29. data/app/views/database/_table_form.html.erb +45 -0
  30. data/app/views/database/add_fields.html.erb +3 -0
  31. data/app/views/database/add_table.html.erb +3 -0
  32. data/app/views/database/blank_field.rjs +6 -0
  33. data/app/views/database/browse.html.erb +30 -0
  34. data/app/views/database/del_field.html.erb +31 -0
  35. data/app/views/database/del_table.html.erb +31 -0
  36. data/app/views/database/edit_field.html.erb +23 -0
  37. data/app/views/database/edit_row.html.erb +22 -0
  38. data/app/views/database/index.html.erb +23 -0
  39. data/app/views/database/insert.html.erb +3 -0
  40. data/app/views/database/table.html.erb +30 -0
  41. data/app/views/home/_database.html.erb +8 -0
  42. data/app/views/home/_database_form.html.erb +68 -0
  43. data/app/views/home/_driver.html.erb +5 -0
  44. data/app/views/home/_driver_form.html.erb +25 -0
  45. data/app/views/home/_group.html.erb +10 -0
  46. data/app/views/home/_group_form.html.erb +25 -0
  47. data/app/views/home/_group_permission.html.erb +4 -0
  48. data/app/views/home/_permission.html.erb +6 -0
  49. data/app/views/home/_permission_form.html.erb +32 -0
  50. data/app/views/home/_user.html.erb +10 -0
  51. data/app/views/home/_user_form.html.erb +64 -0
  52. data/app/views/home/_user_group.html.erb +4 -0
  53. data/app/views/home/add_database.html.erb +3 -0
  54. data/app/views/home/add_driver.html.erb +3 -0
  55. data/app/views/home/add_group.html.erb +4 -0
  56. data/app/views/home/add_permission.html.erb +3 -0
  57. data/app/views/home/add_user.html.erb +62 -0
  58. data/app/views/home/bottom.html.erb +17 -0
  59. data/app/views/home/databases.html.erb +22 -0
  60. data/app/views/home/del_database.html.erb +31 -0
  61. data/app/views/home/del_driver.html.erb +32 -0
  62. data/app/views/home/del_group.html.erb +32 -0
  63. data/app/views/home/del_group_permission.html.erb +32 -0
  64. data/app/views/home/del_permission.html.erb +32 -0
  65. data/app/views/home/del_user.html.erb +33 -0
  66. data/app/views/home/del_user_group.html.erb +32 -0
  67. data/app/views/home/drivers.html.erb +20 -0
  68. data/app/views/home/edit_database.html.erb +3 -0
  69. data/app/views/home/edit_driver.html.erb +3 -0
  70. data/app/views/home/edit_group.html.erb +4 -0
  71. data/app/views/home/edit_permission.html.erb +4 -0
  72. data/app/views/home/edit_user.html.erb +84 -0
  73. data/app/views/home/group_permissions.html.erb +38 -0
  74. data/app/views/home/groups.html.erb +20 -0
  75. data/app/views/home/index.html.erb +21 -0
  76. data/app/views/home/login.html.erb +42 -0
  77. data/app/views/home/menu.html.erb +33 -0
  78. data/app/views/home/permissions.html.erb +21 -0
  79. data/app/views/home/top.html.erb +22 -0
  80. data/app/views/home/user_groups.html.erb +44 -0
  81. data/app/views/home/users.html.erb +27 -0
  82. data/app/views/layouts/application.html.erb +18 -0
  83. data/config/boot.rb +109 -0
  84. data/config/database.yml +14 -0
  85. data/config/environment.rb +114 -0
  86. data/config/environments/development.rb +18 -0
  87. data/config/environments/production.rb +19 -0
  88. data/config/environments/test.rb +22 -0
  89. data/config/initializers/inflections.rb +10 -0
  90. data/config/initializers/mime_types.rb +5 -0
  91. data/config/routes.rb +135 -0
  92. data/db/migrate/001_create_sessions.rb +17 -0
  93. data/db/migrate/002_create_users.rb +26 -0
  94. data/db/migrate/003_create_groups.rb +17 -0
  95. data/db/migrate/004_create_permissions.rb +18 -0
  96. data/db/migrate/005_create_group_permissions.rb +22 -0
  97. data/db/migrate/006_create_user_groups.rb +19 -0
  98. data/db/migrate/007_create_drivers.rb +17 -0
  99. data/db/migrate/008_create_databases.rb +43 -0
  100. data/db/schema.rb +91 -0
  101. data/lib/ignore +0 -0
  102. data/log/ignore +0 -0
  103. data/public/404.html +30 -0
  104. data/public/422.html +30 -0
  105. data/public/500.html +30 -0
  106. data/public/dispatch.cgi +10 -0
  107. data/public/dispatch.fcgi +24 -0
  108. data/public/dispatch.rb +10 -0
  109. data/public/favicon.ico +0 -0
  110. data/public/images/rails.png +0 -0
  111. data/public/images/ss1.png +0 -0
  112. data/public/images/ss2.png +0 -0
  113. data/public/images/ss3.png +0 -0
  114. data/public/images/ss4.png +0 -0
  115. data/public/images/ss5.png +0 -0
  116. data/public/images/ss6.png +0 -0
  117. data/public/javascripts/application.js +25 -0
  118. data/public/javascripts/controls.js +963 -0
  119. data/public/javascripts/dragdrop.js +972 -0
  120. data/public/javascripts/effects.js +1120 -0
  121. data/public/javascripts/prototype.js +4225 -0
  122. data/public/robots.txt +4 -0
  123. data/public/stylesheets/railsdb.css +227 -0
  124. data/script/about +3 -0
  125. data/script/console +3 -0
  126. data/script/destroy +3 -0
  127. data/script/generate +3 -0
  128. data/script/performance/benchmarker +3 -0
  129. data/script/performance/profiler +3 -0
  130. data/script/performance/request +3 -0
  131. data/script/plugin +3 -0
  132. data/script/process/inspector +3 -0
  133. data/script/process/reaper +3 -0
  134. data/script/process/spawner +3 -0
  135. data/script/runner +3 -0
  136. data/script/server +3 -0
  137. data/test/fixtures/databases.yml +7 -0
  138. data/test/fixtures/drivers.yml +7 -0
  139. data/test/fixtures/group_permissions.yml +7 -0
  140. data/test/fixtures/groups.yml +7 -0
  141. data/test/fixtures/permissions.yml +7 -0
  142. data/test/fixtures/user_groups.yml +7 -0
  143. data/test/fixtures/users.yml +18 -0
  144. data/test/functional/home_controller_test.rb +8 -0
  145. data/test/test_helper.rb +38 -0
  146. data/test/unit/database_test.rb +8 -0
  147. data/test/unit/driver_test.rb +8 -0
  148. data/test/unit/group_permission_test.rb +8 -0
  149. data/test/unit/group_test.rb +8 -0
  150. data/test/unit/permission_test.rb +8 -0
  151. data/test/unit/user_group_test.rb +8 -0
  152. data/test/unit/user_test.rb +9 -0
  153. data/tmp/pids/ignore +0 -0
  154. data/tmp/sessions/ignore +0 -0
  155. data/tmp/sockets/ignore +0 -0
  156. metadata +287 -0
@@ -0,0 +1,4 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+
3
+ User-Agent: *
4
+ Disallow: /
@@ -0,0 +1,227 @@
1
+ body, form
2
+ {
3
+ margin: 0;
4
+ padding: 0;
5
+ }
6
+
7
+ body, td, p, h1, h2, h3, a
8
+ {
9
+ font-size: 12px;
10
+ font-family: sans-serif;
11
+ color: #000;
12
+ }
13
+
14
+ h1
15
+ {
16
+ font-size: 25px;
17
+ padding: 0;
18
+ margin: 40px 0 0 0;
19
+ }
20
+
21
+ h2
22
+ {
23
+ padding: 0 0 0 10px;
24
+ margin: 8px 0 0 0;
25
+ }
26
+
27
+ a
28
+ {
29
+ color: #333;
30
+ background-color: inherit;
31
+ }
32
+
33
+ a:hover
34
+ {
35
+ color: #000;
36
+ background-color: inherit;
37
+ }
38
+
39
+ .data td.c, .form td.c
40
+ {
41
+ text-align: center;
42
+ }
43
+
44
+ .data td.r, .form td.r
45
+ {
46
+ text-align: right;
47
+ }
48
+
49
+ .alt
50
+ {
51
+ color: inherit;
52
+ background-color: #eee;
53
+ }
54
+
55
+ .alt2
56
+ {
57
+ color: inherit;
58
+ background-color: #ddd;
59
+ }
60
+
61
+ .selected
62
+ {
63
+ color: #000;
64
+ background-color: #eee;
65
+ font-weight: bold;
66
+ padding: 2px 1px 1px 1px;
67
+ }
68
+
69
+ .error
70
+ {
71
+ color: #f00;
72
+ background-color: inherit;
73
+ }
74
+
75
+ p.error
76
+ {
77
+ padding: 0 0 0 10px;
78
+ }
79
+
80
+ table.data, table.form
81
+ {
82
+ margin: 10px;
83
+ border-collapse: collapse;
84
+ }
85
+
86
+ table.data td, table.form td
87
+ {
88
+ border: 1px solid #000;
89
+ padding: 5px;
90
+ }
91
+
92
+ table.data thead td, table.form thead td, table.data tfoot td, table.form tfoot td
93
+ {
94
+ color: #eee;
95
+ background-color: #454545;
96
+ }
97
+
98
+ table.form thead tr.label td
99
+ {
100
+ color: #eee;
101
+ background-color: #000;
102
+ font-size: 11px;
103
+ text-align: center;
104
+ padding: 2px;
105
+ }
106
+
107
+ table.form tfoot td, table.form td.label, table.data td.add
108
+ {
109
+ text-align: right;
110
+ }
111
+
112
+ table.form tfoot td table
113
+ {
114
+ float: right;
115
+ }
116
+
117
+ table.form tfoot input
118
+ {
119
+ font-size: 11px;
120
+ color: #333;
121
+ background-color: #c0c0c0;
122
+ }
123
+
124
+ table.data thead a
125
+ {
126
+ color: #ddd;
127
+ background-color: inherit;
128
+ }
129
+
130
+ table.data thead a:hover
131
+ {
132
+ color: #fff;
133
+ background-color: inherit;
134
+ }
135
+
136
+ #top
137
+ {
138
+ width: 100%;
139
+ border-collapse: collapse;
140
+ overflow: hidden;
141
+ }
142
+
143
+ #top td
144
+ {
145
+ padding: 0;
146
+ }
147
+
148
+ #top .l, #top .a
149
+ {
150
+ text-align: right;
151
+ padding: 5px 5px 1px 0;
152
+ }
153
+
154
+ #top .a
155
+ {
156
+ font-size: 17px;
157
+ }
158
+
159
+ #top .l
160
+ {
161
+ vertical-align: bottom;
162
+ padding: 12px 5px 0 0;
163
+ }
164
+
165
+ #top .t
166
+ {
167
+ font-size: 25px;
168
+ font-weight: bold;
169
+ vertical-align: bottom;
170
+ padding: 0 0 5px 8px;
171
+ }
172
+
173
+ #bottom
174
+ {
175
+ width: 100%;
176
+ }
177
+
178
+ #bottom td
179
+ {
180
+ font-size: 11px;
181
+ text-align: right;
182
+ padding: 2px 2px 0 0;
183
+ vertical-align: top;
184
+ height: 11px;
185
+ }
186
+
187
+ #menu
188
+ {
189
+ width: 100%;
190
+ border-collapse: collapse;
191
+ margin: 6px 0 0 0;
192
+ }
193
+
194
+ #menu td
195
+ {
196
+ text-align: right;
197
+ padding: 5px 10px 0 0;
198
+ }
199
+
200
+ #menu a
201
+ {
202
+ font-size: 15px;
203
+ color: #ccc;
204
+ background-color: inherit;
205
+ }
206
+
207
+ #menu a:hover
208
+ {
209
+ color: #fff;
210
+ background-color: inherit;
211
+ }
212
+
213
+ table.tight
214
+ {
215
+ border-collapse: collapse;
216
+ }
217
+
218
+ table.tight td
219
+ {
220
+ border: 0;
221
+ padding: 0;
222
+ }
223
+
224
+ table.tight td.cancel
225
+ {
226
+ padding: 0 5px 0 0;
227
+ }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/about'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/console'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/destroy'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/generate'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/benchmarker'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/profiler'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/request'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/plugin'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/inspector'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/reaper'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/spawner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/runner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/server'
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ # one:
4
+ # column: value
5
+ #
6
+ # two:
7
+ # column: value
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ # one:
4
+ # column: value
5
+ #
6
+ # two:
7
+ # column: value
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ # one:
4
+ # column: value
5
+ #
6
+ # two:
7
+ # column: value
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ # one:
4
+ # column: value
5
+ #
6
+ # two:
7
+ # column: value
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ # one:
4
+ # column: value
5
+ #
6
+ # two:
7
+ # column: value
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ # one:
4
+ # column: value
5
+ #
6
+ # two:
7
+ # column: value
@@ -0,0 +1,18 @@
1
+ railsdb:
2
+ id: 1
3
+ fname: Admin
4
+ lname: User
5
+ username: railsdb
6
+ email: user@example.com
7
+ passwd_hash: ce352d8077c562e07bd896b5a3f4d027bc1d834f
8
+ passwd_salt: dbffdca3a141dc3a33eec72104d5a54b0cbd42d8
9
+
10
+ other:
11
+ id: 2
12
+ fname: Other
13
+ lname: User
14
+ username: other
15
+ email: other@example.com
16
+ passwd_hash: xxx52d8077c562e07bd896b5a3f4d027bc1d8xxx
17
+ passwd_salt: xxxfdca3a141dc3a33eec72104d5a54b0cbd4xxx
18
+
@@ -0,0 +1,8 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class HomeControllerTest < ActionController::TestCase
4
+ # Replace this with your real tests.
5
+ def test_truth
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,38 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
3
+ require 'test_help'
4
+
5
+ class Test::Unit::TestCase
6
+ # Transactional fixtures accelerate your tests by wrapping each test method
7
+ # in a transaction that's rolled back on completion. This ensures that the
8
+ # test database remains unchanged so your fixtures don't have to be reloaded
9
+ # between every test method. Fewer database queries means faster tests.
10
+ #
11
+ # Read Mike Clark's excellent walkthrough at
12
+ # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
13
+ #
14
+ # Every Active Record database supports transactions except MyISAM tables
15
+ # in MySQL. Turn off transactional fixtures in this case; however, if you
16
+ # don't care one way or the other, switching from MyISAM to InnoDB tables
17
+ # is recommended.
18
+ #
19
+ # The only drawback to using transactional fixtures is when you actually
20
+ # need to test transactions. Since your test is bracketed by a transaction,
21
+ # any transactions started in your code will be automatically rolled back.
22
+ self.use_transactional_fixtures = true
23
+
24
+ # Instantiated fixtures are slow, but give you @david where otherwise you
25
+ # would need people(:david). If you don't want to migrate your existing
26
+ # test cases which use the @david style and don't mind the speed hit (each
27
+ # instantiated fixtures translates to a database query per test method),
28
+ # then set this back to true.
29
+ self.use_instantiated_fixtures = false
30
+
31
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
32
+ #
33
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
34
+ # -- they do not yet inherit this setting
35
+ fixtures :all
36
+
37
+ # Add more helper methods to be used by all tests here...
38
+ end
@@ -0,0 +1,8 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class DatabaseTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ def test_truth
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class DriverTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ def test_truth
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class GroupPermissionTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ def test_truth
6
+ assert true
7
+ end
8
+ end