attrtastic 0.2.2 → 0.3.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/.gitignore +4 -20
- data/Gemfile +4 -0
- data/Gemfile.lock +50 -0
- data/LICENSE +1 -1
- data/README.md +16 -13
- data/Rakefile +6 -36
- data/attrtastic.gemspec +20 -76
- data/doc/Attrtastic/SemanticAttributesBuilder.html +340 -347
- data/doc/Attrtastic/SemanticAttributesHelper.html +100 -66
- data/doc/Attrtastic.html +29 -12
- data/doc/_index.html +9 -9
- data/doc/class_list.html +3 -3
- data/doc/css/full_list.css +6 -3
- data/doc/css/style.css +51 -9
- data/doc/file.README.html +21 -18
- data/doc/file_list.html +1 -1
- data/doc/frames.html +1 -1
- data/doc/index.html +21 -18
- data/doc/js/app.js +107 -4
- data/doc/js/full_list.js +78 -35
- data/doc/js/jquery.js +150 -15
- data/doc/method_list.html +7 -7
- data/doc/top-level-namespace.html +9 -6
- data/init.rb +2 -0
- data/lib/attrtastic/semantic_attributes_builder.rb +333 -0
- data/lib/attrtastic/semantic_attributes_helper.rb +55 -0
- data/lib/attrtastic/version.rb +3 -0
- data/lib/attrtastic.rb +2 -389
- data/rails/init.rb +1 -2
- data/test/helper.rb +2 -2
- data/test/test_attribute.rb +3 -5
- data/test/test_attributes.rb +26 -54
- data/test/test_attrtastic.rb +9 -8
- data/test/test_semantic_attributes_helper.rb +5 -8
- metadata +97 -32
- data/VERSION +0 -1
data/doc/css/style.css
CHANGED
@@ -15,26 +15,35 @@ h2 {
|
|
15
15
|
font-size: 1.4em;
|
16
16
|
margin: 1.8em 0 0.5em;
|
17
17
|
}
|
18
|
+
h2 small { font-weight: normal; font-size: 0.7em; display: block; float: right; }
|
18
19
|
.clear { clear: both; }
|
20
|
+
.inline { display: inline; }
|
21
|
+
.inline p:first-child { display: inline; }
|
19
22
|
.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; }
|
20
23
|
.docstring h1 { font-size: 1.2em; }
|
21
24
|
.docstring h2 { font-size: 1.1em; }
|
22
25
|
.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; }
|
26
|
+
.docstring .object_link { font-family: monospace; }
|
23
27
|
|
24
28
|
.note {
|
25
29
|
color: #222;
|
26
30
|
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
27
31
|
background: #e3e4e3; border: 1px solid #d5d5d5; padding: 7px 10px;
|
32
|
+
display: block;
|
28
33
|
}
|
29
34
|
.note.todo { background: #ffffc5; border-color: #ececaa; }
|
30
35
|
.note.returns_void { background: #efefef; }
|
31
36
|
.note.deprecated { background: #ffe5e5; border-color: #e9dada; }
|
32
|
-
.note.
|
37
|
+
.note.private { background: #ffffc5; border-color: #ececaa; }
|
38
|
+
.note.title { text-transform: lowercase; padding: 1px 5px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; display: inline; }
|
39
|
+
.summary_signature + .note.title { margin-left: 7px; }
|
33
40
|
h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; }
|
34
41
|
.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
35
42
|
.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; }
|
36
43
|
.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
37
44
|
.note.title.private { background: #d5d5d5; border-color: #c5c5c5; }
|
45
|
+
.discussion .note { margin-top: 6px; }
|
46
|
+
.discussion .note:first-child { margin-top: 0; }
|
38
47
|
|
39
48
|
h3.inherited {
|
40
49
|
font-style: italic;
|
@@ -95,7 +104,11 @@ dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-b
|
|
95
104
|
|
96
105
|
.summary_desc { margin-left: 32px; display: block; font-family: sans-serif; }
|
97
106
|
.summary_desc tt { font-size: 0.9em; }
|
98
|
-
dl.constants .
|
107
|
+
dl.constants .note { padding: 2px 6px; padding-right: 12px; margin-top: 6px; }
|
108
|
+
dl.constants .docstring { margin-left: 32px; font-size: 0.9em; font-weight: normal; }
|
109
|
+
dl.constants .tags { padding-left: 32px; font-size: 0.9em; line-height: 0.8em; }
|
110
|
+
dl.constants .discussion *:first-child { margin-top: 0; }
|
111
|
+
dl.constants .discussion *:last-child { margin-bottom: 0; }
|
99
112
|
|
100
113
|
.method_details { border-top: 1px dotted #aaa; margin-top: 15px; padding-top: 0; }
|
101
114
|
.method_details.first { border: 0; }
|
@@ -114,7 +127,7 @@ p.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace;
|
|
114
127
|
.tags ul { margin-top: 5px; padding-left: 30px; list-style: square; }
|
115
128
|
.tags ul li { margin-bottom: 3px; }
|
116
129
|
.tags ul .name { font-family: monospace; font-weight: bold; }
|
117
|
-
.tags ul
|
130
|
+
.tags ul .note { padding: 3px 6px; }
|
118
131
|
.tags { margin-bottom: 12px; }
|
119
132
|
|
120
133
|
.tags .examples h3 { margin-bottom: 10px; }
|
@@ -155,6 +168,8 @@ ul.summary li { margin-bottom: 5px; }
|
|
155
168
|
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
156
169
|
}
|
157
170
|
.summary_signature:hover { background: #eeeeff; cursor: pointer; }
|
171
|
+
ul.summary.compact li { display: inline; margin-right: 5px; line-height: 2.6em;}
|
172
|
+
ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; }
|
158
173
|
#content .summary_signature:hover a:link,
|
159
174
|
#content .summary_signature:hover a:visited {
|
160
175
|
background: transparent;
|
@@ -171,18 +186,23 @@ p.children strong.modules { padding-left: 5px; }
|
|
171
186
|
|
172
187
|
ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; }
|
173
188
|
ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; }
|
174
|
-
ul.fullTree li { text-align: center; }
|
175
|
-
ul.fullTree li
|
189
|
+
ul.fullTree li { text-align: center; padding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2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/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; }
|
190
|
+
ul.fullTree li:first-child { padding-top: 0; background: transparent; }
|
191
|
+
ul.fullTree li:last-child { padding-bottom: 0; }
|
192
|
+
.showAll ul.fullTree { display: block; }
|
193
|
+
.showAll .inheritName { display: none; }
|
176
194
|
|
177
195
|
#search { position: absolute; right: 14px; top: 0px; }
|
178
196
|
#search a:link, #search a:visited {
|
179
197
|
display: block; float: left; margin-right: 4px;
|
180
|
-
padding: 8px 10px; text-decoration: none; color: #05a;
|
198
|
+
padding: 8px 10px; text-decoration: none; color: #05a;
|
181
199
|
border: 1px solid #d8d8e5;
|
182
200
|
-moz-border-radius-bottomleft: 3px; -moz-border-radius-bottomright: 3px;
|
183
201
|
-webkit-border-bottom-left-radius: 3px; -webkit-border-bottom-right-radius: 3px;
|
202
|
+
background: #eaf0ff;
|
203
|
+
-webkit-box-shadow: -1px 1px 3px #ddd;
|
184
204
|
}
|
185
|
-
#search a:hover { background: #
|
205
|
+
#search a:hover { background: #f5faff; color: #06b; }
|
186
206
|
#search a.active {
|
187
207
|
background: #568; padding-bottom: 20px; color: #fff; border: 1px solid #457;
|
188
208
|
-moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px;
|
@@ -194,6 +214,7 @@ ul.fullTree li.next:before { font-size: 1.2em; content: '\2B06'; color: #bbb; di
|
|
194
214
|
|
195
215
|
#menu { font-size: 1.3em; color: #bbb; top: -5px; position: relative; }
|
196
216
|
#menu .title, #menu a { font-size: 0.7em; }
|
217
|
+
#menu .title a { font-size: 1em; }
|
197
218
|
#menu .title { color: #555; }
|
198
219
|
#menu a:link, #menu a:visited { color: #333; text-decoration: none; border-bottom: 1px dotted #bbd; }
|
199
220
|
#menu a:hover { color: #05a; }
|
@@ -214,6 +235,7 @@ li.r1 { background: #f0f0f0; }
|
|
214
235
|
li.r2 { background: #fafafa; }
|
215
236
|
|
216
237
|
#search_frame {
|
238
|
+
z-index: 9999;
|
217
239
|
background: #fff;
|
218
240
|
display: none;
|
219
241
|
position: absolute;
|
@@ -224,8 +246,8 @@ li.r2 { background: #fafafa; }
|
|
224
246
|
overflow-y: scroll;
|
225
247
|
border: 1px solid #999;
|
226
248
|
border-collapse: collapse;
|
227
|
-
-webkit-box-shadow: -
|
228
|
-
-moz-box-shadow: -
|
249
|
+
-webkit-box-shadow: -7px 5px 25px #aaa;
|
250
|
+
-moz-box-shadow: -7px 5px 25px #aaa;
|
229
251
|
-moz-border-radius: 2px;
|
230
252
|
-webkit-border-radius: 2px;
|
231
253
|
}
|
@@ -233,6 +255,26 @@ li.r2 { background: #fafafa; }
|
|
233
255
|
#content ul.summary li.deprecated a:link,
|
234
256
|
#content ul.summary li.deprecated a:visited { text-decoration: line-through; font-style: italic; }
|
235
257
|
|
258
|
+
#toc {
|
259
|
+
padding: 20px; padding-right: 30px; border: 1px solid #ddd; float: right; background: #fff; margin-left: 20px; margin-bottom: 20px;
|
260
|
+
max-width: 300px;
|
261
|
+
-webkit-box-shadow: -2px 2px 6px #bbb;
|
262
|
+
-moz-box-shadow: -2px 2px 6px #bbb;
|
263
|
+
z-index: 5000;
|
264
|
+
position: relative;
|
265
|
+
}
|
266
|
+
#toc.nofloat { float: none; max-width: none; border: none; padding: 0; margin: 20px 0; -webkit-box-shadow: none; -moz-box-shadow: none; }
|
267
|
+
#toc.nofloat.hidden { padding: 0; background: 0; margin-bottom: 5px; }
|
268
|
+
#toc .title { margin: 0; }
|
269
|
+
#toc ol { padding-left: 1.8em; }
|
270
|
+
#toc li { font-size: 1.1em; line-height: 1.7em; }
|
271
|
+
#toc > ol > li { font-size: 1.1em; font-weight: bold; }
|
272
|
+
#toc ol > ol { font-size: 0.9em; }
|
273
|
+
#toc ol ol > ol { padding-left: 2.3em; }
|
274
|
+
#toc ol + li { margin-top: 0.3em; }
|
275
|
+
#toc.hidden { padding: 10px; background: #f6f6f6; -webkit-box-shadow: none; -moz-box-shadow: none; }
|
276
|
+
#filecontents h1 + #toc.nofloat { margin-top: 0; }
|
277
|
+
|
236
278
|
/* syntax highlighting */
|
237
279
|
.source_code { display: none; padding: 3px 8px; border-left: 8px solid #ddd; margin-top: 5px; }
|
238
280
|
#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; }
|
data/doc/file.README.html
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
|
-
<meta name="Content-Type" content="text/html; charset=
|
6
|
-
<title>Documentation by YARD 0.
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>Documentation by YARD 0.6.3</title>
|
7
7
|
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
8
|
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
9
|
|
@@ -43,9 +43,12 @@
|
|
43
43
|
|
44
44
|
<div id="content"><div id='filecontents'><h1>Attrtastic</h1>
|
45
45
|
|
46
|
-
<p>Attrtastic
|
47
|
-
|
48
|
-
|
46
|
+
<p>Attrtastic is simple view helper which can be used to create index/show pages
|
47
|
+
for any objects (for example Active Model objects). It helps you display
|
48
|
+
all present attributes of object.</p>
|
49
|
+
|
50
|
+
<p>If you need compatibility with Rails 2.x, then please install version 0.2.2 of
|
51
|
+
this gem.</p>
|
49
52
|
|
50
53
|
<h2>Using</h2>
|
51
54
|
|
@@ -54,22 +57,22 @@ scafforld show/index pages.</p>
|
|
54
57
|
<pre class="code"><span class='id gem'>gem</span> <span class='id install'>install</span> <span class='id attrtastic'>attrtastic</span>
|
55
58
|
</pre>
|
56
59
|
|
57
|
-
<p>Add to <code>
|
60
|
+
<p>Add to your <code>Gemfile</code>:</p>
|
58
61
|
|
59
|
-
<pre class="code"><span class='id
|
62
|
+
<pre class="code"><span class='id gem'>gem</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>attrtastic</span><span class='tstring_end'>"</span></span>
|
60
63
|
</pre>
|
61
64
|
|
62
65
|
<p>And use in your views, for example in user/show.erb</p>
|
63
66
|
|
64
|
-
<pre class="code"><
|
65
|
-
<
|
67
|
+
<pre class="code"><%= semantic_attributes_for @user do |attr| %>
|
68
|
+
<%= attr.attributes "User" do %>
|
66
69
|
<%= attr.attribute :first_name %>
|
67
70
|
<%= attr.attribute :last_name %>
|
68
|
-
<
|
71
|
+
<%= attr.attribute :avatar do %>
|
69
72
|
<%= image_tag @user.avatar.url %>
|
70
|
-
<%
|
73
|
+
<% end %>
|
71
74
|
<% end %>
|
72
|
-
<
|
75
|
+
<%= attr.attributes "Contact" do %>
|
73
76
|
<%= attr.attribute :email %>
|
74
77
|
<%= attr.attribute :tel %>
|
75
78
|
<%= attr.attribute :fax %>
|
@@ -77,8 +80,8 @@ scafforld show/index pages.</p>
|
|
77
80
|
<% end %>
|
78
81
|
</pre>
|
79
82
|
|
80
|
-
<p>By default attributes which returns
|
81
|
-
<code>:display_blank => true</code> is added to
|
83
|
+
<p>By default attributes which returns <code>#blank?</code> value are ommited, unless
|
84
|
+
<code>:display_blank => true</code> is added to <code>#attribute</code>.</p>
|
82
85
|
|
83
86
|
<h2>Note on Patches/Pull Requests</h2>
|
84
87
|
|
@@ -95,12 +98,12 @@ future version unintentionally.</li>
|
|
95
98
|
|
96
99
|
<h2>Copyright</h2>
|
97
100
|
|
98
|
-
<p>Copyright (c) 2009 Boruta Miroslaw. See LICENSE for details.</p></div></div>
|
101
|
+
<p>Copyright (c) 2009-2010 Boruta Miroslaw. See LICENSE for details.</p></div></div>
|
99
102
|
|
100
103
|
<div id="footer">
|
101
|
-
Generated on Fri
|
102
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
103
|
-
0.
|
104
|
+
Generated on Fri Dec 3 21:43:44 2010 by
|
105
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
106
|
+
0.6.3 (ruby-1.9.2).
|
104
107
|
</div>
|
105
108
|
|
106
109
|
</body>
|
data/doc/file_list.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html>
|
4
4
|
<head>
|
5
|
-
<meta name="Content-Type" content="text/html; charset=
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
7
7
|
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
8
8
|
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
data/doc/frames.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
5
|
<head>
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
7
|
-
<title>Documentation by YARD 0.
|
7
|
+
<title>Documentation by YARD 0.6.3</title>
|
8
8
|
</head>
|
9
9
|
<frameset cols="20%,*">
|
10
10
|
<frame name="list" src="class_list.html" />
|
data/doc/index.html
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
|
-
<meta name="Content-Type" content="text/html; charset=
|
6
|
-
<title>Documentation by YARD 0.
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>Documentation by YARD 0.6.3</title>
|
7
7
|
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
8
|
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
9
|
|
@@ -43,9 +43,12 @@
|
|
43
43
|
|
44
44
|
<div id="content"><div id='filecontents'><h1>Attrtastic</h1>
|
45
45
|
|
46
|
-
<p>Attrtastic
|
47
|
-
|
48
|
-
|
46
|
+
<p>Attrtastic is simple view helper which can be used to create index/show pages
|
47
|
+
for any objects (for example Active Model objects). It helps you display
|
48
|
+
all present attributes of object.</p>
|
49
|
+
|
50
|
+
<p>If you need compatibility with Rails 2.x, then please install version 0.2.2 of
|
51
|
+
this gem.</p>
|
49
52
|
|
50
53
|
<h2>Using</h2>
|
51
54
|
|
@@ -54,22 +57,22 @@ scafforld show/index pages.</p>
|
|
54
57
|
<pre class="code"><span class='id gem'>gem</span> <span class='id install'>install</span> <span class='id attrtastic'>attrtastic</span>
|
55
58
|
</pre>
|
56
59
|
|
57
|
-
<p>Add to <code>
|
60
|
+
<p>Add to your <code>Gemfile</code>:</p>
|
58
61
|
|
59
|
-
<pre class="code"><span class='id
|
62
|
+
<pre class="code"><span class='id gem'>gem</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>attrtastic</span><span class='tstring_end'>"</span></span>
|
60
63
|
</pre>
|
61
64
|
|
62
65
|
<p>And use in your views, for example in user/show.erb</p>
|
63
66
|
|
64
|
-
<pre class="code"><
|
65
|
-
<
|
67
|
+
<pre class="code"><%= semantic_attributes_for @user do |attr| %>
|
68
|
+
<%= attr.attributes "User" do %>
|
66
69
|
<%= attr.attribute :first_name %>
|
67
70
|
<%= attr.attribute :last_name %>
|
68
|
-
<
|
71
|
+
<%= attr.attribute :avatar do %>
|
69
72
|
<%= image_tag @user.avatar.url %>
|
70
|
-
<%
|
73
|
+
<% end %>
|
71
74
|
<% end %>
|
72
|
-
<
|
75
|
+
<%= attr.attributes "Contact" do %>
|
73
76
|
<%= attr.attribute :email %>
|
74
77
|
<%= attr.attribute :tel %>
|
75
78
|
<%= attr.attribute :fax %>
|
@@ -77,8 +80,8 @@ scafforld show/index pages.</p>
|
|
77
80
|
<% end %>
|
78
81
|
</pre>
|
79
82
|
|
80
|
-
<p>By default attributes which returns
|
81
|
-
<code>:display_blank => true</code> is added to
|
83
|
+
<p>By default attributes which returns <code>#blank?</code> value are ommited, unless
|
84
|
+
<code>:display_blank => true</code> is added to <code>#attribute</code>.</p>
|
82
85
|
|
83
86
|
<h2>Note on Patches/Pull Requests</h2>
|
84
87
|
|
@@ -95,12 +98,12 @@ future version unintentionally.</li>
|
|
95
98
|
|
96
99
|
<h2>Copyright</h2>
|
97
100
|
|
98
|
-
<p>Copyright (c) 2009 Boruta Miroslaw. See LICENSE for details.</p></div></div>
|
101
|
+
<p>Copyright (c) 2009-2010 Boruta Miroslaw. See LICENSE for details.</p></div></div>
|
99
102
|
|
100
103
|
<div id="footer">
|
101
|
-
Generated on Fri
|
102
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
103
|
-
0.
|
104
|
+
Generated on Fri Dec 3 21:43:44 2010 by
|
105
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
106
|
+
0.6.3 (ruby-1.9.2).
|
104
107
|
</div>
|
105
108
|
|
106
109
|
</body>
|
data/doc/js/app.js
CHANGED
@@ -31,14 +31,12 @@ function createFullTreeLinks() {
|
|
31
31
|
var tHeight = 0;
|
32
32
|
$('.inheritanceTree').toggle(function() {
|
33
33
|
tHeight = $(this).parent().prev().height();
|
34
|
-
$(this).
|
35
|
-
$(this).prev().show();
|
34
|
+
$(this).parent().toggleClass('showAll');
|
36
35
|
$(this).text("(hide)");
|
37
36
|
$(this).parent().prev().height($(this).parent().height());
|
38
37
|
},
|
39
38
|
function() {
|
40
|
-
$(this).
|
41
|
-
$(this).prev().hide();
|
39
|
+
$(this).parent().toggleClass('showAll');
|
42
40
|
$(this).parent().prev().height(tHeight);
|
43
41
|
$(this).text("show all")
|
44
42
|
});
|
@@ -87,9 +85,110 @@ function framesInit() {
|
|
87
85
|
if (window.top.frames.main) {
|
88
86
|
document.body.className = 'frames';
|
89
87
|
$('#menu .noframes a').attr('href', document.location);
|
88
|
+
$('html head title', window.parent.document).text($('html head title').text());
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
function keyboardShortcuts() {
|
93
|
+
if (window.top.frames.main) return;
|
94
|
+
$(document).keypress(function(evt) {
|
95
|
+
if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) return;
|
96
|
+
if (evt.originalTarget.nodeName == "INPUT" ||
|
97
|
+
evt.originalTarget.nodeName == "TEXTAREA") return;
|
98
|
+
switch (evt.charCode) {
|
99
|
+
case 67: case 99: $('#class_list_link').click(); break; // 'c'
|
100
|
+
case 77: case 109: $('#method_list_link').click(); break; // 'm'
|
101
|
+
case 70: case 102: $('#file_list_link').click(); break; // 'f'
|
102
|
+
}
|
103
|
+
});
|
104
|
+
}
|
105
|
+
|
106
|
+
function summaryToggle() {
|
107
|
+
$('.summary_toggle').click(function() {
|
108
|
+
localStorage.summaryCollapsed = $(this).text();
|
109
|
+
$(this).text($(this).text() == "collapse" ? "expand" : "collapse");
|
110
|
+
var next = $(this).parent().parent().next();
|
111
|
+
if (next.hasClass('compact')) {
|
112
|
+
next.toggle();
|
113
|
+
next.next().toggle();
|
114
|
+
}
|
115
|
+
else if (next.hasClass('summary')) {
|
116
|
+
var list = $('<ul class="summary compact" />');
|
117
|
+
list.html(next.html());
|
118
|
+
list.find('.summary_desc, .note').remove();
|
119
|
+
list.find('a').each(function() {
|
120
|
+
$(this).html($(this).find('strong').html());
|
121
|
+
$(this).parent().html($(this)[0].outerHTML);
|
122
|
+
});
|
123
|
+
next.before(list);
|
124
|
+
next.toggle();
|
125
|
+
}
|
126
|
+
return false;
|
127
|
+
});
|
128
|
+
if (localStorage) {
|
129
|
+
if (localStorage.summaryCollapsed == "collapse") $('.summary_toggle').click();
|
130
|
+
else localStorage.summaryCollapsed = "expand";
|
90
131
|
}
|
91
132
|
}
|
92
133
|
|
134
|
+
function fixOutsideWorldLinks() {
|
135
|
+
$('a').each(function() {
|
136
|
+
if (window.location.host != this.host) this.target = '_parent';
|
137
|
+
});
|
138
|
+
}
|
139
|
+
|
140
|
+
function generateTOC() {
|
141
|
+
if ($('#filecontents').length == 0) return;
|
142
|
+
var _toc = $('<ol class="top"></ol>');
|
143
|
+
var show = false;
|
144
|
+
var toc = _toc;
|
145
|
+
var counter = 0;
|
146
|
+
var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
147
|
+
if ($('#filecontents h1').length > 1) tags.unshift('h1');
|
148
|
+
for (i in tags) { tags[i] = '#filecontents ' + tags[i] }
|
149
|
+
var lastTag = parseInt(tags[0][1]);
|
150
|
+
$(tags.join(', ')).each(function() {
|
151
|
+
if (this.id == "filecontents") return;
|
152
|
+
show = true;
|
153
|
+
var thisTag = parseInt(this.tagName[1]);
|
154
|
+
if (this.id.length == 0) {
|
155
|
+
var proposedId = $(this).text().replace(/[^a-z0-9:\.()=-]/ig, '_');
|
156
|
+
if ($('#' + proposedId).length > 0) proposedId += counter++;
|
157
|
+
this.id = proposedId;
|
158
|
+
}
|
159
|
+
if (thisTag > lastTag) {
|
160
|
+
for (var i = 0; i < thisTag - lastTag; i++) {
|
161
|
+
var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
|
162
|
+
}
|
163
|
+
}
|
164
|
+
if (thisTag < lastTag) {
|
165
|
+
for (var i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
|
166
|
+
}
|
167
|
+
toc.append('<li><a href="#' + this.id + '">' + $(this).text() + '</a></li>');
|
168
|
+
lastTag = thisTag;
|
169
|
+
});
|
170
|
+
if (!show) return;
|
171
|
+
html = '<div id="toc"><p class="title"><a class="hide_toc" href="#"><strong>Table of Contents</strong></a> <small>(<a href="#" class="float_toc">left</a>)</small></p></div>';
|
172
|
+
$('#content').prepend(html);
|
173
|
+
$('#toc').append(_toc);
|
174
|
+
$('#toc .hide_toc').toggle(function() {
|
175
|
+
$('#toc .top').slideUp('fast');
|
176
|
+
$('#toc').toggleClass('hidden');
|
177
|
+
$('#toc .title small').toggle();
|
178
|
+
}, function() {
|
179
|
+
$('#toc .top').slideDown('fast');
|
180
|
+
$('#toc').toggleClass('hidden');
|
181
|
+
$('#toc .title small').toggle();
|
182
|
+
});
|
183
|
+
$('#toc .float_toc').toggle(function() {
|
184
|
+
$(this).text('float');
|
185
|
+
$('#toc').toggleClass('nofloat');
|
186
|
+
}, function() {
|
187
|
+
$(this).text('left')
|
188
|
+
$('#toc').toggleClass('nofloat');
|
189
|
+
});
|
190
|
+
}
|
191
|
+
|
93
192
|
$(framesInit);
|
94
193
|
$(createSourceLinks);
|
95
194
|
$(createDefineLinks);
|
@@ -97,3 +196,7 @@ $(createFullTreeLinks);
|
|
97
196
|
$(fixBoxInfoHeights);
|
98
197
|
$(searchFrameLinks);
|
99
198
|
$(linkSummaries);
|
199
|
+
$(keyboardShortcuts);
|
200
|
+
$(summaryToggle);
|
201
|
+
$(fixOutsideWorldLinks);
|
202
|
+
$(generateTOC);
|
data/doc/js/full_list.js
CHANGED
@@ -1,10 +1,25 @@
|
|
1
|
+
var inSearch = null;
|
2
|
+
var searchIndex = 0;
|
3
|
+
var searchCache = [];
|
4
|
+
var searchString = '';
|
5
|
+
|
1
6
|
function fullListSearch() {
|
7
|
+
// generate cache
|
8
|
+
searchCache = [];
|
9
|
+
$('#full_list li').each(function() {
|
10
|
+
var link = $(this).find('.object_link a');
|
11
|
+
searchCache.push({name:link.text(), node:$(this), link:link});
|
12
|
+
});
|
13
|
+
|
2
14
|
$('#search input').keyup(function() {
|
3
|
-
|
4
|
-
if (
|
5
|
-
|
6
|
-
|
7
|
-
|
15
|
+
searchString = this.value.toLowerCase();
|
16
|
+
if (searchString == "") {
|
17
|
+
clearTimeout(inSearch);
|
18
|
+
inSearch = null;
|
19
|
+
$('#full_list, #content').removeClass('insearch');
|
20
|
+
$('#full_list li').removeClass('found').each(function() {
|
21
|
+
|
22
|
+
var link = $(this).find('.object_link a');
|
8
23
|
link.text(link.text());
|
9
24
|
});
|
10
25
|
if (clicked) {
|
@@ -15,34 +30,56 @@ function fullListSearch() {
|
|
15
30
|
highlight();
|
16
31
|
}
|
17
32
|
else {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
link.text(link.text());
|
25
|
-
}
|
26
|
-
else {
|
27
|
-
$(this).css('padding-left', '10px').addClass('found');
|
28
|
-
link.html(link.text().replace(new RegExp("(" +
|
29
|
-
value.replace(/([\/.*+?|()\[\]{}\\])/g, "\\$1") + ")", "ig"),
|
30
|
-
'<strong>$1</strong>'));
|
31
|
-
}
|
32
|
-
});
|
33
|
-
highlight(true);
|
34
|
-
}
|
35
|
-
|
36
|
-
if ($('#full_list li:visible').size() == 0) {
|
37
|
-
$('#noresults').fadeIn();
|
38
|
-
}
|
39
|
-
else {
|
40
|
-
$('#noresults').hide();
|
33
|
+
if (inSearch) clearTimeout(inSearch);
|
34
|
+
searchIndex = 0;
|
35
|
+
lastRowClass = '';
|
36
|
+
$('#full_list, #content').addClass('insearch');
|
37
|
+
$('#noresults').text('');
|
38
|
+
searchItem();
|
41
39
|
}
|
42
40
|
});
|
43
41
|
|
44
42
|
$('#search input').focus();
|
45
|
-
$('#full_list').after("<div id='noresults'
|
43
|
+
$('#full_list').after("<div id='noresults'></div>")
|
44
|
+
}
|
45
|
+
|
46
|
+
var lastRowClass = '';
|
47
|
+
function searchItem() {
|
48
|
+
for (var i = 0; i < searchCache.length / 50; i++) {
|
49
|
+
var item = searchCache[searchIndex];
|
50
|
+
if (item.name.toLowerCase().indexOf(searchString) == -1) {
|
51
|
+
item.node.removeClass('found');
|
52
|
+
}
|
53
|
+
else {
|
54
|
+
item.node.css('padding-left', '10px').addClass('found');
|
55
|
+
item.node.removeClass(lastRowClass).addClass(lastRowClass == 'r1' ? 'r2' : 'r1');
|
56
|
+
lastRowClass = item.node.hasClass('r1') ? 'r1' : 'r2';
|
57
|
+
item.link.html(item.name.replace(new RegExp("(" +
|
58
|
+
searchString.replace(/([\/.*+?|()\[\]{}\\])/g, "\\$1") + ")", "ig"),
|
59
|
+
'<strong>$1</strong>'));
|
60
|
+
}
|
61
|
+
|
62
|
+
if (searchCache.length == searchIndex + 1) {
|
63
|
+
return searchDone();
|
64
|
+
}
|
65
|
+
else {
|
66
|
+
searchIndex++;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
inSearch = setTimeout('searchItem()', 0);
|
70
|
+
}
|
71
|
+
|
72
|
+
function searchDone() {
|
73
|
+
highlight(true);
|
74
|
+
if ($('#full_list li:visible').size() == 0) {
|
75
|
+
$('#noresults').text('No results were found.').hide().fadeIn();
|
76
|
+
}
|
77
|
+
else {
|
78
|
+
$('#noresults').text('');
|
79
|
+
}
|
80
|
+
$('#content').removeClass('insearch');
|
81
|
+
clearTimeout(inSearch);
|
82
|
+
inSearch = null;
|
46
83
|
}
|
47
84
|
|
48
85
|
clicked = null;
|
@@ -57,12 +94,7 @@ function linkList() {
|
|
57
94
|
}
|
58
95
|
}
|
59
96
|
if (clicked) clicked.removeClass('clicked');
|
60
|
-
var win = window.parent;
|
61
|
-
if (window.top.frames.main) {
|
62
|
-
win = window.top.frames.main;
|
63
|
-
var title = $('html head title', win.document).text();
|
64
|
-
$('html head title', window.parent.document).text(title);
|
65
|
-
}
|
97
|
+
var win = window.top.frames.main ? window.top.frames.main : window.parent;
|
66
98
|
if (this.tagName.toLowerCase() == "a") {
|
67
99
|
clicked = $(this).parent('li').addClass('clicked');
|
68
100
|
win.location = this.href;
|
@@ -101,6 +133,17 @@ function highlight(no_padding) {
|
|
101
133
|
});
|
102
134
|
}
|
103
135
|
|
136
|
+
function escapeShortcut() {
|
137
|
+
$(document).keydown(function(evt) {
|
138
|
+
if (evt.which == 27) {
|
139
|
+
$('#search_frame', window.top.document).slideUp(100);
|
140
|
+
$('#search a', window.top.document).removeClass('active inactive')
|
141
|
+
$(window.top).focus();
|
142
|
+
}
|
143
|
+
});
|
144
|
+
}
|
145
|
+
|
146
|
+
$(escapeShortcut);
|
104
147
|
$(fullListSearch);
|
105
148
|
$(linkList);
|
106
149
|
$(collapse);
|