roomer 0.0.8
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/.autotest +17 -0
- data/.gitignore +9 -0
- data/.rvmrc +2 -0
- data/.travis.yml +2 -0
- data/Gemfile +31 -0
- data/MIT-LICENSE +20 -0
- data/README.md +116 -0
- data/Rakefile +16 -0
- data/TODO.md +10 -0
- data/doc/ActiveRecord/Base.html +328 -0
- data/doc/ApplicationController.html +116 -0
- data/doc/Roomer/Engine.html +116 -0
- data/doc/Roomer/Generators/InstallGenerator.html +419 -0
- data/doc/Roomer/Generators/SetupGenerator.html +209 -0
- data/doc/Roomer/Generators.html +108 -0
- data/doc/Roomer/Tools.html +702 -0
- data/doc/Roomer/VERSION.html +149 -0
- data/doc/Roomer.html +533 -0
- data/doc/RoomerCreate.html +121 -0
- data/doc/_index.html +232 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +53 -0
- data/doc/css/style.css +320 -0
- data/doc/file.README.html +146 -0
- data/doc/file_list.html +49 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +146 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +150 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +182 -0
- data/doc/top-level-namespace.html +105 -0
- data/lib/generators/roomer/install/install_generator.rb +39 -0
- data/lib/generators/roomer/install/templates/README +15 -0
- data/lib/generators/roomer/install/templates/roomer.rb +68 -0
- data/lib/generators/roomer/migration/migration_generator.rb +35 -0
- data/lib/generators/roomer/migration/templates/migration.rb +17 -0
- data/lib/generators/roomer/model/model_generator.rb +45 -0
- data/lib/generators/roomer/model/templates/migration.rb +16 -0
- data/lib/generators/roomer/setup/setup_generator.rb +38 -0
- data/lib/generators/roomer/setup/templates/global_migration.rb +20 -0
- data/lib/roomer/extensions/controller.rb +36 -0
- data/lib/roomer/extensions/model.rb +72 -0
- data/lib/roomer/helpers/generator_helper.rb +30 -0
- data/lib/roomer/helpers/migration_helper.rb +7 -0
- data/lib/roomer/helpers/postgres_helper.rb +75 -0
- data/lib/roomer/rails.rb +24 -0
- data/lib/roomer/schema.rb +63 -0
- data/lib/roomer/schema_dumper.rb +36 -0
- data/lib/roomer/tasks/migrate.rake +85 -0
- data/lib/roomer/utils.rb +68 -0
- data/lib/roomer/version.rb +14 -0
- data/lib/roomer.rb +125 -0
- data/roomer.gemspec +22 -0
- data/test/config.rb +3 -0
- data/test/config.yml +7 -0
- data/test/generators/install_generator_test.rb +13 -0
- data/test/generators/migration_generator_test.rb +33 -0
- data/test/generators/model_generator_test.rb +25 -0
- data/test/generators/setup_generator_test.rb +25 -0
- data/test/rails_app/app/controllers/application_controller.rb +3 -0
- data/test/rails_app/app/helpers/application_helper.rb +2 -0
- data/test/rails_app/app/models/tenant.rb +12 -0
- data/test/rails_app/app/views/layouts/application.html.erb +14 -0
- data/test/rails_app/config/application.rb +50 -0
- data/test/rails_app/config/boot.rb +6 -0
- data/test/rails_app/config/database.yml +2 -0
- data/test/rails_app/config/environment.rb +5 -0
- data/test/rails_app/config/environments/development.rb +26 -0
- data/test/rails_app/config/environments/production.rb +49 -0
- data/test/rails_app/config/environments/test.rb +35 -0
- data/test/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_app/config/initializers/inflections.rb +10 -0
- data/test/rails_app/config/initializers/mime_types.rb +5 -0
- data/test/rails_app/config/initializers/roomer.rb +68 -0
- data/test/rails_app/config/initializers/secret_token.rb +7 -0
- data/test/rails_app/config/initializers/session_store.rb +8 -0
- data/test/rails_app/config/locales/en.yml +5 -0
- data/test/rails_app/config/routes.rb +58 -0
- data/test/rails_app/config.ru +4 -0
- data/test/rails_app/db/migrate/global/20110825231409_roomer_create_tenants.rb +20 -0
- data/test/rails_app/db/seeds.rb +7 -0
- data/test/rails_app/lib/tasks/.gitkeep +0 -0
- data/test/rails_app/public/404.html +26 -0
- data/test/rails_app/public/422.html +26 -0
- data/test/rails_app/public/500.html +26 -0
- data/test/rails_app/public/favicon.ico +0 -0
- data/test/rails_app/public/images/rails.png +0 -0
- data/test/rails_app/public/index.html +239 -0
- data/test/rails_app/public/javascripts/application.js +2 -0
- data/test/rails_app/public/javascripts/controls.js +965 -0
- data/test/rails_app/public/javascripts/dragdrop.js +974 -0
- data/test/rails_app/public/javascripts/effects.js +1123 -0
- data/test/rails_app/public/javascripts/prototype.js +6001 -0
- data/test/rails_app/public/javascripts/rails.js +191 -0
- data/test/rails_app/public/robots.txt +5 -0
- data/test/rails_app/public/stylesheets/.gitkeep +0 -0
- data/test/roomer/helpers/postgres_helper_test.rb +62 -0
- data/test/roomer/roomer_test.rb +37 -0
- data/test/test_helper.rb +23 -0
- metadata +228 -0
data/doc/css/style.css
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
body {
|
|
2
|
+
padding: 0 20px;
|
|
3
|
+
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
|
4
|
+
font-size: 13px;
|
|
5
|
+
}
|
|
6
|
+
body.frames { padding: 0 5px; }
|
|
7
|
+
h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; }
|
|
8
|
+
h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; }
|
|
9
|
+
h1.title { margin-bottom: 10px; }
|
|
10
|
+
h1.alphaindex { margin-top: 0; font-size: 22px; }
|
|
11
|
+
h2 {
|
|
12
|
+
padding: 0;
|
|
13
|
+
padding-bottom: 3px;
|
|
14
|
+
border-bottom: 1px #aaa solid;
|
|
15
|
+
font-size: 1.4em;
|
|
16
|
+
margin: 1.8em 0 0.5em;
|
|
17
|
+
}
|
|
18
|
+
h2 small { font-weight: normal; font-size: 0.7em; display: block; float: right; }
|
|
19
|
+
.clear { clear: both; }
|
|
20
|
+
.inline { display: inline; }
|
|
21
|
+
.inline p:first-child { display: inline; }
|
|
22
|
+
.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; }
|
|
23
|
+
.docstring h1 { font-size: 1.2em; }
|
|
24
|
+
.docstring h2 { font-size: 1.1em; }
|
|
25
|
+
.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; }
|
|
26
|
+
.summary_desc .object_link, .docstring .object_link { font-family: monospace; }
|
|
27
|
+
|
|
28
|
+
/* style for <ul> */
|
|
29
|
+
#filecontents li > p, .docstring li > p { margin: 0px; }
|
|
30
|
+
#filecontents ul, .docstring ul { padding-left: 20px; }
|
|
31
|
+
/* style for <dl> */
|
|
32
|
+
#filecontents dl, .docstring dl { border: 1px solid #ccc; }
|
|
33
|
+
#filecontents dt, .docstring dt { background: #ddd; font-weight: bold; padding: 3px 5px; }
|
|
34
|
+
#filecontents dd, .docstring dd { padding: 5px 0px; margin-left: 18px; }
|
|
35
|
+
#filecontents dd > p, .docstring dd > p { margin: 0px; }
|
|
36
|
+
|
|
37
|
+
.note {
|
|
38
|
+
color: #222;
|
|
39
|
+
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
|
40
|
+
background: #e3e4e3; border: 1px solid #d5d5d5; padding: 7px 10px;
|
|
41
|
+
display: block;
|
|
42
|
+
}
|
|
43
|
+
.note.todo { background: #ffffc5; border-color: #ececaa; }
|
|
44
|
+
.note.returns_void { background: #efefef; }
|
|
45
|
+
.note.deprecated { background: #ffe5e5; border-color: #e9dada; }
|
|
46
|
+
.note.private { background: #ffffc5; border-color: #ececaa; }
|
|
47
|
+
.note.title { text-transform: lowercase; padding: 1px 5px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; display: inline; }
|
|
48
|
+
.summary_signature + .note.title { margin-left: 7px; }
|
|
49
|
+
h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; }
|
|
50
|
+
.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
|
51
|
+
.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; }
|
|
52
|
+
.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
|
53
|
+
.note.title.private { background: #d5d5d5; border-color: #c5c5c5; }
|
|
54
|
+
.discussion .note { margin-top: 6px; }
|
|
55
|
+
.discussion .note:first-child { margin-top: 0; }
|
|
56
|
+
|
|
57
|
+
h3.inherited {
|
|
58
|
+
font-style: italic;
|
|
59
|
+
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
|
60
|
+
font-weight: normal;
|
|
61
|
+
padding: 0;
|
|
62
|
+
margin: 0;
|
|
63
|
+
margin-top: 12px;
|
|
64
|
+
margin-bottom: 3px;
|
|
65
|
+
font-size: 13px;
|
|
66
|
+
}
|
|
67
|
+
p.inherited {
|
|
68
|
+
padding: 0;
|
|
69
|
+
margin: 0;
|
|
70
|
+
margin-left: 25px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
#filecontents dl.box, dl.box {
|
|
74
|
+
border: 0;
|
|
75
|
+
width: 520px;
|
|
76
|
+
font-size: 1em;
|
|
77
|
+
}
|
|
78
|
+
#filecontents dl.box dt, dl.box dt {
|
|
79
|
+
float: left;
|
|
80
|
+
display: block;
|
|
81
|
+
width: 100px;
|
|
82
|
+
margin: 0;
|
|
83
|
+
text-align: right;
|
|
84
|
+
font-weight: bold;
|
|
85
|
+
background: transparent;
|
|
86
|
+
border: 1px solid #aaa;
|
|
87
|
+
border-width: 1px 0px 0px 1px;
|
|
88
|
+
padding: 6px 0;
|
|
89
|
+
padding-right: 10px;
|
|
90
|
+
}
|
|
91
|
+
#filecontents dl.box dd, dl.box dd {
|
|
92
|
+
float: left;
|
|
93
|
+
display: block;
|
|
94
|
+
width: 380px;
|
|
95
|
+
margin: 0;
|
|
96
|
+
padding: 6px 0;
|
|
97
|
+
padding-right: 20px;
|
|
98
|
+
border: 1px solid #aaa;
|
|
99
|
+
border-width: 1px 1px 0 0;
|
|
100
|
+
}
|
|
101
|
+
#filecontents dl.box .last, dl.box .last {
|
|
102
|
+
border-bottom: 1px solid #aaa;
|
|
103
|
+
}
|
|
104
|
+
#filecontents dl.box .r1, dl.box .r1 { background: #eee; }
|
|
105
|
+
|
|
106
|
+
ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; }
|
|
107
|
+
#files { padding-left: 15px; font-size: 1.1em; }
|
|
108
|
+
|
|
109
|
+
#files { padding: 0; }
|
|
110
|
+
#files li { list-style: none; display: inline; padding: 7px 12px; line-height: 35px; }
|
|
111
|
+
|
|
112
|
+
dl.constants { margin-left: 40px; }
|
|
113
|
+
dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; }
|
|
114
|
+
dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; }
|
|
115
|
+
|
|
116
|
+
.summary_desc { margin-left: 32px; display: block; font-family: sans-serif; }
|
|
117
|
+
.summary_desc tt { font-size: 0.9em; }
|
|
118
|
+
dl.constants .note { padding: 2px 6px; padding-right: 12px; margin-top: 6px; }
|
|
119
|
+
dl.constants .docstring { margin-left: 32px; font-size: 0.9em; font-weight: normal; }
|
|
120
|
+
dl.constants .tags { padding-left: 32px; font-size: 0.9em; line-height: 0.8em; }
|
|
121
|
+
dl.constants .discussion *:first-child { margin-top: 0; }
|
|
122
|
+
dl.constants .discussion *:last-child { margin-bottom: 0; }
|
|
123
|
+
|
|
124
|
+
.method_details { border-top: 1px dotted #aaa; margin-top: 15px; padding-top: 0; }
|
|
125
|
+
.method_details.first { border: 0; }
|
|
126
|
+
p.signature {
|
|
127
|
+
font-size: 1.1em; font-weight: normal; font-family: Monaco, Consolas, Courier, monospace;
|
|
128
|
+
padding: 6px 10px; margin-top: 18px;
|
|
129
|
+
background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px;
|
|
130
|
+
}
|
|
131
|
+
p.signature tt { font-family: Monaco, Consolas, Courier, monospace; }
|
|
132
|
+
p.signature .overload { display: block; }
|
|
133
|
+
p.signature .extras { font-weight: normal; font-family: sans-serif; color: #444; font-size: 1em; }
|
|
134
|
+
p.signature .aliases { display: block; font-weight: normal; font-size: 0.9em; font-family: sans-serif; margin-top: 0px; color: #555; }
|
|
135
|
+
p.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace; font-weight: bold; color: #000; font-size: 1.2em; }
|
|
136
|
+
|
|
137
|
+
.tags h3 { font-size: 1em; margin-bottom: 0; }
|
|
138
|
+
.tags ul { margin-top: 5px; padding-left: 30px; list-style: square; }
|
|
139
|
+
.tags ul li { margin-bottom: 3px; }
|
|
140
|
+
.tags ul .name { font-family: monospace; font-weight: bold; }
|
|
141
|
+
.tags ul .note { padding: 3px 6px; }
|
|
142
|
+
.tags { margin-bottom: 12px; }
|
|
143
|
+
|
|
144
|
+
.tags .examples h3 { margin-bottom: 10px; }
|
|
145
|
+
.tags .examples h4 { padding: 0; margin: 0; margin-left: 15px; font-weight: bold; font-size: 0.9em; }
|
|
146
|
+
|
|
147
|
+
.tags .overload .overload_item { list-style: none; margin-bottom: 25px; }
|
|
148
|
+
.tags .overload .overload_item .signature {
|
|
149
|
+
padding: 2px 8px;
|
|
150
|
+
background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px;
|
|
151
|
+
}
|
|
152
|
+
.tags .overload .signature { margin-left: -15px; font-family: monospace; display: block; font-size: 1.1em; }
|
|
153
|
+
.tags .overload .docstring { margin-top: 15px; }
|
|
154
|
+
|
|
155
|
+
.defines { display: none; }
|
|
156
|
+
|
|
157
|
+
#method_missing_details .notice.this { position: relative; top: -8px; color: #888; padding: 0; margin: 0; }
|
|
158
|
+
|
|
159
|
+
.showSource { font-size: 0.9em; }
|
|
160
|
+
.showSource a:link, .showSource a:visited { text-decoration: none; color: #666; }
|
|
161
|
+
|
|
162
|
+
#content a:link, #content a:visited { text-decoration: none; color: #05a; }
|
|
163
|
+
#content a:hover { background: #ffffa5; }
|
|
164
|
+
.docstring { margin-right: 6em; }
|
|
165
|
+
|
|
166
|
+
ul.summary {
|
|
167
|
+
list-style: none;
|
|
168
|
+
font-family: monospace;
|
|
169
|
+
font-size: 1em;
|
|
170
|
+
line-height: 1.5em;
|
|
171
|
+
}
|
|
172
|
+
ul.summary a:link, ul.summary a:visited {
|
|
173
|
+
text-decoration: none; font-size: 1.1em;
|
|
174
|
+
}
|
|
175
|
+
ul.summary li { margin-bottom: 5px; }
|
|
176
|
+
.summary .summary_signature {
|
|
177
|
+
padding: 1px 10px;
|
|
178
|
+
background: #eaeaff; border: 1px solid #dfdfe5;
|
|
179
|
+
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
|
180
|
+
}
|
|
181
|
+
.summary_signature:hover { background: #eeeeff; cursor: pointer; }
|
|
182
|
+
ul.summary.compact li { display: inline-block; margin: 0px 5px 0px 0px; line-height: 2.6em;}
|
|
183
|
+
ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; }
|
|
184
|
+
#content .summary_signature:hover a:link,
|
|
185
|
+
#content .summary_signature:hover a:visited {
|
|
186
|
+
background: transparent;
|
|
187
|
+
color: #48f;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
p.inherited a { font-family: monospace; font-size: 0.9em; }
|
|
191
|
+
p.inherited { word-spacing: 5px; font-size: 1.2em; }
|
|
192
|
+
|
|
193
|
+
p.children { font-size: 1.2em; }
|
|
194
|
+
p.children a { font-size: 0.9em; }
|
|
195
|
+
p.children strong { font-size: 0.8em; }
|
|
196
|
+
p.children strong.modules { padding-left: 5px; }
|
|
197
|
+
|
|
198
|
+
ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; }
|
|
199
|
+
ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; }
|
|
200
|
+
ul.fullTree li { text-align: center; padding-top: 18px; padding-bottom: 12px; background: url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTA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/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHtJREFUeNqMzrEJAkEURdGzuhgZbSoYWcAWoBVsB4JgZAGmphsZCZYzTQgWNCYrDN9RvMmHx+X916SUBFbo8CzD1idXrLErw1mQttgXtyrOcQ/Ny5p4Qh+2XqLYYazsPWNTiuMkRxa4vcV+evuNAUOLIx5+c2hyzv7hNQC67Q+/HHmlEwAAAABJRU5ErkJggg==) no-repeat top center; }
|
|
201
|
+
ul.fullTree li:first-child { padding-top: 0; background: transparent; }
|
|
202
|
+
ul.fullTree li:last-child { padding-bottom: 0; }
|
|
203
|
+
.showAll ul.fullTree { display: block; }
|
|
204
|
+
.showAll .inheritName { display: none; }
|
|
205
|
+
|
|
206
|
+
#search { position: absolute; right: 14px; top: 0px; }
|
|
207
|
+
#search a:link, #search a:visited {
|
|
208
|
+
display: block; float: left; margin-right: 4px;
|
|
209
|
+
padding: 8px 10px; text-decoration: none; color: #05a;
|
|
210
|
+
border: 1px solid #d8d8e5;
|
|
211
|
+
-moz-border-radius-bottomleft: 3px; -moz-border-radius-bottomright: 3px;
|
|
212
|
+
-webkit-border-bottom-left-radius: 3px; -webkit-border-bottom-right-radius: 3px;
|
|
213
|
+
background: #eaf0ff;
|
|
214
|
+
-webkit-box-shadow: -1px 1px 3px #ddd;
|
|
215
|
+
}
|
|
216
|
+
#search a:hover { background: #f5faff; color: #06b; }
|
|
217
|
+
#search a.active {
|
|
218
|
+
background: #568; padding-bottom: 20px; color: #fff; border: 1px solid #457;
|
|
219
|
+
-moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px;
|
|
220
|
+
-webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px;
|
|
221
|
+
}
|
|
222
|
+
#search a.inactive { color: #999; }
|
|
223
|
+
.frames #search { display: none; }
|
|
224
|
+
.inheritanceTree, .toggleDefines { float: right; }
|
|
225
|
+
|
|
226
|
+
#menu { font-size: 1.3em; color: #bbb; top: -5px; position: relative; }
|
|
227
|
+
#menu .title, #menu a { font-size: 0.7em; }
|
|
228
|
+
#menu .title a { font-size: 1em; }
|
|
229
|
+
#menu .title { color: #555; }
|
|
230
|
+
#menu a:link, #menu a:visited { color: #333; text-decoration: none; border-bottom: 1px dotted #bbd; }
|
|
231
|
+
#menu a:hover { color: #05a; }
|
|
232
|
+
#menu .noframes { display: none; }
|
|
233
|
+
.frames #menu .noframes { display: inline; float: right; }
|
|
234
|
+
|
|
235
|
+
#footer { margin-top: 15px; border-top: 1px solid #ccc; text-align: center; padding: 7px 0; color: #999; }
|
|
236
|
+
#footer a:link, #footer a:visited { color: #444; text-decoration: none; border-bottom: 1px dotted #bbd; }
|
|
237
|
+
#footer a:hover { color: #05a; }
|
|
238
|
+
|
|
239
|
+
#listing ul.alpha { font-size: 1.1em; }
|
|
240
|
+
#listing ul.alpha { margin: 0; padding: 0; padding-bottom: 10px; list-style: none; }
|
|
241
|
+
#listing ul.alpha li.letter { font-size: 1.4em; padding-bottom: 10px; }
|
|
242
|
+
#listing ul.alpha ul { margin: 0; padding-left: 15px; }
|
|
243
|
+
#listing ul small { color: #666; font-size: 0.7em; }
|
|
244
|
+
|
|
245
|
+
li.r1 { background: #f0f0f0; }
|
|
246
|
+
li.r2 { background: #fafafa; }
|
|
247
|
+
|
|
248
|
+
#search_frame {
|
|
249
|
+
z-index: 9999;
|
|
250
|
+
background: #fff;
|
|
251
|
+
display: none;
|
|
252
|
+
position: absolute;
|
|
253
|
+
top: 36px;
|
|
254
|
+
right: 18px;
|
|
255
|
+
width: 500px;
|
|
256
|
+
height: 80%;
|
|
257
|
+
overflow-y: scroll;
|
|
258
|
+
border: 1px solid #999;
|
|
259
|
+
border-collapse: collapse;
|
|
260
|
+
-webkit-box-shadow: -7px 5px 25px #aaa;
|
|
261
|
+
-moz-box-shadow: -7px 5px 25px #aaa;
|
|
262
|
+
-moz-border-radius: 2px;
|
|
263
|
+
-webkit-border-radius: 2px;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
#content ul.summary li.deprecated .summary_signature a:link,
|
|
267
|
+
#content ul.summary li.deprecated .summary_signature a:visited { text-decoration: line-through; font-style: italic; }
|
|
268
|
+
|
|
269
|
+
#toc {
|
|
270
|
+
padding: 20px; padding-right: 30px; border: 1px solid #ddd; float: right; background: #fff; margin-left: 20px; margin-bottom: 20px;
|
|
271
|
+
max-width: 300px;
|
|
272
|
+
-webkit-box-shadow: -2px 2px 6px #bbb;
|
|
273
|
+
-moz-box-shadow: -2px 2px 6px #bbb;
|
|
274
|
+
z-index: 5000;
|
|
275
|
+
position: relative;
|
|
276
|
+
}
|
|
277
|
+
#toc.nofloat { float: none; max-width: none; border: none; padding: 0; margin: 20px 0; -webkit-box-shadow: none; -moz-box-shadow: none; }
|
|
278
|
+
#toc.nofloat.hidden { padding: 0; background: 0; margin-bottom: 5px; }
|
|
279
|
+
#toc .title { margin: 0; }
|
|
280
|
+
#toc ol { padding-left: 1.8em; }
|
|
281
|
+
#toc li { font-size: 1.1em; line-height: 1.7em; }
|
|
282
|
+
#toc > ol > li { font-size: 1.1em; font-weight: bold; }
|
|
283
|
+
#toc ol > ol { font-size: 0.9em; }
|
|
284
|
+
#toc ol ol > ol { padding-left: 2.3em; }
|
|
285
|
+
#toc ol + li { margin-top: 0.3em; }
|
|
286
|
+
#toc.hidden { padding: 10px; background: #f6f6f6; -webkit-box-shadow: none; -moz-box-shadow: none; }
|
|
287
|
+
#filecontents h1 + #toc.nofloat { margin-top: 0; }
|
|
288
|
+
|
|
289
|
+
/* syntax highlighting */
|
|
290
|
+
.source_code { display: none; padding: 3px 8px; border-left: 8px solid #ddd; margin-top: 5px; }
|
|
291
|
+
#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; }
|
|
292
|
+
#filecontents pre.code, .docstring pre.code { display: block; }
|
|
293
|
+
.source_code .lines { padding-right: 12px; color: #555; text-align: right; }
|
|
294
|
+
#filecontents pre.code, .docstring pre.code,
|
|
295
|
+
.tags .example { padding: 5px 12px; margin-top: 4px; border: 1px solid #eef; background: #f5f5ff; }
|
|
296
|
+
pre.code { color: #000; }
|
|
297
|
+
pre.code .info.file { color: #555; }
|
|
298
|
+
pre.code .val { color: #036A07; }
|
|
299
|
+
pre.code .tstring_content,
|
|
300
|
+
pre.code .heredoc_beg, pre.code .heredoc_end,
|
|
301
|
+
pre.code .qwords_beg, pre.code .qwords_end,
|
|
302
|
+
pre.code .tstring, pre.code .dstring { color: #036A07; }
|
|
303
|
+
pre.code .fid, pre.code .id.new, pre.code .id.to_s,
|
|
304
|
+
pre.code .id.to_sym, pre.code .id.to_f,
|
|
305
|
+
pre.code .dot + pre.code .id,
|
|
306
|
+
pre.code .id.to_i pre.code .id.each { color: #0085FF; }
|
|
307
|
+
pre.code .comment { color: #0066FF; }
|
|
308
|
+
pre.code .const, pre.code .constant { color: #585CF6; }
|
|
309
|
+
pre.code .symbol { color: #C5060B; }
|
|
310
|
+
pre.code .kw,
|
|
311
|
+
pre.code .label,
|
|
312
|
+
pre.code .id.require,
|
|
313
|
+
pre.code .id.extend,
|
|
314
|
+
pre.code .id.include { color: #0000FF; }
|
|
315
|
+
pre.code .ivar { color: #318495; }
|
|
316
|
+
pre.code .gvar,
|
|
317
|
+
pre.code .id.backref,
|
|
318
|
+
pre.code .id.nth_ref { color: #6D79DE; }
|
|
319
|
+
pre.code .regexp, .dregexp { color: #036A07; }
|
|
320
|
+
pre.code a { border-bottom: 1px dotted #bbf; }
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
<title>
|
|
7
|
+
File: README
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.7.2
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
|
18
|
+
relpath = '';
|
|
19
|
+
if (relpath != '') relpath += '/';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
|
23
|
+
|
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<div id="header">
|
|
34
|
+
<div id="menu">
|
|
35
|
+
|
|
36
|
+
<a href="_index.html" title="Index">Index</a> »
|
|
37
|
+
<span class="title">File: README</span>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div id="search">
|
|
44
|
+
|
|
45
|
+
<a id="class_list_link" href="#">Class List</a>
|
|
46
|
+
|
|
47
|
+
<a id="method_list_link" href="#">Method List</a>
|
|
48
|
+
|
|
49
|
+
<a id="file_list_link" href="#">File List</a>
|
|
50
|
+
|
|
51
|
+
</div>
|
|
52
|
+
<div class="clear"></div>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<iframe id="search_frame"></iframe>
|
|
56
|
+
|
|
57
|
+
<div id="content"><div id='filecontents'>
|
|
58
|
+
<p>NOTE: We started writing this few days and haven’t released yet, please
|
|
59
|
+
don’t use. If you are interested in contributing, drop me a note at
|
|
60
|
+
gosuri@gmail.com</p>
|
|
61
|
+
|
|
62
|
+
<h1>Roomer</h1>
|
|
63
|
+
|
|
64
|
+
<p>Roomer is a multitenant framework for Rails using PostgreSQL</p>
|
|
65
|
+
|
|
66
|
+
<h2>Multitenant Data Strategy</h2>
|
|
67
|
+
|
|
68
|
+
<p>While there are several strategies for multi-tenancy, Roomer uses
|
|
69
|
+
PostgreSQL’s schemas (namespaces) to achieve its goal. You can use Roomer
|
|
70
|
+
if your application has the below characteristics:</p>
|
|
71
|
+
<ul><li>
|
|
72
|
+
<p>Each Tenant’s data has be to be private to the Tenant.</p>
|
|
73
|
+
</li><li>
|
|
74
|
+
<p>No (or minimal) requirement to run cross-tenant queries.</p>
|
|
75
|
+
</li></ul>
|
|
76
|
+
|
|
77
|
+
<p>Each Tenant’s data is stored in separate schema and shared data is stored
|
|
78
|
+
in a “global” schema accessible to all the Tenants.</p>
|
|
79
|
+
|
|
80
|
+
<h3>PostgreSQL “Schemas”</h3>
|
|
81
|
+
|
|
82
|
+
<p>A database in PostgreSQL contains one or more named schemas, which in turn
|
|
83
|
+
contain tables. Schemas also contain other kinds of named objects,
|
|
84
|
+
including data types, functions, and operators. The same object name can be
|
|
85
|
+
used in different schemas without conflict; for example, both schema1 and
|
|
86
|
+
myschema may contain tables named mytable. Unlike databases, schemas are
|
|
87
|
+
not rigidly separated: a user may access objects in any of the schemas in
|
|
88
|
+
the database he is connected to, if he has privileges to do so.</p>
|
|
89
|
+
|
|
90
|
+
<p>More information at <a
|
|
91
|
+
href="http://www.postgresql.org/docs/8.2/static/ddl-schemas.html">www.postgresql.org/docs/8.2/static/ddl-schemas.html</a></p>
|
|
92
|
+
|
|
93
|
+
<h2>Usage</h2>
|
|
94
|
+
|
|
95
|
+
<h3>Installation</h3>
|
|
96
|
+
|
|
97
|
+
<p>Roomer currently only supports Rails 3</p>
|
|
98
|
+
|
|
99
|
+
<pre class="code"><span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='roomer identifier id'>roomer</span>
|
|
100
|
+
</pre>
|
|
101
|
+
|
|
102
|
+
<p>After you install Roomer and add it to your Gemfile, you need to run the
|
|
103
|
+
generator. Roomer will use default values “tenant” for Tenant scoped
|
|
104
|
+
models and “global” for shared models. If you’d like to override the
|
|
105
|
+
defaults use the optional parameters</p>
|
|
106
|
+
|
|
107
|
+
<pre class="code"><span class='rails identifier id'>rails</span> <span class='generate identifier id'>generate</span> <span class='roomer identifier id'>roomer</span><span class='symbol val'>:install</span>
|
|
108
|
+
</pre>
|
|
109
|
+
|
|
110
|
+
<p></p>
|
|
111
|
+
|
|
112
|
+
<p>The generator will install an initializer under
|
|
113
|
+
config/initializers/roomer.rb which describes ALL Roomer’s configuration
|
|
114
|
+
options and you MUST take a look at it.</p>
|
|
115
|
+
|
|
116
|
+
<h3>Setup</h3>
|
|
117
|
+
|
|
118
|
+
<p>After you’ve done the necessary config changes to the initializer, run
|
|
119
|
+
the setup:</p>
|
|
120
|
+
|
|
121
|
+
<pre class="code"><span class='rails identifier id'>rails</span> <span class='generate identifier id'>generate</span> <span class='roomer identifier id'>roomer</span><span class='symbol val'>:setup</span>
|
|
122
|
+
</pre>
|
|
123
|
+
|
|
124
|
+
<h3>Running Migrations</h3>
|
|
125
|
+
|
|
126
|
+
<p>The setup will generate migrations under db/migration/[shared_shema_name],
|
|
127
|
+
by default it should be db/migration/global. You need to run the shared
|
|
128
|
+
migrations to setup the tenant tables</p>
|
|
129
|
+
|
|
130
|
+
<pre class="code"><span class='rake identifier id'>rake</span> <span class='roomer identifier id'>roomer</span><span class='symbol val'>:migrate</span><span class='symbol val'>:shared</span>
|
|
131
|
+
</pre>
|
|
132
|
+
|
|
133
|
+
<h1>Contributors</h1>
|
|
134
|
+
|
|
135
|
+
<p><a
|
|
136
|
+
href="https://github.com/gosuri/roomer/contributors">github.com/gosuri/roomer/contributors</a></p>
|
|
137
|
+
</div></div>
|
|
138
|
+
|
|
139
|
+
<div id="footer">
|
|
140
|
+
Generated on Fri Aug 12 10:39:12 2011 by
|
|
141
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
142
|
+
0.7.2 (ruby-1.8.7).
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
</body>
|
|
146
|
+
</html>
|
data/doc/file_list.html
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
|
|
7
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
|
8
|
+
|
|
9
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
|
14
|
+
|
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
<base id="base_target" target="_parent" />
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<script type="text/javascript" charset="utf-8">
|
|
22
|
+
if (window.top.frames.main) {
|
|
23
|
+
document.getElementById('base_target').target = 'main';
|
|
24
|
+
document.body.className = 'frames';
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
<div id="content">
|
|
28
|
+
<h1 id="full_list_header">File List</h1>
|
|
29
|
+
<div id="nav">
|
|
30
|
+
|
|
31
|
+
<a target="_self" href="class_list.html">Classes</a>
|
|
32
|
+
|
|
33
|
+
<a target="_self" href="method_list.html">Methods</a>
|
|
34
|
+
|
|
35
|
+
<a target="_self" href="file_list.html">Files</a>
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
<div id="search">Search: <input type="text" /></div>
|
|
39
|
+
|
|
40
|
+
<ul id="full_list" class="files">
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<li class="r1"><a href="index.html" title="README">README</a></li>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
</ul>
|
|
47
|
+
</div>
|
|
48
|
+
</body>
|
|
49
|
+
</html>
|
data/doc/frames.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
|
3
|
+
|
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
7
|
+
<title>Documentation by YARD 0.7.2</title>
|
|
8
|
+
</head>
|
|
9
|
+
<frameset cols="20%,*">
|
|
10
|
+
<frame name="list" src="class_list.html" />
|
|
11
|
+
<frame name="main" src="index.html" />
|
|
12
|
+
</frameset>
|
|
13
|
+
</html>
|
data/doc/index.html
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
<title>
|
|
7
|
+
File: README
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.7.2
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
|
18
|
+
relpath = '';
|
|
19
|
+
if (relpath != '') relpath += '/';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
|
23
|
+
|
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<div id="header">
|
|
34
|
+
<div id="menu">
|
|
35
|
+
|
|
36
|
+
<a href="_index.html" title="Index">Index</a> »
|
|
37
|
+
<span class="title">File: README</span>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div id="search">
|
|
44
|
+
|
|
45
|
+
<a id="class_list_link" href="#">Class List</a>
|
|
46
|
+
|
|
47
|
+
<a id="method_list_link" href="#">Method List</a>
|
|
48
|
+
|
|
49
|
+
<a id="file_list_link" href="#">File List</a>
|
|
50
|
+
|
|
51
|
+
</div>
|
|
52
|
+
<div class="clear"></div>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<iframe id="search_frame"></iframe>
|
|
56
|
+
|
|
57
|
+
<div id="content"><div id='filecontents'>
|
|
58
|
+
<p>NOTE: We started writing this few days and haven’t released yet, please
|
|
59
|
+
don’t use. If you are interested in contributing, drop me a note at
|
|
60
|
+
gosuri@gmail.com</p>
|
|
61
|
+
|
|
62
|
+
<h1>Roomer</h1>
|
|
63
|
+
|
|
64
|
+
<p>Roomer is a multitenant framework for Rails using PostgreSQL</p>
|
|
65
|
+
|
|
66
|
+
<h2>Multitenant Data Strategy</h2>
|
|
67
|
+
|
|
68
|
+
<p>While there are several strategies for multi-tenancy, Roomer uses
|
|
69
|
+
PostgreSQL’s schemas (namespaces) to achieve its goal. You can use Roomer
|
|
70
|
+
if your application has the below characteristics:</p>
|
|
71
|
+
<ul><li>
|
|
72
|
+
<p>Each Tenant’s data has be to be private to the Tenant.</p>
|
|
73
|
+
</li><li>
|
|
74
|
+
<p>No (or minimal) requirement to run cross-tenant queries.</p>
|
|
75
|
+
</li></ul>
|
|
76
|
+
|
|
77
|
+
<p>Each Tenant’s data is stored in separate schema and shared data is stored
|
|
78
|
+
in a “global” schema accessible to all the Tenants.</p>
|
|
79
|
+
|
|
80
|
+
<h3>PostgreSQL “Schemas”</h3>
|
|
81
|
+
|
|
82
|
+
<p>A database in PostgreSQL contains one or more named schemas, which in turn
|
|
83
|
+
contain tables. Schemas also contain other kinds of named objects,
|
|
84
|
+
including data types, functions, and operators. The same object name can be
|
|
85
|
+
used in different schemas without conflict; for example, both schema1 and
|
|
86
|
+
myschema may contain tables named mytable. Unlike databases, schemas are
|
|
87
|
+
not rigidly separated: a user may access objects in any of the schemas in
|
|
88
|
+
the database he is connected to, if he has privileges to do so.</p>
|
|
89
|
+
|
|
90
|
+
<p>More information at <a
|
|
91
|
+
href="http://www.postgresql.org/docs/8.2/static/ddl-schemas.html">www.postgresql.org/docs/8.2/static/ddl-schemas.html</a></p>
|
|
92
|
+
|
|
93
|
+
<h2>Usage</h2>
|
|
94
|
+
|
|
95
|
+
<h3>Installation</h3>
|
|
96
|
+
|
|
97
|
+
<p>Roomer currently only supports Rails 3</p>
|
|
98
|
+
|
|
99
|
+
<pre class="code"><span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='roomer identifier id'>roomer</span>
|
|
100
|
+
</pre>
|
|
101
|
+
|
|
102
|
+
<p>After you install Roomer and add it to your Gemfile, you need to run the
|
|
103
|
+
generator. Roomer will use default values “tenant” for Tenant scoped
|
|
104
|
+
models and “global” for shared models. If you’d like to override the
|
|
105
|
+
defaults use the optional parameters</p>
|
|
106
|
+
|
|
107
|
+
<pre class="code"><span class='rails identifier id'>rails</span> <span class='generate identifier id'>generate</span> <span class='roomer identifier id'>roomer</span><span class='symbol val'>:install</span>
|
|
108
|
+
</pre>
|
|
109
|
+
|
|
110
|
+
<p></p>
|
|
111
|
+
|
|
112
|
+
<p>The generator will install an initializer under
|
|
113
|
+
config/initializers/roomer.rb which describes ALL Roomer’s configuration
|
|
114
|
+
options and you MUST take a look at it.</p>
|
|
115
|
+
|
|
116
|
+
<h3>Setup</h3>
|
|
117
|
+
|
|
118
|
+
<p>After you’ve done the necessary config changes to the initializer, run
|
|
119
|
+
the setup:</p>
|
|
120
|
+
|
|
121
|
+
<pre class="code"><span class='rails identifier id'>rails</span> <span class='generate identifier id'>generate</span> <span class='roomer identifier id'>roomer</span><span class='symbol val'>:setup</span>
|
|
122
|
+
</pre>
|
|
123
|
+
|
|
124
|
+
<h3>Running Migrations</h3>
|
|
125
|
+
|
|
126
|
+
<p>The setup will generate migrations under db/migration/[shared_shema_name],
|
|
127
|
+
by default it should be db/migration/global. You need to run the shared
|
|
128
|
+
migrations to setup the tenant tables</p>
|
|
129
|
+
|
|
130
|
+
<pre class="code"><span class='rake identifier id'>rake</span> <span class='roomer identifier id'>roomer</span><span class='symbol val'>:migrate</span><span class='symbol val'>:shared</span>
|
|
131
|
+
</pre>
|
|
132
|
+
|
|
133
|
+
<h1>Contributors</h1>
|
|
134
|
+
|
|
135
|
+
<p><a
|
|
136
|
+
href="https://github.com/gosuri/roomer/contributors">github.com/gosuri/roomer/contributors</a></p>
|
|
137
|
+
</div></div>
|
|
138
|
+
|
|
139
|
+
<div id="footer">
|
|
140
|
+
Generated on Fri Aug 12 10:39:12 2011 by
|
|
141
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
142
|
+
0.7.2 (ruby-1.8.7).
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
</body>
|
|
146
|
+
</html>
|