fiveruns_tuneup_merb 0.5.0
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/LICENSE +22 -0
- data/README +70 -0
- data/Rakefile +49 -0
- data/TODO +2 -0
- data/app/controllers/application.rb +3 -0
- data/app/controllers/runs.rb +15 -0
- data/app/helpers/application_helper.rb +64 -0
- data/app/views/layout/fiveruns_tuneup_merb.html.erb +16 -0
- data/lib/fiveruns_tuneup_merb/api_key.rb +23 -0
- data/lib/fiveruns_tuneup_merb/instrumentation.rb +193 -0
- data/lib/fiveruns_tuneup_merb/merbtasks.rb +106 -0
- data/lib/fiveruns_tuneup_merb/slicetasks.rb +18 -0
- data/lib/fiveruns_tuneup_merb/spectasks.rb +65 -0
- data/lib/fiveruns_tuneup_merb.rb +113 -0
- data/public/images/arrows.gif +0 -0
- data/public/images/dialog.png +0 -0
- data/public/images/edit.png +0 -0
- data/public/images/fade.png +0 -0
- data/public/images/fade_down.png +0 -0
- data/public/images/head.gif +0 -0
- data/public/images/logo.gif +0 -0
- data/public/images/logo_clear.png +0 -0
- data/public/images/magnify.png +0 -0
- data/public/images/pip.gif +0 -0
- data/public/images/pointer.gif +0 -0
- data/public/images/schema.png +0 -0
- data/public/images/signin.gif +0 -0
- data/public/images/spinner.gif +0 -0
- data/public/images/warning.gif +0 -0
- data/public/javascripts/init.js +12 -0
- data/public/javascripts/jquery.js +32 -0
- data/public/javascripts/sandbox.html +7 -0
- data/public/javascripts/tuneup.js +97 -0
- data/public/stylesheets/tuneup.css +226 -0
- data/spec/controllers/main_spec.rb +61 -0
- data/spec/fiveruns_tuneup_merb_spec.rb +130 -0
- data/spec/spec_helper.rb +44 -0
- data/stubs/app/controllers/application.rb +2 -0
- data/stubs/app/controllers/main.rb +2 -0
- metadata +123 -0
@@ -0,0 +1,226 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
|
3
|
+
Code licensed under the BSD License:
|
4
|
+
http://developer.yahoo.net/yui/license.txt
|
5
|
+
version: 2.5.1
|
6
|
+
*/
|
7
|
+
/* Modified to target #tuneup div */
|
8
|
+
#tuneup div,#tuneup dl,#tuneup dt,#tuneup dd,#tuneup ul,#tuneup ol,#tuneup #tuneup li,#tuneup h1,#tuneup h2,#tuneup h3,#tuneup h4,#tuneup h5,#tuneup h6,#tuneup pre,#tuneup code,#tuneup form,#tuneup fieldset,#tuneup #tuneup legend,#tuneup input,#tuneup textarea,#tuneup p,#tuneup blockquote,#tuneup th,#tuneup td{margin:0;padding:0;}
|
9
|
+
#tuneup table{border-collapse:collapse;border-spacing:0;}
|
10
|
+
#tuneup fieldset,#tuneup img{border:0;}
|
11
|
+
#tuneup address,#tuneup caption,#tuneup cite,#tuneup code,#tuneup dfn,#tuneup em,#tuneup strong,#tuneup th,#tuneup var{font-style:normal;font-weight:normal;}
|
12
|
+
#tuneup li{list-style:none;}
|
13
|
+
#tuneup caption,#tuneup th{text-align:left;}
|
14
|
+
#tuneup h1,#tuneup h2,#tuneup h3,#tuneup h4,#tuneup h5,#tuneup h6{font-size:100%;font-weight:normal;}
|
15
|
+
#tuneup q:before,#tuneup q:after{content:'';}
|
16
|
+
#tuneup abbr,#tuneup acronym {border:0;font-variant:normal;}
|
17
|
+
#tuneup sup {vertical-align:text-top;}
|
18
|
+
#tuneup sub {vertical-align:text-bottom;}
|
19
|
+
#tuneup input,#tuneup textarea,#tuneup select{font-family:inherit;font-size:inherit;font-weight:inherit;}
|
20
|
+
#tuneup input,#tuneup textarea,#tuneup select{*font-size:100%;}
|
21
|
+
#tuneup legend{color:#000;}
|
22
|
+
#tuneup body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
|
23
|
+
#tuneup table {font-size:inherit;font:100%;}
|
24
|
+
#tuneup pre,#tuneup code,#tuneup kbd,#tuneup samp,#tuneup tt{font-family:monospace;*font-size:108%;line-height:100%;}
|
25
|
+
|
26
|
+
#tuneup-flash div,#tuneup-flash dl,#tuneup-flash dt,#tuneup-flash dd,#tuneup-flash ul,#tuneup-flash ol,#tuneup-flash #tuneup-flash li,#tuneup-flash h1,#tuneup-flash h2,#tuneup-flash h3,#tuneup-flash h4,#tuneup-flash h5,#tuneup-flash h6,#tuneup-flash pre,#tuneup-flash code,#tuneup-flash form,#tuneup-flash fieldset,#tuneup-flash #tuneup-flash legend,#tuneup-flash input,#tuneup-flash textarea,#tuneup-flash p,#tuneup-flash blockquote,#tuneup-flash th,#tuneup-flash td{margin:0;padding:0;}
|
27
|
+
#tuneup-flash table{border-collapse:collapse;border-spacing:0;}
|
28
|
+
#tuneup-flash fieldset,#tuneup-flash img{border:0;}
|
29
|
+
#tuneup-flash address,#tuneup-flash caption,#tuneup-flash cite,#tuneup-flash code,#tuneup-flash dfn,#tuneup-flash em,#tuneup-flash strong,#tuneup-flash th,#tuneup-flash var{font-style:normal;font-weight:normal;}
|
30
|
+
#tuneup-flash li{list-style:none;}
|
31
|
+
#tuneup-flash caption,#tuneup-flash th{text-align:left;}
|
32
|
+
#tuneup-flash h1,#tuneup-flash h2,#tuneup-flash h3,#tuneup-flash h4,#tuneup-flash h5,#tuneup-flash h6{font-size:100%;font-weight:normal;}
|
33
|
+
#tuneup-flash q:before,#tuneup-flash q:after{content:'';}
|
34
|
+
#tuneup-flash abbr,#tuneup-flash acronym {border:0;font-variant:normal;}
|
35
|
+
#tuneup-flash sup {vertical-align:text-top;}
|
36
|
+
#tuneup-flash sub {vertical-align:text-bottom;}
|
37
|
+
#tuneup-flash input,#tuneup-flash textarea,#tuneup-flash select{font-family:inherit;font-size:inherit;font-weight:inherit;}
|
38
|
+
#tuneup-flash input,#tuneup-flash textarea,#tuneup-flash select{*font-size:100%;}
|
39
|
+
#tuneup-flash legend{color:#000;}
|
40
|
+
#tuneup-flash body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
|
41
|
+
#tuneup-flash table {font-size:inherit;font:100%;}
|
42
|
+
#tuneup-flash pre,#tuneup-flash code,#tuneup-flash kbd,#tuneup-flash samp,#tuneup-flash tt{font-family:monospace;*font-size:108%;line-height:100%;}
|
43
|
+
/* END YUI RESET */
|
44
|
+
|
45
|
+
/* Styling */
|
46
|
+
#tuneup { position: relative; height: 50px; color: #ddd; background: #000 url(/slices/fiveruns_tuneup_merb/images/head.gif) 0 100% repeat-x; padding: 0; font-family: "Helvetica Neue", "Lucida Grande", Calibri, Helvetica, Verdana, sans-serif; font-size: 12px; }
|
47
|
+
#tuneup #tuneup-content { margin-left: 220px; color: #ddd; height: 50px; vertical-align: middle; text-align: left; }
|
48
|
+
#tuneup #tuneup-root-bar { float: right; }
|
49
|
+
#tuneup a, #tuneup a:visited, #tuneup a:active, #tuneup a:hover { cursor: pointer; background: none; color: #fff; text-decoration: underline; font-size: 12px; border: 0; }
|
50
|
+
|
51
|
+
#tuneup #tuneup-logo { float: left;}
|
52
|
+
#tuneup label { display: inline; font-size: 13px; font-weight: normal; color: #CCC; padding: 2px 2px; }
|
53
|
+
#tuneup label, #tuneup button { margin: 0 6px 0 20px; }
|
54
|
+
|
55
|
+
#tuneup #tuneup-content p.tuneup-full { height: 50px; line-height: 50px; vertical-align: middle; padding: 0; background-color: transparent; }
|
56
|
+
#tuneup .small { font-size: 10px; color: #666; padding: 0 8px 0 8px;}
|
57
|
+
|
58
|
+
|
59
|
+
#tuneup .tuneup-bar { margin: 0 4px; margin-left: 10px; height: 15px; list-style: none; }
|
60
|
+
#tuneup .tuneup-bar li { float:left; height: 20px; color: #fff; line-height: 20px; vertical-align: middle; font-size: 12px; padding: 0 4px;
|
61
|
+
background-image: url(/slices/fiveruns_tuneup_merb/images/fade.png);
|
62
|
+
background-position: bottom left;
|
63
|
+
background-repeat: repeat-x;
|
64
|
+
}
|
65
|
+
#tuneup .tuneup-layer-model { background-color: #FF9800; }
|
66
|
+
#tuneup .tuneup-layer-view { background-color: #38D023; }
|
67
|
+
#tuneup .tuneup-layer-controller { background-color: #3388D5; }
|
68
|
+
#tuneup .tuneup-bar li.tuneup-layer-other { background: #222 url(/slices/fiveruns_tuneup_merb/images/fade_down.png) top left repeat-x;}
|
69
|
+
|
70
|
+
#tuneup #tuneup-data { position: relative;}
|
71
|
+
#tuneup #tuneup-top { position: absolute; top: 0px; right: 10px; padding: 0; margin: 0 0 0 150px; z-index: 11000; }
|
72
|
+
#tuneup #tuneup-top #tuneup-save-link { float: right; line-height: 45px; vertical-align: bottom; text-align: center; font-weight: bold; padding: 0 9px 0 20px; background: url(/slices/fiveruns_tuneup_merb/images/pointer.gif) 0 50% no-repeat; }
|
73
|
+
#tuneup #tuneup-back-to-run-link { float: right; line-height: 15px; vertical-align: bottom; text-align: center; padding: 8px; background-color: #333; -moz-border-radius: 5px; margin: 7px 10px 0px 0px; border: 1px solid black;}
|
74
|
+
#tuneup #tuneup-summary {float: right; padding: 10px; width: 400px; padding-bottom: 18px; margin-top: 3px; text-align: center; color: #ddd; -moz-border-radius: 6px 6px 0 0; }
|
75
|
+
|
76
|
+
#tuneup #tuneup-data:hover #tuneup-summary { /* h */
|
77
|
+
border-bottom: 0px;
|
78
|
+
background: #000;
|
79
|
+
}
|
80
|
+
#tuneup #tuneup-details { display: none; position: absolute; top: 46px; right: 10px; padding: 9px; text-align: left; z-index: 10999;}
|
81
|
+
#tuneup #tuneup-data:hover #tuneup-details { /* h */
|
82
|
+
display: block;
|
83
|
+
background: #000;
|
84
|
+
min-width: 300px;
|
85
|
+
-moz-border-radius: 6px 0 6px 6px;
|
86
|
+
}
|
87
|
+
|
88
|
+
#tuneup ul#tuneup-details ul.tuneup-step-info { margin: 0; padding: 0; }
|
89
|
+
#tuneup ul#tuneup-details li.tuneup-title { float: left; overflow: hidden; height: 20px; margin: 0 10px 0 0; padding: 0; color: #ddd; font-size: 12px; text-transform: none; font-weight: inherit;}
|
90
|
+
#tuneup ul#tuneup-details li.tuneup-title p { background-color: transparent; }
|
91
|
+
#tuneup ul#tuneup-details li.tuneup-title strong { color: #fff; font-weight: bold; }
|
92
|
+
#tuneup ul#tuneup-details li.tuneup-title span.time { float: right; text-transform: none; font-size: 11px; font-weight: normal; margin-right: 0px; }
|
93
|
+
|
94
|
+
#tuneup ul#tuneup-details li.tuneup-title a, ul#tuneup-details li.tuneup-title a:active, ul#tuneup-details li.tuneup-title a:visited {
|
95
|
+
color: inherit;
|
96
|
+
font-size: inherit;
|
97
|
+
font-weight: inherit;
|
98
|
+
text-decoration: none;
|
99
|
+
text-align: left;
|
100
|
+
position: inherit;
|
101
|
+
}
|
102
|
+
|
103
|
+
#tuneup .tuneup-bar li { text-align: center; }
|
104
|
+
|
105
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step { clear: left; padding: 0 0 0 4px; background: url(/slices/fiveruns_tuneup_merb/images/pip.gif) 4px 0 no-repeat; margin: 2px 0; }
|
106
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step.with_children { background: url(/slices/fiveruns_tuneup_merb/images/arrows.gif) 4px 0 no-repeat;}
|
107
|
+
#tuneup #tuneup-details ul.fiveruns_tuneup_children { display: none; }
|
108
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step.with_children.tuneup-opened { background: url(/slices/fiveruns_tuneup_merb/images/arrows.gif) 4px -20px no-repeat; }
|
109
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step.with_children.tuneup-opened > ul.fiveruns_tuneup_children { display: block; }
|
110
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step .tuneup-step-extras { display: none; padding: 16px 0; background: url(/slices/fiveruns_tuneup_merb/images/dialog.png) 5% 0 no-repeat; }
|
111
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step .tuneup-step-extras a { font-size: 11px; color: #333; }
|
112
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step .tuneup-step-extras a b { color: #000; font-weight: bold; }
|
113
|
+
|
114
|
+
#tuneup ul#tuneup-details span.time { margin-right: 12px; }
|
115
|
+
|
116
|
+
#tuneup li .children { display: none; }
|
117
|
+
|
118
|
+
#tuneup ul#tuneup-details li.tuneup-detail-bar {
|
119
|
+
float: left;
|
120
|
+
margin: 0 0 0 0;
|
121
|
+
height: 20px;
|
122
|
+
width: 300px;
|
123
|
+
padding: 0;
|
124
|
+
}
|
125
|
+
#tuneup dl, #tuneup dt, #tuneup dd {
|
126
|
+
color: #000;
|
127
|
+
position: relative;
|
128
|
+
font-size: 13px;
|
129
|
+
background: none;
|
130
|
+
width: 600px;
|
131
|
+
}
|
132
|
+
#tuneup p { background: none; font-family: sans-serif; margin: 9px 0; }
|
133
|
+
#tuneup dt { font-weight: bold; }
|
134
|
+
#tuneup dd { color: #000; font-family:monospace; *font-size:108%; line-height:100%; }
|
135
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step .tuneup-step-extras .tuneup-app-line { text-decoration: underline; background: #ffa; }
|
136
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step .tuneup-step-extras a.tuneup-close-link { float: right; font-family: sans-serif; color: red; }
|
137
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step .tuneup-step-extras a.tuneup-more-link { font-family: sans-serif; color: red; }
|
138
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step .tuneup-step-extras dd b { font-family: sans-serif; }
|
139
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step .tuneup-step-extras-link { margin-left: 9px; display: none; }
|
140
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step li.tuneup-title:hover .tuneup-step-extras-link { display: inline; }
|
141
|
+
#tuneup #tuneup-details li.fiveruns_tuneup_step .tuneup-step-extras ul {
|
142
|
+
padding-left: 9px;
|
143
|
+
font-size: 12px;
|
144
|
+
}
|
145
|
+
|
146
|
+
#tuneup .tuneup-step-extras > div { background: #ffc url(/slices/fiveruns_tuneup_merb/images/fade.png) bottom left repeat-x; padding: 6px; padding-bottom: 16px; -moz-border-radius: 6px; -webkit-border-radius: 6px; margin-left: 18px; }
|
147
|
+
#tuneup dd { margin-left: 18px; }
|
148
|
+
|
149
|
+
#tuneup ul#tuneup-details li.tuneup-title { padding-left: 16px; width: 400px; }
|
150
|
+
|
151
|
+
#tuneup ul#tuneup-details ul.fiveruns_tuneup_children { background: #111; }
|
152
|
+
#tuneup ul#tuneup-details ul li.tuneup-title { width: 396px; }
|
153
|
+
|
154
|
+
#tuneup ul#tuneup-details ul ul.fiveruns_tuneup_children { background: #222;}
|
155
|
+
#tuneup ul#tuneup-details ul ul li.tuneup-title { width: 392px; }
|
156
|
+
|
157
|
+
#tuneup ul#tuneup-details ul ul ul.fiveruns_tuneup_children { background: #333;}
|
158
|
+
#tuneup ul#tuneup-details ul ul ul li.tuneup-title { width: 388px; }
|
159
|
+
|
160
|
+
#tuneup ul#tuneup-details ul ul ul ul.fiveruns_tuneup_children { background: #444;}
|
161
|
+
#tuneup ul#tuneup-details ul ul ul ul li.tuneup-title { width: 384px; }
|
162
|
+
|
163
|
+
#tuneup ul#tuneup-details ul ul ul ul ul.fiveruns_tuneup_children { background: #555;}
|
164
|
+
#tuneup ul#tuneup-details ul ul ul ul ul li.tuneup-title { width: 380px; }
|
165
|
+
|
166
|
+
#tuneup ul#tuneup-details ul ul ul ul ul ul.fiveruns_tuneup_children { background: #666;}
|
167
|
+
|
168
|
+
#tuneup ul#tuneup-details ul ul ul ul ul ul li.tuneup-title { width: 376px; }
|
169
|
+
#tuneup ul#tuneup-details ul ul ul ul ul ul ul li.tuneup-title { width: 372px; }
|
170
|
+
#tuneup ul#tuneup-details ul ul ul ul ul ul ul ul li.tuneup-title { width: 368px; }
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
#tuneup-flash { display: none; text-align: left; font-size: 12px; padding: 5px; color: #000; border-bottom: 1px #000 solid; }
|
175
|
+
#tuneup-flash emph { color: #666; font-style: italic; }
|
176
|
+
#tuneup-flash p { font-family: sans-serif; margin: 0; }
|
177
|
+
#tuneup-flash p { padding: 0; padding-left: 20px; font-family: sans-serif; background: none; color: #000; border: 0; }
|
178
|
+
#tuneup-flash.tuneup-show { display: block; }
|
179
|
+
#tuneup-flash.tuneup-error { background: #FDFCDB; }
|
180
|
+
#tuneup-flash.tuneup-error p { background: url(/slices/fiveruns_tuneup_merb/images/warning.gif) 0 50% no-repeat; }
|
181
|
+
#tuneup-flash.tuneup-notice { padding-left: 0; background: #E4FFDE; }
|
182
|
+
|
183
|
+
#tuneup #tuneup-details .tuneup-bar { width: 300px; height: 20px; padding: 0; margin: 0 !important; }
|
184
|
+
#tuneup #tuneup-details .tuneup-bar li { height: 20px; padding: 0; margin: 0 !important; }
|
185
|
+
|
186
|
+
#tuneup #tuneup-details a.tuneup-sql { color: 001999; margin-left: 10px; }
|
187
|
+
#tuneup #tuneup-details a img { border: 0; }
|
188
|
+
|
189
|
+
#tuneup .tuneup-halo { display: none; margin-left: 4px; }
|
190
|
+
#tuneup .tuneup-step-info:hover .tuneup-halo { display: inline; }
|
191
|
+
|
192
|
+
#tuneup textarea { background: none; overflow: auto; color: #fff; font-size: 12px; font-family: sans-serif; padding: 4px; border: 0; font-family: monospace; }
|
193
|
+
#tuneup table { border: 0; margin-top: 4px; background: none; } /* sql */
|
194
|
+
#tuneup th { background: #ffa; padding: 2px; color: #000; font-size: 12px; text-align: left; border: 0; font-weight: bold; border: 0; text-align: right; }
|
195
|
+
#tuneup td { background: none; padding: 2px; color: #222; font-size: 12px; text-align: left; border: 0; }
|
196
|
+
|
197
|
+
#tuneup #tuneup-schema { display: none; position: absolute; top: 46px; right: 754px; padding: 9px; text-align: left; z-index: 10998; background: #000; opacity: 0.85; color: #ddd; overflow: hidden; -moz-border-radius: 6px; }
|
198
|
+
|
199
|
+
#tuneup h1 {
|
200
|
+
background: transparent url(/slices/fiveruns_tuneup_merb/images/logo_clear.png) center left no-repeat;
|
201
|
+
border: 0;
|
202
|
+
color: white;
|
203
|
+
display: block;
|
204
|
+
float: left;
|
205
|
+
font-family: 'Helvetica Neue';
|
206
|
+
font-size: 18px;
|
207
|
+
font-weight: bold;
|
208
|
+
height: 50px;
|
209
|
+
letter-spacing: 1px;
|
210
|
+
line-height: 50px;
|
211
|
+
margin: 0 18px 0 18px;
|
212
|
+
padding: 0 0 0 38px;
|
213
|
+
text-shadow: rgb(0, 0, 0) -1px -1px 0px;
|
214
|
+
vertical-align: middle;
|
215
|
+
}
|
216
|
+
|
217
|
+
#tuneup #tuneup-schema h3 { color: #fff; font-weight: bold; font-size: 14px; margin-bottom: 5px; }
|
218
|
+
#tuneup #tuneup-data:hover #tuneup-schema { display: block; }
|
219
|
+
#tuneup #tuneup-schema table, #tuneup #tuneup-schema tr { background: transparent; }
|
220
|
+
#tuneup #tuneup-schema th { background: #111; color: #fff; border: 0 }
|
221
|
+
#tuneup #tuneup-schema td { background: #000; font-family: monospace; color: #ddd; padding: 1px; font-size: 11px; }
|
222
|
+
#tuneup #tuneup-trend { float: right; width: 100px; }
|
223
|
+
|
224
|
+
#tuneup button { background: none; border: 0; margin: 0; padding: 0; height: 50px; line-height: 50px; vertical-align: middle; }
|
225
|
+
|
226
|
+
a.tuneup-step-link { padding-left: 20px; margin-left: -20px; outline: none;}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
describe "FiverunsTuneupMerb::Main (controller)" do
|
4
|
+
|
5
|
+
# Feel free to remove the specs below
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
Merb::Router.prepare { |r| r.add_slice(:FiverunsTuneupMerb) } if standalone?
|
9
|
+
end
|
10
|
+
|
11
|
+
after :all do
|
12
|
+
Merb::Router.reset! if standalone?
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should have access to the slice module" do
|
16
|
+
controller = dispatch_to(FiverunsTuneupMerb::Main, :index)
|
17
|
+
controller.slice.should == FiverunsTuneupMerb
|
18
|
+
controller.slice.should == FiverunsTuneupMerb::Main.slice
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should have an index action" do
|
22
|
+
controller = dispatch_to(FiverunsTuneupMerb::Main, :index)
|
23
|
+
controller.status.should == 200
|
24
|
+
controller.body.should contain('FiverunsTuneupMerb')
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should work with the default route" do
|
28
|
+
controller = get("/fiveruns_tuneup_merb/main/index")
|
29
|
+
controller.should be_kind_of(FiverunsTuneupMerb::Main)
|
30
|
+
controller.action_name.should == 'index'
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should work with the example named route" do
|
34
|
+
controller = get("/fiveruns_tuneup_merb/index.html")
|
35
|
+
controller.should be_kind_of(FiverunsTuneupMerb::Main)
|
36
|
+
controller.action_name.should == 'index'
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should have routes in FiverunsTuneupMerb.routes" do
|
40
|
+
FiverunsTuneupMerb.routes.should_not be_empty
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should have a slice_url helper method for slice-specific routes" do
|
44
|
+
controller = dispatch_to(FiverunsTuneupMerb::Main, 'index')
|
45
|
+
controller.slice_url(:action => 'show', :format => 'html').should == "/fiveruns_tuneup_merb/main/show.html"
|
46
|
+
controller.slice_url(:fiveruns_tuneup_merb_index, :format => 'html').should == "/fiveruns_tuneup_merb/index.html"
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should have helper methods for dealing with public paths" do
|
50
|
+
controller = dispatch_to(FiverunsTuneupMerb::Main, :index)
|
51
|
+
controller.public_path_for(:image).should == "/slices/fiveruns_tuneup_merb/images"
|
52
|
+
controller.public_path_for(:javascript).should == "/slices/fiveruns_tuneup_merb/javascripts"
|
53
|
+
controller.public_path_for(:stylesheet).should == "/slices/fiveruns_tuneup_merb/stylesheets"
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should have a slice-specific _template_root" do
|
57
|
+
FiverunsTuneupMerb::Main._template_root.should == FiverunsTuneupMerb.dir_for(:view)
|
58
|
+
FiverunsTuneupMerb::Main._template_root.should == FiverunsTuneupMerb::Application._template_root
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
describe "FiverunsTuneupMerb (module)" do
|
4
|
+
|
5
|
+
it "should have proper specs"
|
6
|
+
|
7
|
+
# Feel free to remove the specs below
|
8
|
+
|
9
|
+
before :all do
|
10
|
+
Merb::Router.prepare { |r| r.add_slice(:FiverunsTuneupMerb) } if standalone?
|
11
|
+
end
|
12
|
+
|
13
|
+
after :all do
|
14
|
+
Merb::Router.reset! if standalone?
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should be registered in Merb::Slices.slices" do
|
18
|
+
Merb::Slices.slices.should include(FiverunsTuneupMerb)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should be registered in Merb::Slices.paths" do
|
22
|
+
Merb::Slices.paths[FiverunsTuneupMerb.name].should == current_slice_root
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should have an :identifier property" do
|
26
|
+
FiverunsTuneupMerb.identifier.should == "fiveruns_tuneup_merb"
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should have an :identifier_sym property" do
|
30
|
+
FiverunsTuneupMerb.identifier_sym.should == :fiveruns_tuneup_merb
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should have a :root property" do
|
34
|
+
FiverunsTuneupMerb.root.should == Merb::Slices.paths[FiverunsTuneupMerb.name]
|
35
|
+
FiverunsTuneupMerb.root_path('app').should == current_slice_root / 'app'
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should have a :file property" do
|
39
|
+
FiverunsTuneupMerb.file.should == current_slice_root / 'lib' / 'fiveruns_tuneup_merb.rb'
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should have metadata properties" do
|
43
|
+
FiverunsTuneupMerb.description.should == "FiverunsTuneupMerb is a chunky Merb slice!"
|
44
|
+
FiverunsTuneupMerb.version.should == "0.0.1"
|
45
|
+
FiverunsTuneupMerb.author.should == "YOUR NAME"
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should have :routes and :named_routes properties" do
|
49
|
+
FiverunsTuneupMerb.routes.should_not be_empty
|
50
|
+
FiverunsTuneupMerb.named_routes[:fiveruns_tuneup_merb_index].should be_kind_of(Merb::Router::Route)
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should have an url helper method for slice-specific routes" do
|
54
|
+
FiverunsTuneupMerb.url(:controller => 'main', :action => 'show', :format => 'html').should == "/fiveruns_tuneup_merb/main/show.html"
|
55
|
+
FiverunsTuneupMerb.url(:fiveruns_tuneup_merb_index, :format => 'html').should == "/fiveruns_tuneup_merb/index.html"
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should have a config property (Hash)" do
|
59
|
+
FiverunsTuneupMerb.config.should be_kind_of(Hash)
|
60
|
+
end
|
61
|
+
|
62
|
+
it "should have bracket accessors as shortcuts to the config" do
|
63
|
+
FiverunsTuneupMerb[:foo] = 'bar'
|
64
|
+
FiverunsTuneupMerb[:foo].should == 'bar'
|
65
|
+
FiverunsTuneupMerb[:foo].should == FiverunsTuneupMerb.config[:foo]
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should have a :layout config option set" do
|
69
|
+
FiverunsTuneupMerb.config[:layout].should == :fiveruns_tuneup_merb
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should have a dir_for method" do
|
73
|
+
app_path = FiverunsTuneupMerb.dir_for(:application)
|
74
|
+
app_path.should == current_slice_root / 'app'
|
75
|
+
[:view, :model, :controller, :helper, :mailer, :part].each do |type|
|
76
|
+
FiverunsTuneupMerb.dir_for(type).should == app_path / "#{type}s"
|
77
|
+
end
|
78
|
+
public_path = FiverunsTuneupMerb.dir_for(:public)
|
79
|
+
public_path.should == current_slice_root / 'public'
|
80
|
+
[:stylesheet, :javascript, :image].each do |type|
|
81
|
+
FiverunsTuneupMerb.dir_for(type).should == public_path / "#{type}s"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should have a app_dir_for method" do
|
86
|
+
root_path = FiverunsTuneupMerb.app_dir_for(:root)
|
87
|
+
root_path.should == Merb.root / 'slices' / 'fiveruns_tuneup_merb'
|
88
|
+
app_path = FiverunsTuneupMerb.app_dir_for(:application)
|
89
|
+
app_path.should == root_path / 'app'
|
90
|
+
[:view, :model, :controller, :helper, :mailer, :part].each do |type|
|
91
|
+
FiverunsTuneupMerb.app_dir_for(type).should == app_path / "#{type}s"
|
92
|
+
end
|
93
|
+
public_path = FiverunsTuneupMerb.app_dir_for(:public)
|
94
|
+
public_path.should == Merb.dir_for(:public) / 'slices' / 'fiveruns_tuneup_merb'
|
95
|
+
[:stylesheet, :javascript, :image].each do |type|
|
96
|
+
FiverunsTuneupMerb.app_dir_for(type).should == public_path / "#{type}s"
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should have a public_dir_for method" do
|
101
|
+
public_path = FiverunsTuneupMerb.public_dir_for(:public)
|
102
|
+
public_path.should == '/slices' / 'fiveruns_tuneup_merb'
|
103
|
+
[:stylesheet, :javascript, :image].each do |type|
|
104
|
+
FiverunsTuneupMerb.public_dir_for(type).should == public_path / "#{type}s"
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
it "should have a public_path_for method" do
|
109
|
+
public_path = FiverunsTuneupMerb.public_dir_for(:public)
|
110
|
+
FiverunsTuneupMerb.public_path_for("path", "to", "file").should == public_path / "path" / "to" / "file"
|
111
|
+
[:stylesheet, :javascript, :image].each do |type|
|
112
|
+
FiverunsTuneupMerb.public_path_for(type, "path", "to", "file").should == public_path / "#{type}s" / "path" / "to" / "file"
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
it "should have a app_path_for method" do
|
117
|
+
FiverunsTuneupMerb.app_path_for("path", "to", "file").should == FiverunsTuneupMerb.app_dir_for(:root) / "path" / "to" / "file"
|
118
|
+
FiverunsTuneupMerb.app_path_for(:controller, "path", "to", "file").should == FiverunsTuneupMerb.app_dir_for(:controller) / "path" / "to" / "file"
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should have a slice_path_for method" do
|
122
|
+
FiverunsTuneupMerb.slice_path_for("path", "to", "file").should == FiverunsTuneupMerb.dir_for(:root) / "path" / "to" / "file"
|
123
|
+
FiverunsTuneupMerb.slice_path_for(:controller, "path", "to", "file").should == FiverunsTuneupMerb.dir_for(:controller) / "path" / "to" / "file"
|
124
|
+
end
|
125
|
+
|
126
|
+
it "should keep a list of path component types to use when copying files" do
|
127
|
+
(FiverunsTuneupMerb.mirrored_components & FiverunsTuneupMerb.slice_paths.keys).length.should == FiverunsTuneupMerb.mirrored_components.length
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'merb-core'
|
3
|
+
require 'merb-slices'
|
4
|
+
require 'spec'
|
5
|
+
|
6
|
+
# Add fiveruns_tuneup_merb.rb to the search path
|
7
|
+
Merb::Plugins.config[:merb_slices][:auto_register] = true
|
8
|
+
Merb::Plugins.config[:merb_slices][:search_path] = File.join(File.dirname(__FILE__), '..', 'lib', 'fiveruns_tuneup_merb.rb')
|
9
|
+
|
10
|
+
# Using Merb.root below makes sure that the correct root is set for
|
11
|
+
# - testing standalone, without being installed as a gem and no host application
|
12
|
+
# - testing from within the host application; its root will be used
|
13
|
+
Merb.start_environment(
|
14
|
+
:testing => true,
|
15
|
+
:adapter => 'runner',
|
16
|
+
:environment => ENV['MERB_ENV'] || 'test',
|
17
|
+
:merb_root => Merb.root,
|
18
|
+
:session_store => 'memory'
|
19
|
+
)
|
20
|
+
|
21
|
+
module Merb
|
22
|
+
module Test
|
23
|
+
module SliceHelper
|
24
|
+
|
25
|
+
# The absolute path to the current slice
|
26
|
+
def current_slice_root
|
27
|
+
@current_slice_root ||= File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
28
|
+
end
|
29
|
+
|
30
|
+
# Whether the specs are being run from a host application or standalone
|
31
|
+
def standalone?
|
32
|
+
Merb.root == ::FiverunsTuneupMerb.root
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
Spec::Runner.configure do |config|
|
40
|
+
config.include(Merb::Test::ViewHelper)
|
41
|
+
config.include(Merb::Test::RouteHelper)
|
42
|
+
config.include(Merb::Test::ControllerHelper)
|
43
|
+
config.include(Merb::Test::SliceHelper)
|
44
|
+
end
|
metadata
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fiveruns_tuneup_merb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- FiveRuns Development Team
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-10-11 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: fiveruns_tuneup_core
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: merb-slices
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.9.5
|
34
|
+
version:
|
35
|
+
description: Merb Slice that provides the FiveRuns TuneUp Panel (http://tuneup.fiveruns.com)
|
36
|
+
email: dev@fiveruns.com
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
42
|
+
- README
|
43
|
+
- LICENSE
|
44
|
+
- TODO
|
45
|
+
files:
|
46
|
+
- LICENSE
|
47
|
+
- README
|
48
|
+
- Rakefile
|
49
|
+
- TODO
|
50
|
+
- lib/fiveruns_tuneup_merb
|
51
|
+
- lib/fiveruns_tuneup_merb/api_key.rb
|
52
|
+
- lib/fiveruns_tuneup_merb/instrumentation.rb
|
53
|
+
- lib/fiveruns_tuneup_merb/merbtasks.rb
|
54
|
+
- lib/fiveruns_tuneup_merb/slicetasks.rb
|
55
|
+
- lib/fiveruns_tuneup_merb/spectasks.rb
|
56
|
+
- lib/fiveruns_tuneup_merb.rb
|
57
|
+
- spec/controllers
|
58
|
+
- spec/controllers/main_spec.rb
|
59
|
+
- spec/fiveruns_tuneup_merb_spec.rb
|
60
|
+
- spec/spec_helper.rb
|
61
|
+
- app/controllers
|
62
|
+
- app/controllers/application.rb
|
63
|
+
- app/controllers/runs.rb
|
64
|
+
- app/helpers
|
65
|
+
- app/helpers/application_helper.rb
|
66
|
+
- app/views
|
67
|
+
- app/views/layout
|
68
|
+
- app/views/layout/fiveruns_tuneup_merb.html.erb
|
69
|
+
- public/images
|
70
|
+
- public/images/arrows.gif
|
71
|
+
- public/images/dialog.png
|
72
|
+
- public/images/edit.png
|
73
|
+
- public/images/fade.png
|
74
|
+
- public/images/fade_down.png
|
75
|
+
- public/images/head.gif
|
76
|
+
- public/images/logo.gif
|
77
|
+
- public/images/logo_clear.png
|
78
|
+
- public/images/magnify.png
|
79
|
+
- public/images/pip.gif
|
80
|
+
- public/images/pointer.gif
|
81
|
+
- public/images/schema.png
|
82
|
+
- public/images/signin.gif
|
83
|
+
- public/images/spinner.gif
|
84
|
+
- public/images/warning.gif
|
85
|
+
- public/javascripts
|
86
|
+
- public/javascripts/init.js
|
87
|
+
- public/javascripts/jquery.js
|
88
|
+
- public/javascripts/sandbox.html
|
89
|
+
- public/javascripts/tuneup.js
|
90
|
+
- public/stylesheets
|
91
|
+
- public/stylesheets/tuneup.css
|
92
|
+
- stubs/app
|
93
|
+
- stubs/app/controllers
|
94
|
+
- stubs/app/controllers/application.rb
|
95
|
+
- stubs/app/controllers/main.rb
|
96
|
+
has_rdoc: true
|
97
|
+
homepage: http://tuneup.fiveruns.com/
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
|
101
|
+
require_paths:
|
102
|
+
- lib
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: "0"
|
108
|
+
version:
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: "0"
|
114
|
+
version:
|
115
|
+
requirements: []
|
116
|
+
|
117
|
+
rubyforge_project: fiveruns_tuneup_merb
|
118
|
+
rubygems_version: 1.3.0
|
119
|
+
signing_key:
|
120
|
+
specification_version: 2
|
121
|
+
summary: Merb Slice that provides the FiveRuns TuneUp Panel (http://tuneup.fiveruns.com)
|
122
|
+
test_files: []
|
123
|
+
|