mls 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. data/.gitignore +1 -0
  2. data/README.rdoc +54 -0
  3. data/Rakefile +20 -2
  4. data/lib/mls.rb +307 -78
  5. data/lib/mls/errors.rb +13 -4
  6. data/lib/mls/model.rb +36 -5
  7. data/lib/mls/models/account.rb +74 -66
  8. data/lib/mls/models/address.rb +87 -6
  9. data/lib/mls/models/area.rb +27 -0
  10. data/lib/mls/models/flyer.rb +41 -0
  11. data/lib/mls/models/listing.rb +180 -34
  12. data/lib/mls/models/photo.rb +25 -3
  13. data/lib/mls/models/tour_request.rb +18 -31
  14. data/lib/mls/parser.rb +5 -4
  15. data/lib/mls/properties/datetime.rb +5 -1
  16. data/lib/mls/properties/decimal.rb +3 -1
  17. data/lib/mls/properties/hash.rb +7 -0
  18. data/lib/mls/resource.rb +35 -5
  19. data/lib/rdoc/generator/template/42floors/_context.rhtml +209 -0
  20. data/lib/rdoc/generator/template/42floors/_head.rhtml +7 -0
  21. data/lib/rdoc/generator/template/42floors/class.rhtml +39 -0
  22. data/lib/rdoc/generator/template/42floors/file.rhtml +35 -0
  23. data/lib/rdoc/generator/template/42floors/index.rhtml +13 -0
  24. data/lib/rdoc/generator/template/42floors/resources/apple-touch-icon.png +0 -0
  25. data/lib/rdoc/generator/template/42floors/resources/css/github.css +129 -0
  26. data/lib/rdoc/generator/template/42floors/resources/css/main.css +339 -0
  27. data/lib/rdoc/generator/template/42floors/resources/css/panel.css +389 -0
  28. data/lib/rdoc/generator/template/42floors/resources/css/reset.css +48 -0
  29. data/lib/rdoc/generator/template/42floors/resources/favicon.ico +0 -0
  30. data/lib/rdoc/generator/template/42floors/resources/i/arrows.png +0 -0
  31. data/lib/rdoc/generator/template/42floors/resources/i/results_bg.png +0 -0
  32. data/lib/rdoc/generator/template/42floors/resources/i/tree_bg.png +0 -0
  33. data/lib/rdoc/generator/template/42floors/resources/js/highlight.pack.js +1 -0
  34. data/lib/rdoc/generator/template/42floors/resources/js/jquery-1.3.2.min.js +19 -0
  35. data/lib/rdoc/generator/template/42floors/resources/js/jquery-effect.js +593 -0
  36. data/lib/rdoc/generator/template/42floors/resources/js/main.js +20 -0
  37. data/lib/rdoc/generator/template/42floors/resources/js/searchdoc.js +442 -0
  38. data/lib/rdoc/generator/template/42floors/resources/panel/index.html +73 -0
  39. data/lib/rdoc/generator/template/42floors/se_index.rhtml +8 -0
  40. data/mls.gemspec +7 -4
  41. data/test/factories/account.rb +18 -0
  42. data/test/factories/address.rb +15 -0
  43. data/test/factories/listing.rb +30 -0
  44. data/test/factories/tour_request.rb +9 -0
  45. data/test/fixtures/flyer.pdf +68 -0
  46. data/test/test_helper.rb +44 -5
  47. data/test/units/models/test_account.rb +20 -43
  48. data/test/units/models/test_flyer.rb +22 -0
  49. data/test/units/models/test_listing.rb +119 -0
  50. data/test/units/models/test_photo.rb +136 -3
  51. data/test/units/models/test_tour_request.rb +25 -20
  52. data/test/units/test_errors.rb +12 -4
  53. data/test/units/test_mls.rb +263 -3
  54. data/test/units/test_resource.rb +1 -0
  55. metadata +78 -57
  56. data/lib/mls/models/user.rb +0 -7
  57. data/lib/mls/version.rb +0 -3
@@ -0,0 +1,339 @@
1
+ body {
2
+ font-family: "Helvetica Neue", Arial, sans-serif;
3
+ background: #FFF;
4
+ color: #000;
5
+ margin: 0px;
6
+ font-size: 0.82em;
7
+ line-height: 1.25em;
8
+ }
9
+
10
+ a:link, a:active, a:visited, a:hover {
11
+ color: #769028;
12
+ text-decoration: none;
13
+ }
14
+
15
+ a:hover, .banner a:hover {
16
+ color: #333;
17
+ background: #FE8;
18
+ }
19
+
20
+ h1 a, h2 a, .banner a {
21
+ color: #fff;
22
+ }
23
+
24
+ h1 a:hover, h2 a:hover {
25
+ color: #fff;
26
+ }
27
+
28
+ p {
29
+ margin-bottom: 1em;
30
+ }
31
+
32
+ h1 {
33
+ font-size: 2.1em;
34
+ font-weight: normal;
35
+ line-height: 1.2em;
36
+ margin: 1.4em 0 0.7em 0;
37
+ }
38
+
39
+ h2 {
40
+ font-size: 1.6em;
41
+ margin: 1.8em 0 0.8em 0;
42
+ font-weight: normal;
43
+ line-height: 1.2em;
44
+ }
45
+
46
+ h3 {
47
+ font-size: 1.4em;
48
+ color:#555;
49
+ margin: 1.4em 0 0.7em 0;
50
+ font-weight: normal;
51
+ }
52
+
53
+ h4 {
54
+ margin: 1.4em 0 0.5em 0;
55
+ font-size: 1em;
56
+ }
57
+
58
+ table
59
+ {
60
+ margin-bottom: 1em;
61
+ }
62
+
63
+ td, th
64
+ {
65
+ padding: 0 0.7em 0.3em 0;
66
+ }
67
+
68
+ th
69
+ {
70
+ font-weight: bold;
71
+ }
72
+
73
+ .clear
74
+ {
75
+ clear: both;
76
+ width: 0; height: 0;
77
+ }
78
+
79
+ dt
80
+ {
81
+ margin-bottom: 0.3em;
82
+ font-weight: bold;
83
+ }
84
+
85
+ dd
86
+ {
87
+ margin-left: 2em;
88
+ margin-bottom: 1em;
89
+ }
90
+
91
+ dd p
92
+ {
93
+ margin-top: 0.6em;
94
+ }
95
+
96
+ li
97
+ {
98
+ margin: 0 0 0.5em 2em;
99
+ }
100
+
101
+ ul li
102
+ {
103
+ list-style: disc;
104
+ }
105
+
106
+ ol li
107
+ {
108
+ list-style: decimal;
109
+ }
110
+
111
+ .banner
112
+ {
113
+ background: #97B833;
114
+ color: #fff;
115
+ border-bottom: 1px solid #769028;
116
+ padding: 1em 2em 0.5em 2em;
117
+ }
118
+ .banner h1
119
+ {
120
+ font-size: 1.2em;
121
+ margin: 0;
122
+ }
123
+
124
+ .banner h1 .type
125
+ {
126
+ font-size: 0.833em;
127
+ display:block;
128
+ }
129
+
130
+ .banner h1 .type,
131
+ .banner h1 .parent
132
+ {
133
+ color: #ccc;
134
+ }
135
+
136
+ .banner ul
137
+ {
138
+ margin-top: 0.3em;
139
+ margin-bottom: 0;
140
+ font-size: 0.85em;
141
+ }
142
+
143
+ .banner li
144
+ {
145
+ list-style: none;
146
+ margin-left: 0;
147
+ margin-bottom: 0;
148
+ }
149
+
150
+ .banner .github_url {
151
+ color: #CCC;
152
+ }
153
+
154
+ pre
155
+ {
156
+ margin-bottom: 1em;
157
+ }
158
+
159
+ .methods dt
160
+ {
161
+ width: 1em;
162
+ font-size: 1.5em;
163
+ color:#AAA;
164
+ position: absolute;
165
+ font-weight: normal;
166
+ margin: 0;
167
+ }
168
+
169
+ .methods dd
170
+ {
171
+ margin-left: 2.5em;
172
+ min-height: 1.8em;
173
+ -height: 1.8em;
174
+ padding-bottom: 0.8em;
175
+ }
176
+
177
+
178
+ .methods ul li
179
+ {
180
+ margin-right: 0.7em;
181
+ margin-left: 0;
182
+ list-style: none;
183
+ display: inline;
184
+ }
185
+
186
+ #content {
187
+ margin: 2em;
188
+ margin-left: 3.5em;
189
+ margin-right: 3.5em;
190
+ }
191
+
192
+
193
+ .sectiontitle {
194
+ margin-top: 2em;
195
+ margin-bottom: 1.3em;
196
+ margin-left: -1.2em;
197
+ font-size: 1.2em;
198
+ padding: 0 0 0.25em 0;
199
+ font-weight: bold;
200
+ border-bottom: 1px solid #000;
201
+ }
202
+
203
+ .contenttitle {
204
+ margin-top: 4em;
205
+ margin-bottom: 1.3em;
206
+ margin-left: -0.9em;
207
+ font-size: 1.6em;
208
+ padding: 0 0 0.25em 0;
209
+ font-weight: bold;
210
+ }
211
+
212
+ .attr-rw {
213
+ padding-right: 1em;
214
+ text-align: center;
215
+ color: #055;
216
+ }
217
+
218
+ .attr-name {
219
+ font-weight: bold;
220
+ padding-right: 1em;
221
+ }
222
+
223
+ .attr-desc {
224
+ }
225
+
226
+ tt {
227
+ font-size: 1.15em;
228
+ }
229
+
230
+ .attr-value {
231
+ font-family: monospace;
232
+ padding-left: 1em;
233
+ font-size: 1.15em;
234
+ }
235
+
236
+ .dyn-source {
237
+ display: none;
238
+ background: #fffde8;
239
+ color: #000;
240
+ border: #ffe0bb dotted 1px;
241
+ margin: 0.5em 2em 0.5em 0;
242
+ padding: 0.5em;
243
+ }
244
+
245
+ .dyn-source .cmt {
246
+ color: #00F;
247
+ font-style: italic;
248
+ }
249
+
250
+ .dyn-source .kw {
251
+ color: #070;
252
+ font-weight: bold;
253
+ }
254
+
255
+ .description pre {
256
+ padding: 0.5em;
257
+ border: #ffe0bb dotted 1px;
258
+ background: #fffde8;
259
+ }
260
+
261
+ .method {
262
+ margin-bottom: 2em;
263
+ }
264
+ .method .description,
265
+ .method .sourcecode
266
+ {
267
+ margin-left: 1.2em;
268
+ }
269
+ .method h4
270
+ {
271
+ border-bottom: 1px dotted #999;
272
+ padding: 0 0 0.2em 0;
273
+ margin-bottom: 0.8em;
274
+ font-size: 1.1em;
275
+ color:#333;
276
+ }
277
+ .method .method-title {
278
+ border-bottom: 1px dotted #666;
279
+ padding: 0 0 0.15em 0;
280
+ margin: 0 0 0.5em 0;
281
+ font-size: 1.2em;
282
+ line-height: 1.25em;
283
+ }
284
+
285
+ .method .sourcecode p.source-link {
286
+ text-indent: 0em;
287
+ margin-top: 0.5em;
288
+ }
289
+
290
+ .method .aka {
291
+ margin-top: 0.3em;
292
+ margin-left: 1em;
293
+ font-style: italic;
294
+ text-indent: 2em;
295
+ }
296
+
297
+ .method .source-link
298
+ {
299
+ font-size: 0.85em;
300
+ }
301
+
302
+ .ruby-constant {
303
+ color: teal;
304
+ }
305
+ .ruby-keyword {
306
+ color: #000;
307
+ font-weight: bold
308
+ }
309
+ .ruby-title {
310
+ color: #900;
311
+ font-weight: bold;
312
+ }
313
+ .ruby-ivar {
314
+ color: teal;
315
+ }
316
+ .ruby-operator {
317
+ color: #000;
318
+ font-weight: bold
319
+ }
320
+ .ruby-identifier {
321
+ color: #000;
322
+ }
323
+ .ruby-string,
324
+ .ruby-node {
325
+ color: #D14;
326
+ }
327
+ .ruby-comment {
328
+ color: #998;
329
+ font-style: italic;
330
+ }
331
+ .ruby-regexp {
332
+ color: #009926;
333
+ }
334
+ .ruby-value {
335
+ color: #990073;
336
+ }
337
+ .ruby-number {
338
+ color: #40A070;
339
+ }
@@ -0,0 +1,389 @@
1
+ /* Panel (begin) */
2
+ .panel
3
+ {
4
+ position: absolute;
5
+ width: 100%;
6
+ height: 100%;
7
+ top: 0;
8
+ left: 0;
9
+ background: #FFF;
10
+ z-index: 2;
11
+ font-family: "Helvetica Neue", "Arial", sans-serif;
12
+ //zoom: 1;
13
+ }
14
+
15
+ .panel_tree .results,
16
+ .panel_results .tree
17
+ {
18
+ display: none;
19
+ }
20
+
21
+ /* Header with search box (begin) */
22
+ .panel .header
23
+ {
24
+ width: 100%;
25
+ height: 29px;
26
+ border-bottom: 1px solid #666;
27
+ position: relative;
28
+ left: 0; top: 0;
29
+ background: #e8e8e8;
30
+ }
31
+
32
+ .panel .header div
33
+ {
34
+ margin: 0 7px;
35
+ }
36
+ .panel .header table
37
+ {
38
+ height: 29px;
39
+ width: 100%;
40
+ }
41
+
42
+ .panel .header table td
43
+ {
44
+ vertical-align: middle;
45
+ text-align: middle;
46
+ }
47
+
48
+ .panel .header label
49
+ {
50
+ position: absolute;
51
+ font-size: 12px;
52
+ line-height: 29px;
53
+ margin-left: 3px;
54
+ color: #777;
55
+ cursor: text;
56
+ }
57
+
58
+ .panel .header table input
59
+ {
60
+ width: 100%;
61
+ box-sizing: border-box;
62
+ -moz-box-sizing: border-box;
63
+ -webkit-box-sizing: border-box;
64
+ display: inline-block;
65
+ -webkit-appearance: searchfield;
66
+ height: 22px;
67
+ //height: auto;
68
+ }
69
+
70
+ /* Header with search box (end) */
71
+
72
+
73
+ /* Results (begin) */
74
+ .panel .result
75
+ {
76
+ position: absolute;
77
+ top: 30px;
78
+ bottom: 0;
79
+ left: 0;
80
+ width: 100%;
81
+ //height: expression((this.parentNode.offsetHeight - 31));
82
+ overflow-y: scroll;
83
+ overflow-x: hidden;
84
+ -overflow-y: hidden;
85
+ background: #eee url(../i/results_bg.png);
86
+ z-index: 2;
87
+ //zoom:1;
88
+ }
89
+
90
+ .panel .result ul
91
+ {
92
+ font-size: 0.8em;
93
+ width: 100%;
94
+ background: #eee url(../i/results_bg.png);
95
+ //zoom:1;
96
+ }
97
+
98
+ .panel .result ul li
99
+ {
100
+ height: 46px;
101
+ -height: 50px;
102
+ //display: inline;
103
+ //width: 100%;
104
+ //zoom: 1;
105
+ overflow: hidden;
106
+ padding: 4px 10px 0 10px;
107
+ cursor: pointer;
108
+ }
109
+
110
+ .panel .result ul li h1
111
+ {
112
+ font-size: 13px;
113
+ font-weight: normal;
114
+ color: #333;
115
+ margin-bottom: 2px;
116
+ white-space: nowrap;
117
+ }
118
+
119
+ .panel .result ul li p
120
+ {
121
+ font-size: 11px;
122
+ color: #333;
123
+ margin-bottom: 2px;
124
+ white-space: nowrap;
125
+ }
126
+
127
+ .panel .result ul li h1 i,
128
+ .panel .result ul li p.snippet
129
+ {
130
+ color: #777;
131
+ }
132
+
133
+ .panel .result ul li b
134
+ {
135
+ color: #000;
136
+ }
137
+
138
+ .panel .result ul li.current
139
+ {
140
+ background: #97B833;
141
+ }
142
+
143
+ .panel .result ul li.current h1,
144
+ .panel .result ul li.current p
145
+ {
146
+ color: #D9D9D9;
147
+ }
148
+
149
+ .panel .result ul li.current h1 i,
150
+ .panel .result ul li.current p.snippet
151
+ {
152
+ color: #ACACAC;
153
+ }
154
+
155
+ .panel .result ul li.current b
156
+ {
157
+ color: #FFF;
158
+ }
159
+
160
+
161
+ .panel .result ul li:hover,
162
+ .panel .result ul li.selected
163
+ {
164
+ background: #d0d0d0;
165
+ }
166
+
167
+ .panel .result ul li.current:hover
168
+ {
169
+ background: #769028;
170
+ }
171
+
172
+ .panel .result ul li .badge
173
+ {
174
+ margin-right: 0.4em;
175
+ margin-left: -0.2em;
176
+ padding: 0 0.2em;
177
+ color: #000;
178
+ border-radius: 3px;
179
+ }
180
+
181
+ .panel .result ul li .badge_1
182
+ {
183
+ background: #ACDBF4;
184
+ }
185
+
186
+ .panel .result ul li.current .badge_1
187
+ {
188
+ background: #97BFD7;
189
+ }
190
+
191
+ .panel .result ul li .badge_2
192
+ {
193
+ background: #ACF3C3;
194
+ }
195
+
196
+ .panel .result ul li.current .badge_2
197
+ {
198
+ background: #98D7AC;
199
+ }
200
+
201
+ .panel .result ul li .badge_3
202
+ {
203
+ background: #E0F3AC;
204
+ }
205
+
206
+ .panel .result ul li.current .badge_3
207
+ {
208
+ background: #C4D798;
209
+ }
210
+
211
+ .panel .result ul li .badge_4
212
+ {
213
+ background: #D7CA98;
214
+ }
215
+
216
+ .panel .result ul li.current .badge_4
217
+ {
218
+ background: #A6B0AC;
219
+ }
220
+
221
+ .panel .result ul li .badge_5
222
+ {
223
+ background: #F3C8AC;
224
+ }
225
+
226
+ .panel .result ul li.current .badge_5
227
+ {
228
+ background: #D7B198;
229
+ }
230
+
231
+ .panel .result ul li .badge_6
232
+ {
233
+ background: #F3ACC3;
234
+ }
235
+
236
+ .panel .result ul li.current .badge_6
237
+ {
238
+ background: #D798AB;
239
+ }
240
+
241
+ /* Results (end) */
242
+
243
+ /* Tree (begin) */ /**/
244
+ .panel .tree
245
+ {
246
+ position: absolute;
247
+ top: 30px;
248
+ bottom: 0;
249
+ left: 0;
250
+ width: 100%;
251
+ //zoom: 1;
252
+ //height: expression((this.parentNode.offsetHeight - 31));
253
+ overflow-y: scroll;
254
+ overflow-x: hidden;
255
+ -overflow-y: hidden;
256
+ background: #eee url(../i/tree_bg.png);
257
+ z-index: 30;
258
+ }
259
+
260
+ .panel .tree ul
261
+ {
262
+ background: #eee url(../i/tree_bg.png);
263
+ }
264
+
265
+ .panel .tree li
266
+ {
267
+ cursor: pointer;
268
+ overflow: hidden;
269
+ //height: 23px;
270
+ //display: inline;
271
+ //zoom: 1;
272
+ //width: 100%;
273
+ }
274
+
275
+
276
+ .panel .tree li .content
277
+ {
278
+ padding-left: 18px;
279
+ padding-top: 5px;
280
+ height: 18px;
281
+ overflow: hidden;
282
+ position: relative;
283
+ }
284
+
285
+ .panel .tree li .icon
286
+ {
287
+ width: 10px;
288
+ height: 9px;
289
+ background: url(../i/arrows.png);
290
+ background-position: 0 -9px;
291
+ position: absolute;
292
+ left: 1px;
293
+ top: 8px;
294
+ cursor: default;
295
+ }
296
+
297
+ .panel .tree li.closed .icon
298
+ {
299
+ background-position: 0 0;
300
+ }
301
+
302
+ .panel .tree ul li h1
303
+ {
304
+ font-size: 13px;
305
+ font-weight: normal;
306
+ color: #000;
307
+ margin-bottom: 2px;
308
+ white-space: nowrap;
309
+ }
310
+
311
+ .panel .tree ul li p
312
+ {
313
+ font-size: 11px;
314
+ color: #666;
315
+ margin-bottom: 2px;
316
+ white-space: nowrap;
317
+ }
318
+
319
+ .panel .tree ul li h1 i
320
+ {
321
+ color: #999;
322
+ font-style: normal;
323
+ }
324
+
325
+ .panel .tree ul li.current h1 i
326
+ {
327
+ color: #CCC;
328
+ }
329
+
330
+ .panel .tree ul li.empty
331
+ {
332
+ cursor: text;
333
+ }
334
+
335
+ .panel .tree ul li.empty h1,
336
+ .panel .tree ul li.empty p
337
+ {
338
+ color: #666;
339
+ font-style: italic;
340
+ }
341
+
342
+ .panel .tree ul li.current
343
+ {
344
+ background: #97B833;
345
+ }
346
+
347
+ .panel .tree ul li.current .icon
348
+ {
349
+ background-position: -10px -9px;
350
+ }
351
+
352
+ .panel .tree ul li.current.closed .icon
353
+ {
354
+ background-position: -10px 0;
355
+ }
356
+
357
+ .panel .tree ul li.current h1
358
+ {
359
+ color: #FFF;
360
+ }
361
+
362
+ .panel .tree ul li.current p
363
+ {
364
+ color: #CCC;
365
+ }
366
+
367
+ .panel .tree ul li.current.empty h1,
368
+ .panel .tree ul li.current.empty p
369
+ {
370
+ color: #999;
371
+ }
372
+
373
+ .panel .tree ul li:hover
374
+ {
375
+ background: #d0d0d0;
376
+ }
377
+
378
+ .panel .tree ul li.current:hover
379
+ {
380
+ background: #769028;
381
+ }
382
+
383
+ .panel .tree .stopper
384
+ {
385
+ display: none;
386
+ }
387
+ /* Tree (end) */ /**/
388
+
389
+ /* Panel (end) */