surrounded 0.7.3 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,255 @@
1
+ @import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700);
2
+
3
+ body {
4
+ padding:50px;
5
+ font:14px/1.5 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
6
+ color:#777;
7
+ font-weight:300;
8
+ }
9
+
10
+ h1, h2, h3, h4, h5, h6 {
11
+ color:#222;
12
+ margin:0 0 20px;
13
+ }
14
+
15
+ p, ul, ol, table, pre, dl {
16
+ margin:0 0 20px;
17
+ }
18
+
19
+ h1, h2, h3 {
20
+ line-height:1.1;
21
+ }
22
+
23
+ h1 {
24
+ font-size:28px;
25
+ }
26
+
27
+ h2 {
28
+ color:#393939;
29
+ }
30
+
31
+ h3, h4, h5, h6 {
32
+ color:#494949;
33
+ }
34
+
35
+ a {
36
+ color:#39c;
37
+ font-weight:400;
38
+ text-decoration:none;
39
+ }
40
+
41
+ a small {
42
+ font-size:11px;
43
+ color:#777;
44
+ margin-top:-0.6em;
45
+ display:block;
46
+ }
47
+
48
+ .wrapper {
49
+ width:860px;
50
+ margin:0 auto;
51
+ }
52
+
53
+ blockquote {
54
+ border-left:1px solid #e5e5e5;
55
+ margin:0;
56
+ padding:0 0 0 20px;
57
+ font-style:italic;
58
+ }
59
+
60
+ code, pre {
61
+ font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal;
62
+ color:#333;
63
+ font-size:12px;
64
+ }
65
+
66
+ pre {
67
+ padding:8px 15px;
68
+ background: #f8f8f8;
69
+ border-radius:5px;
70
+ border:1px solid #e5e5e5;
71
+ overflow-x: auto;
72
+ }
73
+
74
+ table {
75
+ width:100%;
76
+ border-collapse:collapse;
77
+ }
78
+
79
+ th, td {
80
+ text-align:left;
81
+ padding:5px 10px;
82
+ border-bottom:1px solid #e5e5e5;
83
+ }
84
+
85
+ dt {
86
+ color:#444;
87
+ font-weight:700;
88
+ }
89
+
90
+ th {
91
+ color:#444;
92
+ }
93
+
94
+ img {
95
+ max-width:100%;
96
+ }
97
+
98
+ header {
99
+ width:270px;
100
+ float:left;
101
+ position:fixed;
102
+ }
103
+
104
+ header ul {
105
+ list-style:none;
106
+ height:40px;
107
+
108
+ padding:0;
109
+
110
+ background: #eee;
111
+ background: -moz-linear-gradient(top, #f8f8f8 0%, #dddddd 100%);
112
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#dddddd));
113
+ background: -webkit-linear-gradient(top, #f8f8f8 0%,#dddddd 100%);
114
+ background: -o-linear-gradient(top, #f8f8f8 0%,#dddddd 100%);
115
+ background: -ms-linear-gradient(top, #f8f8f8 0%,#dddddd 100%);
116
+ background: linear-gradient(top, #f8f8f8 0%,#dddddd 100%);
117
+
118
+ border-radius:5px;
119
+ border:1px solid #d2d2d2;
120
+ box-shadow:inset #fff 0 1px 0, inset rgba(0,0,0,0.03) 0 -1px 0;
121
+ width:270px;
122
+ }
123
+
124
+ header li {
125
+ width:89px;
126
+ float:left;
127
+ border-right:1px solid #d2d2d2;
128
+ height:40px;
129
+ }
130
+
131
+ header ul a {
132
+ line-height:1;
133
+ font-size:11px;
134
+ color:#999;
135
+ display:block;
136
+ text-align:center;
137
+ padding-top:6px;
138
+ height:40px;
139
+ }
140
+
141
+ strong {
142
+ color:#222;
143
+ font-weight:700;
144
+ }
145
+
146
+ header ul li + li {
147
+ width:88px;
148
+ border-left:1px solid #fff;
149
+ }
150
+
151
+ header ul li + li + li {
152
+ border-right:none;
153
+ width:89px;
154
+ }
155
+
156
+ header ul a strong {
157
+ font-size:14px;
158
+ display:block;
159
+ color:#222;
160
+ }
161
+
162
+ section {
163
+ width:500px;
164
+ float:right;
165
+ padding-bottom:50px;
166
+ }
167
+
168
+ small {
169
+ font-size:11px;
170
+ }
171
+
172
+ hr {
173
+ border:0;
174
+ background:#e5e5e5;
175
+ height:1px;
176
+ margin:0 0 20px;
177
+ }
178
+
179
+ footer {
180
+ width:270px;
181
+ float:left;
182
+ position:fixed;
183
+ bottom:50px;
184
+ }
185
+
186
+ @media print, screen and (max-width: 960px) {
187
+
188
+ div.wrapper {
189
+ width:auto;
190
+ margin:0;
191
+ }
192
+
193
+ header, section, footer {
194
+ float:none;
195
+ position:static;
196
+ width:auto;
197
+ }
198
+
199
+ header {
200
+ padding-right:320px;
201
+ }
202
+
203
+ section {
204
+ border:1px solid #e5e5e5;
205
+ border-width:1px 0;
206
+ padding:20px 0;
207
+ margin:0 0 20px;
208
+ }
209
+
210
+ header a small {
211
+ display:inline;
212
+ }
213
+
214
+ header ul {
215
+ position:absolute;
216
+ right:50px;
217
+ top:52px;
218
+ }
219
+ }
220
+
221
+ @media print, screen and (max-width: 720px) {
222
+ body {
223
+ word-wrap:break-word;
224
+ }
225
+
226
+ header {
227
+ padding:0;
228
+ }
229
+
230
+ header ul, header p.view {
231
+ position:static;
232
+ }
233
+
234
+ pre, code {
235
+ word-wrap:normal;
236
+ }
237
+ }
238
+
239
+ @media print, screen and (max-width: 480px) {
240
+ body {
241
+ padding:15px;
242
+ }
243
+
244
+ header ul {
245
+ display:none;
246
+ }
247
+ }
248
+
249
+ @media print {
250
+ body {
251
+ padding:0.4in;
252
+ font-size:12pt;
253
+ color:#444;
254
+ }
255
+ }
@@ -0,0 +1,371 @@
1
+ /* http://meyerweb.com/eric/tools/css/reset/
2
+ v2.0 | 20110126
3
+ License: none (public domain)
4
+ */
5
+ html, body, div, span, applet, object, iframe,
6
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
7
+ a, abbr, acronym, address, big, cite, code,
8
+ del, dfn, em, img, ins, kbd, q, s, samp,
9
+ small, strike, strong, sub, sup, tt, var,
10
+ b, u, i, center,
11
+ dl, dt, dd, ol, ul, li,
12
+ fieldset, form, label, legend,
13
+ table, caption, tbody, tfoot, thead, tr, th, td,
14
+ article, aside, canvas, details, embed,
15
+ figure, figcaption, footer, header, hgroup,
16
+ menu, nav, output, ruby, section, summary,
17
+ time, mark, audio, video {
18
+ margin: 0;
19
+ padding: 0;
20
+ border: 0;
21
+ font-size: 100%;
22
+ font: inherit;
23
+ vertical-align: baseline;
24
+ }
25
+ /* HTML5 display-role reset for older browsers */
26
+ article, aside, details, figcaption, figure,
27
+ footer, header, hgroup, menu, nav, section {
28
+ display: block;
29
+ }
30
+ body {
31
+ line-height: 1;
32
+ }
33
+ ol, ul {
34
+ list-style: none;
35
+ }
36
+ blockquote, q {
37
+ quotes: none;
38
+ }
39
+ blockquote:before, blockquote:after,
40
+ q:before, q:after {
41
+ content: '';
42
+ content: none;
43
+ }
44
+ table {
45
+ border-collapse: collapse;
46
+ border-spacing: 0;
47
+ }
48
+
49
+ /* LAYOUT STYLES */
50
+ body {
51
+ font-size: 1em;
52
+ line-height: 1.5;
53
+ background: #e7e7e7 url(../images/body-bg.png) 0 0 repeat;
54
+ font-family: 'Helvetica Neue', Helvetica, Arial, serif;
55
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
56
+ color: #6d6d6d;
57
+ }
58
+
59
+ a {
60
+ color: #d5000d;
61
+ }
62
+ a:hover {
63
+ color: #c5000c;
64
+ }
65
+
66
+ header {
67
+ padding-top: 35px;
68
+ padding-bottom: 25px;
69
+ }
70
+
71
+ header h1 {
72
+ font-family: 'Chivo', 'Helvetica Neue', Helvetica, Arial, serif; font-weight: 900;
73
+ letter-spacing: -1px;
74
+ font-size: 48px;
75
+ color: #303030;
76
+ line-height: 1.2;
77
+ }
78
+
79
+ header h2 {
80
+ letter-spacing: -1px;
81
+ font-size: 24px;
82
+ color: #aaa;
83
+ font-weight: normal;
84
+ line-height: 1.3;
85
+ }
86
+
87
+ #container {
88
+ background: transparent url(../images/highlight-bg.jpg) 50% 0 no-repeat;
89
+ min-height: 595px;
90
+ }
91
+
92
+ .inner {
93
+ width: 620px;
94
+ margin: 0 auto;
95
+ }
96
+
97
+ #container .inner img {
98
+ max-width: 100%;
99
+ }
100
+
101
+ #downloads {
102
+ margin-bottom: 40px;
103
+ }
104
+
105
+ a.button {
106
+ -moz-border-radius: 30px;
107
+ -webkit-border-radius: 30px;
108
+ border-radius: 30px;
109
+ border-top: solid 1px #cbcbcb;
110
+ border-left: solid 1px #b7b7b7;
111
+ border-right: solid 1px #b7b7b7;
112
+ border-bottom: solid 1px #b3b3b3;
113
+ color: #303030;
114
+ line-height: 25px;
115
+ font-weight: bold;
116
+ font-size: 15px;
117
+ padding: 12px 8px 12px 8px;
118
+ display: block;
119
+ float: left;
120
+ width: 179px;
121
+ margin-right: 14px;
122
+ background: #fdfdfd; /* Old browsers */
123
+ background: -moz-linear-gradient(top, #fdfdfd 0%, #f2f2f2 100%); /* FF3.6+ */
124
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fdfdfd), color-stop(100%,#f2f2f2)); /* Chrome,Safari4+ */
125
+ background: -webkit-linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* Chrome10+,Safari5.1+ */
126
+ background: -o-linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* Opera 11.10+ */
127
+ background: -ms-linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* IE10+ */
128
+ background: linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* W3C */
129
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fdfdfd', endColorstr='#f2f2f2',GradientType=0 ); /* IE6-9 */
130
+ -webkit-box-shadow: 10px 10px 5px #888;
131
+ -moz-box-shadow: 10px 10px 5px #888;
132
+ box-shadow: 0px 1px 5px #e8e8e8;
133
+ }
134
+ a.button:hover {
135
+ border-top: solid 1px #b7b7b7;
136
+ border-left: solid 1px #b3b3b3;
137
+ border-right: solid 1px #b3b3b3;
138
+ border-bottom: solid 1px #b3b3b3;
139
+ background: #fafafa; /* Old browsers */
140
+ background: -moz-linear-gradient(top, #fdfdfd 0%, #f6f6f6 100%); /* FF3.6+ */
141
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fdfdfd), color-stop(100%,#f6f6f6)); /* Chrome,Safari4+ */
142
+ background: -webkit-linear-gradient(top, #fdfdfd 0%,#f6f6f6 100%); /* Chrome10+,Safari5.1+ */
143
+ background: -o-linear-gradient(top, #fdfdfd 0%,#f6f6f6 100%); /* Opera 11.10+ */
144
+ background: -ms-linear-gradient(top, #fdfdfd 0%,#f6f6f6 100%); /* IE10+ */
145
+ background: linear-gradient(top, #fdfdfd 0%,#f6f6f6, 100%); /* W3C */
146
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fdfdfd', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */
147
+ }
148
+
149
+ a.button span {
150
+ padding-left: 50px;
151
+ display: block;
152
+ height: 23px;
153
+ }
154
+
155
+ #download-zip span {
156
+ background: transparent url(../images/zip-icon.png) 12px 50% no-repeat;
157
+ }
158
+ #download-tar-gz span {
159
+ background: transparent url(../images/tar-gz-icon.png) 12px 50% no-repeat;
160
+ }
161
+ #view-on-github span {
162
+ background: transparent url(../images/octocat-icon.png) 12px 50% no-repeat;
163
+ }
164
+ #view-on-github {
165
+ margin-right: 0;
166
+ }
167
+
168
+ code, pre {
169
+ font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal;
170
+ color: #222;
171
+ margin-bottom: 30px;
172
+ font-size: 14px;
173
+ }
174
+
175
+ code {
176
+ background-color: #f2f2f2;
177
+ border: solid 1px #ddd;
178
+ padding: 0 3px;
179
+ }
180
+
181
+ pre {
182
+ padding: 20px;
183
+ background: #303030;
184
+ color: #f2f2f2;
185
+ text-shadow: none;
186
+ overflow: auto;
187
+ }
188
+ pre code {
189
+ color: #f2f2f2;
190
+ background-color: #303030;
191
+ border: none;
192
+ padding: 0;
193
+ }
194
+
195
+ ul, ol, dl {
196
+ margin-bottom: 20px;
197
+ }
198
+
199
+
200
+ /* COMMON STYLES */
201
+
202
+ hr {
203
+ height: 1px;
204
+ line-height: 1px;
205
+ margin-top: 1em;
206
+ padding-bottom: 1em;
207
+ border: none;
208
+ background: transparent url('../images/hr.png') 50% 0 no-repeat;
209
+ }
210
+
211
+ strong {
212
+ font-weight: bold;
213
+ }
214
+
215
+ em {
216
+ font-style: italic;
217
+ }
218
+
219
+ table {
220
+ width: 100%;
221
+ border: 1px solid #ebebeb;
222
+ }
223
+
224
+ th {
225
+ font-weight: 500;
226
+ }
227
+
228
+ td {
229
+ border: 1px solid #ebebeb;
230
+ text-align: center;
231
+ font-weight: 300;
232
+ }
233
+
234
+ form {
235
+ background: #f2f2f2;
236
+ padding: 20px;
237
+
238
+ }
239
+
240
+
241
+ /* GENERAL ELEMENT TYPE STYLES */
242
+
243
+ h1 {
244
+ font-size: 32px;
245
+ }
246
+
247
+ h2 {
248
+ font-size: 22px;
249
+ font-weight: bold;
250
+ color: #303030;
251
+ margin-bottom: 8px;
252
+ }
253
+
254
+ h3 {
255
+ color: #d5000d;
256
+ font-size: 18px;
257
+ font-weight: bold;
258
+ margin-bottom: 8px;
259
+ }
260
+
261
+ h4 {
262
+ font-size: 16px;
263
+ color: #303030;
264
+ font-weight: bold;
265
+ }
266
+
267
+ h5 {
268
+ font-size: 1em;
269
+ color: #303030;
270
+ }
271
+
272
+ h6 {
273
+ font-size: .8em;
274
+ color: #303030;
275
+ }
276
+
277
+ p {
278
+ font-weight: 300;
279
+ margin-bottom: 20px;
280
+ }
281
+
282
+ a {
283
+ text-decoration: none;
284
+ }
285
+
286
+ p a {
287
+ font-weight: 400;
288
+ }
289
+
290
+ blockquote {
291
+ font-size: 1.6em;
292
+ border-left: 10px solid #e9e9e9;
293
+ margin-bottom: 20px;
294
+ padding: 0 0 0 30px;
295
+ }
296
+
297
+ ul li {
298
+ list-style: disc inside;
299
+ padding-left: 20px;
300
+ }
301
+
302
+ ol li {
303
+ list-style: decimal inside;
304
+ padding-left: 3px;
305
+ }
306
+
307
+ dl dt {
308
+ color: #303030;
309
+ }
310
+
311
+ footer {
312
+ background: transparent url('../images/hr.png') 0 0 no-repeat;
313
+ margin-top: 40px;
314
+ padding-top: 20px;
315
+ padding-bottom: 30px;
316
+ font-size: 13px;
317
+ color: #aaa;
318
+ }
319
+
320
+ footer a {
321
+ color: #666;
322
+ }
323
+ footer a:hover {
324
+ color: #444;
325
+ }
326
+
327
+ /* MISC */
328
+ .clearfix:after {
329
+ clear: both;
330
+ content: '.';
331
+ display: block;
332
+ visibility: hidden;
333
+ height: 0;
334
+ }
335
+
336
+ .clearfix {display: inline-block;}
337
+ * html .clearfix {height: 1%;}
338
+ .clearfix {display: block;}
339
+
340
+ /* #Media Queries
341
+ ================================================== */
342
+
343
+ /* Smaller than standard 960 (devices and browsers) */
344
+ @media only screen and (max-width: 959px) {}
345
+
346
+ /* Tablet Portrait size to standard 960 (devices and browsers) */
347
+ @media only screen and (min-width: 768px) and (max-width: 959px) {}
348
+
349
+ /* All Mobile Sizes (devices and browser) */
350
+ @media only screen and (max-width: 767px) {
351
+ header {
352
+ padding-top: 10px;
353
+ padding-bottom: 10px;
354
+ }
355
+ #downloads {
356
+ margin-bottom: 25px;
357
+ }
358
+ #download-zip, #download-tar-gz {
359
+ display: none;
360
+ }
361
+ .inner {
362
+ width: 94%;
363
+ margin: 0 auto;
364
+ }
365
+ }
366
+
367
+ /* Mobile Landscape Size to Tablet Portrait (devices and browsers) */
368
+ @media only screen and (min-width: 480px) and (max-width: 767px) {}
369
+
370
+ /* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */
371
+ @media only screen and (max-width: 479px) {}
@@ -19,21 +19,8 @@ describe "Surrounded" do
19
19
  TestContext.new(jim, guille)
20
20
  }
21
21
 
22
- before do
23
- jim.store_context(context)
24
- guille.store_context(context)
25
- end
26
-
27
22
  it "has access to objects in the context" do
28
- assert_equal jim.other_user, guille
29
- end
30
-
31
- it "responds to messages for roles on the context" do
32
- assert jim.respond_to?(:other_user)
33
-
34
- jim.remove_context
35
-
36
- refute jim.respond_to?(:other_user)
23
+ assert context.access_other_object
37
24
  end
38
25
 
39
26
  it "prevents access to context objects for external objects" do
@@ -43,15 +30,24 @@ describe "Surrounded" do
43
30
  end
44
31
  end
45
32
 
33
+ class UnsurroundedObject
34
+ attr_accessor :name
35
+ end
36
+
46
37
  describe "Surrounded", "added to an existing object" do
47
38
  it "allows the object to store its context" do
48
- object = Object.new
39
+ thing = UnsurroundedObject.new
40
+ thing.name = 'Jim'
41
+
49
42
  assert_raises(NoMethodError){
50
- object.store_context(self)
43
+ thing.send(:store_context)
51
44
  }
52
- object.extend(Surrounded)
53
- assert object.store_context(self)
54
- assert object.remove_context
45
+ thing.extend(Surrounded)
46
+
47
+ other = User.new('Guille')
48
+
49
+ context = TestContext.new(thing, other)
50
+ assert context.access_other_object
55
51
  end
56
52
  end
57
53
 
@@ -62,12 +58,7 @@ end
62
58
  describe "Surrounded", "added to an object through another module" do
63
59
  it "allows the object to store its context" do
64
60
  object = Array.new
65
- assert_raises(NoMethodError){
66
- object.store_context(self)
67
- }
68
61
  object.extend(SpecialSurrounding)
69
- assert object.store_context(self)
70
- assert object.remove_context
71
- assert object.send(:context)
62
+ assert object.respond_to?(:context, true)
72
63
  end
73
64
  end