gdonald-railsdb 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +674 -0
- data/README.txt +40 -0
- data/README_RAILS.txt +204 -0
- data/Rakefile +31 -0
- data/app/controllers/application.rb +24 -0
- data/app/controllers/database_controller.rb +274 -0
- data/app/controllers/home_controller.rb +366 -0
- data/app/helpers/application_helper.rb +43 -0
- data/app/helpers/home_helper.rb +2 -0
- data/app/models/database.rb +113 -0
- data/app/models/driver.rb +8 -0
- data/app/models/field.rb +117 -0
- data/app/models/group.rb +12 -0
- data/app/models/group_permission.rb +6 -0
- data/app/models/permission.rb +9 -0
- data/app/models/row.rb +26 -0
- data/app/models/switch.rb +85 -0
- data/app/models/table.rb +155 -0
- data/app/models/user.rb +98 -0
- data/app/models/user_group.rb +6 -0
- data/app/views/database/_field.html.erb +20 -0
- data/app/views/database/_field_form.html.erb +28 -0
- data/app/views/database/_insert_form.html.erb +37 -0
- data/app/views/database/_new_field.html.erb +43 -0
- data/app/views/database/_new_field_header.html.erb +12 -0
- data/app/views/database/_pagination.html.erb +14 -0
- data/app/views/database/_row.html.erb +16 -0
- data/app/views/database/_table.html.erb +22 -0
- data/app/views/database/_table_form.html.erb +45 -0
- data/app/views/database/add_fields.html.erb +3 -0
- data/app/views/database/add_table.html.erb +3 -0
- data/app/views/database/blank_field.rjs +6 -0
- data/app/views/database/browse.html.erb +30 -0
- data/app/views/database/del_field.html.erb +31 -0
- data/app/views/database/del_table.html.erb +31 -0
- data/app/views/database/edit_field.html.erb +23 -0
- data/app/views/database/edit_row.html.erb +22 -0
- data/app/views/database/index.html.erb +23 -0
- data/app/views/database/insert.html.erb +3 -0
- data/app/views/database/table.html.erb +30 -0
- data/app/views/home/_database.html.erb +8 -0
- data/app/views/home/_database_form.html.erb +68 -0
- data/app/views/home/_driver.html.erb +5 -0
- data/app/views/home/_driver_form.html.erb +25 -0
- data/app/views/home/_group.html.erb +10 -0
- data/app/views/home/_group_form.html.erb +25 -0
- data/app/views/home/_group_permission.html.erb +4 -0
- data/app/views/home/_permission.html.erb +6 -0
- data/app/views/home/_permission_form.html.erb +32 -0
- data/app/views/home/_user.html.erb +10 -0
- data/app/views/home/_user_form.html.erb +64 -0
- data/app/views/home/_user_group.html.erb +4 -0
- data/app/views/home/add_database.html.erb +3 -0
- data/app/views/home/add_driver.html.erb +3 -0
- data/app/views/home/add_group.html.erb +4 -0
- data/app/views/home/add_permission.html.erb +3 -0
- data/app/views/home/add_user.html.erb +62 -0
- data/app/views/home/bottom.html.erb +17 -0
- data/app/views/home/databases.html.erb +22 -0
- data/app/views/home/del_database.html.erb +31 -0
- data/app/views/home/del_driver.html.erb +32 -0
- data/app/views/home/del_group.html.erb +32 -0
- data/app/views/home/del_group_permission.html.erb +32 -0
- data/app/views/home/del_permission.html.erb +32 -0
- data/app/views/home/del_user.html.erb +33 -0
- data/app/views/home/del_user_group.html.erb +32 -0
- data/app/views/home/drivers.html.erb +20 -0
- data/app/views/home/edit_database.html.erb +3 -0
- data/app/views/home/edit_driver.html.erb +3 -0
- data/app/views/home/edit_group.html.erb +4 -0
- data/app/views/home/edit_permission.html.erb +4 -0
- data/app/views/home/edit_user.html.erb +84 -0
- data/app/views/home/group_permissions.html.erb +38 -0
- data/app/views/home/groups.html.erb +20 -0
- data/app/views/home/index.html.erb +21 -0
- data/app/views/home/login.html.erb +42 -0
- data/app/views/home/menu.html.erb +33 -0
- data/app/views/home/permissions.html.erb +21 -0
- data/app/views/home/top.html.erb +22 -0
- data/app/views/home/user_groups.html.erb +44 -0
- data/app/views/home/users.html.erb +27 -0
- data/app/views/layouts/application.html.erb +18 -0
- data/config/boot.rb +109 -0
- data/config/database.yml +14 -0
- data/config/environment.rb +114 -0
- data/config/environments/development.rb +18 -0
- data/config/environments/production.rb +19 -0
- data/config/environments/test.rb +22 -0
- data/config/initializers/inflections.rb +10 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/routes.rb +135 -0
- data/db/migrate/001_create_sessions.rb +17 -0
- data/db/migrate/002_create_users.rb +26 -0
- data/db/migrate/003_create_groups.rb +17 -0
- data/db/migrate/004_create_permissions.rb +18 -0
- data/db/migrate/005_create_group_permissions.rb +22 -0
- data/db/migrate/006_create_user_groups.rb +19 -0
- data/db/migrate/007_create_drivers.rb +17 -0
- data/db/migrate/008_create_databases.rb +43 -0
- data/db/schema.rb +91 -0
- data/lib/ignore +0 -0
- data/log/ignore +0 -0
- data/public/404.html +30 -0
- data/public/422.html +30 -0
- data/public/500.html +30 -0
- data/public/dispatch.cgi +10 -0
- data/public/dispatch.fcgi +24 -0
- data/public/dispatch.rb +10 -0
- data/public/favicon.ico +0 -0
- data/public/images/rails.png +0 -0
- data/public/images/ss1.png +0 -0
- data/public/images/ss2.png +0 -0
- data/public/images/ss3.png +0 -0
- data/public/images/ss4.png +0 -0
- data/public/images/ss5.png +0 -0
- data/public/images/ss6.png +0 -0
- data/public/javascripts/application.js +25 -0
- data/public/javascripts/controls.js +963 -0
- data/public/javascripts/dragdrop.js +972 -0
- data/public/javascripts/effects.js +1120 -0
- data/public/javascripts/prototype.js +4225 -0
- data/public/robots.txt +4 -0
- data/public/stylesheets/railsdb.css +227 -0
- data/script/about +3 -0
- data/script/console +3 -0
- data/script/destroy +3 -0
- data/script/generate +3 -0
- data/script/performance/benchmarker +3 -0
- data/script/performance/profiler +3 -0
- data/script/performance/request +3 -0
- data/script/plugin +3 -0
- data/script/process/inspector +3 -0
- data/script/process/reaper +3 -0
- data/script/process/spawner +3 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/test/fixtures/databases.yml +7 -0
- data/test/fixtures/drivers.yml +7 -0
- data/test/fixtures/group_permissions.yml +7 -0
- data/test/fixtures/groups.yml +7 -0
- data/test/fixtures/permissions.yml +7 -0
- data/test/fixtures/user_groups.yml +7 -0
- data/test/fixtures/users.yml +18 -0
- data/test/functional/home_controller_test.rb +8 -0
- data/test/test_helper.rb +38 -0
- data/test/unit/database_test.rb +8 -0
- data/test/unit/driver_test.rb +8 -0
- data/test/unit/group_permission_test.rb +8 -0
- data/test/unit/group_test.rb +8 -0
- data/test/unit/permission_test.rb +8 -0
- data/test/unit/user_group_test.rb +8 -0
- data/test/unit/user_test.rb +9 -0
- data/tmp/pids/ignore +0 -0
- data/tmp/sessions/ignore +0 -0
- data/tmp/sockets/ignore +0 -0
- metadata +287 -0
data/public/robots.txt
ADDED
@@ -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
|
+
}
|
data/script/about
ADDED
data/script/console
ADDED
data/script/destroy
ADDED
data/script/generate
ADDED
data/script/plugin
ADDED
data/script/runner
ADDED
data/script/server
ADDED
@@ -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
|
+
|
data/test/test_helper.rb
ADDED
@@ -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
|