lifeline 0.3.0 → 0.4.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 +1 -0
- data/README.rdoc +12 -0
- data/VERSION +1 -1
- data/doc/Lifeline.html +473 -0
- data/doc/Lifeline/LifelineRakeTask.html +400 -0
- data/doc/_index.html +101 -0
- data/doc/class_list.html +36 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +50 -0
- data/doc/css/style.css +273 -0
- data/doc/file.README.html +159 -0
- data/doc/file_list.html +38 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +159 -0
- data/doc/js/app.js +111 -0
- data/doc/js/full_list.js +117 -0
- data/doc/js/jquery.js +19 -0
- data/doc/method_list.html +75 -0
- data/doc/top-level-namespace.html +87 -0
- data/lifeline.gemspec +76 -0
- metadata +19 -2
data/doc/class_list.html
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
7
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
9
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
10
|
+
<base id="base_target" target="_parent" />
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<script type="text/javascript" charset="utf-8">
|
14
|
+
if (window.top.frames.main) {
|
15
|
+
document.getElementById('base_target').target = 'main';
|
16
|
+
document.body.className = 'frames';
|
17
|
+
}
|
18
|
+
</script>
|
19
|
+
<div id="content">
|
20
|
+
<h1 id="full_list_header">Class List</h1>
|
21
|
+
<div id="nav">
|
22
|
+
<a target="_self" href="class_list.html">Classes</a> |
|
23
|
+
<a target="_self" href="method_list.html">Methods</a> |
|
24
|
+
<a target="_self" href="file_list.html">Files</a>
|
25
|
+
</div>
|
26
|
+
<div id="search">Search: <input type="text" /></div>
|
27
|
+
|
28
|
+
<ul id="full_list" class="class">
|
29
|
+
<li><a href="top-level-namespace.html" title=" (root)">Top Level Namespace</a></li>
|
30
|
+
<li><a class='toggle'></a> <a href="Lifeline.html" title="Lifeline (module)">Lifeline</a><small class='search_info'>Top Level Namespace</small></li><ul><li><a href="Lifeline/LifelineRakeTask.html" title="Lifeline::LifelineRakeTask (class)">LifelineRakeTask</a> < TaskLib<small class='search_info'>Lifeline</small></li></ul>
|
31
|
+
|
32
|
+
</ul>
|
33
|
+
</div>
|
34
|
+
</body>
|
35
|
+
</html>
|
36
|
+
|
data/doc/css/common.css
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/* Override this file with custom rules */
|
@@ -0,0 +1,50 @@
|
|
1
|
+
body {
|
2
|
+
margin: 0;
|
3
|
+
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
4
|
+
font-size: 13px;
|
5
|
+
height: 101%;
|
6
|
+
overflow-x: hidden;
|
7
|
+
}
|
8
|
+
|
9
|
+
h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; }
|
10
|
+
.clear { clear: both; }
|
11
|
+
#search { position: absolute; right: 5px; top: 9px; }
|
12
|
+
#full_list { padding: 0; list-style: none; margin-left: 0; }
|
13
|
+
#full_list ul { padding: 0; }
|
14
|
+
#full_list li { padding: 5px; padding-left: 12px; margin: 0; font-size: 1.1em; list-style: none; }
|
15
|
+
#noresults { display: none; padding: 7px 12px; }
|
16
|
+
ul.collapsed ul, ul.collapsed li { display: none; }
|
17
|
+
li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; }
|
18
|
+
li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; }
|
19
|
+
li { color: #888; cursor: pointer; }
|
20
|
+
li.deprecated { text-decoration: line-through; font-style: italic; }
|
21
|
+
li.r1 { background: #f0f0f0; }
|
22
|
+
li.r2 { background: #fafafa; }
|
23
|
+
li:hover { background: #ddd; }
|
24
|
+
li small:before { content: "("; }
|
25
|
+
li small:after { content: ")"; }
|
26
|
+
li small.search_info { display: none; }
|
27
|
+
a:link, a:visited { text-decoration: none; color: #05a; }
|
28
|
+
li.clicked { background: #05a; color: #ccc; }
|
29
|
+
li.clicked a:link, li.clicked a:visited { color: #eee; }
|
30
|
+
li.clicked a.toggle { opacity: 0.5; background-position: bottom right; }
|
31
|
+
li.collapsed.clicked a.toggle { background-position: top right; }
|
32
|
+
#search input { border: 1px solid #bbb; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
|
33
|
+
#nav { margin-left: 10px; font-size: 0.9em; display: none; color: #aaa; }
|
34
|
+
#nav a:link, #nav a:visited { color: #358; }
|
35
|
+
#nav a:hover { background: transparent; color: #5af; }
|
36
|
+
|
37
|
+
.frames #content h1 { margin-top: 0; }
|
38
|
+
.frames li { white-space: nowrap; cursor: normal; }
|
39
|
+
.frames li small { display: block; font-size: 0.8em; }
|
40
|
+
.frames li small:before { content: ""; }
|
41
|
+
.frames li small:after { content: ""; }
|
42
|
+
.frames li small.search_info { display: none; }
|
43
|
+
.frames #search { position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; }
|
44
|
+
.frames #search input { width: 110px; }
|
45
|
+
.frames #nav { display: block; }
|
46
|
+
|
47
|
+
#full_list.insearch li { display: none; }
|
48
|
+
#full_list.insearch li.found { display: list-item; padding-left: 10px; }
|
49
|
+
#full_list.insearch li a.toggle { display: none; }
|
50
|
+
#full_list.insearch li small.search_info { display: block; }
|
data/doc/css/style.css
ADDED
@@ -0,0 +1,273 @@
|
|
1
|
+
body {
|
2
|
+
padding: 0 20px;
|
3
|
+
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
4
|
+
font-size: 13px;
|
5
|
+
}
|
6
|
+
body.frames { padding: 0 5px; }
|
7
|
+
h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; }
|
8
|
+
h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; }
|
9
|
+
h1.title { margin-bottom: 10px; }
|
10
|
+
h1.alphaindex { margin-top: 0; font-size: 22px; }
|
11
|
+
h2 {
|
12
|
+
padding: 0;
|
13
|
+
padding-bottom: 3px;
|
14
|
+
border-bottom: 1px #aaa solid;
|
15
|
+
font-size: 1.4em;
|
16
|
+
margin: 1.8em 0 0.5em;
|
17
|
+
}
|
18
|
+
.clear { clear: both; }
|
19
|
+
.inline { display: inline; }
|
20
|
+
.inline p:first-child { display: inline; }
|
21
|
+
.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; }
|
22
|
+
.docstring h1 { font-size: 1.2em; }
|
23
|
+
.docstring h2 { font-size: 1.1em; }
|
24
|
+
.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; }
|
25
|
+
|
26
|
+
.note {
|
27
|
+
color: #222;
|
28
|
+
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
29
|
+
background: #e3e4e3; border: 1px solid #d5d5d5; padding: 7px 10px;
|
30
|
+
}
|
31
|
+
.note.todo { background: #ffffc5; border-color: #ececaa; }
|
32
|
+
.note.returns_void { background: #efefef; }
|
33
|
+
.note.deprecated { background: #ffe5e5; border-color: #e9dada; }
|
34
|
+
.note.title { text-transform: lowercase; padding: 1px 5px; margin-left: 5px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; }
|
35
|
+
h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; }
|
36
|
+
.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
37
|
+
.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; }
|
38
|
+
.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
39
|
+
.note.title.private { background: #d5d5d5; border-color: #c5c5c5; }
|
40
|
+
|
41
|
+
h3.inherited {
|
42
|
+
font-style: italic;
|
43
|
+
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
44
|
+
font-weight: normal;
|
45
|
+
padding: 0;
|
46
|
+
margin: 0;
|
47
|
+
margin-top: 12px;
|
48
|
+
margin-bottom: 3px;
|
49
|
+
font-size: 13px;
|
50
|
+
}
|
51
|
+
p.inherited {
|
52
|
+
padding: 0;
|
53
|
+
margin: 0;
|
54
|
+
margin-left: 25px;
|
55
|
+
}
|
56
|
+
|
57
|
+
dl.box {
|
58
|
+
width: 520px;
|
59
|
+
font-size: 1em;
|
60
|
+
}
|
61
|
+
dl.box dt {
|
62
|
+
float: left;
|
63
|
+
display: block;
|
64
|
+
width: 100px;
|
65
|
+
margin: 0;
|
66
|
+
text-align: right;
|
67
|
+
font-weight: bold;
|
68
|
+
border: 1px solid #aaa;
|
69
|
+
border-width: 1px 0px 0px 1px;
|
70
|
+
padding: 6px 0;
|
71
|
+
padding-right: 10px;
|
72
|
+
}
|
73
|
+
dl.box dd {
|
74
|
+
float: left;
|
75
|
+
display: block;
|
76
|
+
width: 380px;
|
77
|
+
margin: 0;
|
78
|
+
padding: 6px 0;
|
79
|
+
padding-right: 20px;
|
80
|
+
border: 1px solid #aaa;
|
81
|
+
border-width: 1px 1px 0 0;
|
82
|
+
}
|
83
|
+
dl.box .last {
|
84
|
+
border-bottom: 1px solid #aaa;
|
85
|
+
}
|
86
|
+
dl.box .r1 { background: #eee; }
|
87
|
+
|
88
|
+
ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; }
|
89
|
+
#files { padding-left: 15px; font-size: 1.1em; }
|
90
|
+
|
91
|
+
#files { padding: 0; }
|
92
|
+
#files li { list-style: none; display: inline; padding: 7px 12px; line-height: 35px; }
|
93
|
+
|
94
|
+
dl.constants { margin-left: 40px; }
|
95
|
+
dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; }
|
96
|
+
dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; }
|
97
|
+
|
98
|
+
.summary_desc { margin-left: 32px; display: block; font-family: sans-serif; }
|
99
|
+
.summary_desc tt { font-size: 0.9em; }
|
100
|
+
dl.constants .docstring { margin-left: 32px; font-size: 0.9em; font-weight: normal; }
|
101
|
+
dl.constants .discussion *:first-child { margin-top: 0; }
|
102
|
+
dl.constants .discussion *:last-child { margin-bottom: 0; }
|
103
|
+
|
104
|
+
.method_details { border-top: 1px dotted #aaa; margin-top: 15px; padding-top: 0; }
|
105
|
+
.method_details.first { border: 0; }
|
106
|
+
p.signature {
|
107
|
+
font-size: 1.1em; font-weight: normal; font-family: Monaco, Consolas, Courier, monospace;
|
108
|
+
padding: 6px 10px; margin-top: 18px;
|
109
|
+
background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px;
|
110
|
+
}
|
111
|
+
p.signature tt { font-family: Monaco, Consolas, Courier, monospace; }
|
112
|
+
p.signature .overload { display: block; }
|
113
|
+
p.signature .extras { font-weight: normal; font-family: sans-serif; color: #444; font-size: 1em; }
|
114
|
+
p.signature .aliases { display: block; font-weight: normal; font-size: 0.9em; font-family: sans-serif; margin-top: 0px; color: #555; }
|
115
|
+
p.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace; font-weight: bold; color: #000; font-size: 1.2em; }
|
116
|
+
|
117
|
+
.tags h3 { font-size: 1em; margin-bottom: 0; }
|
118
|
+
.tags ul { margin-top: 5px; padding-left: 30px; list-style: square; }
|
119
|
+
.tags ul li { margin-bottom: 3px; }
|
120
|
+
.tags ul .name { font-family: monospace; font-weight: bold; }
|
121
|
+
.tags ul p.note { padding: 3px 6px; }
|
122
|
+
.tags { margin-bottom: 12px; }
|
123
|
+
|
124
|
+
.tags .examples h3 { margin-bottom: 10px; }
|
125
|
+
.tags .examples h4 { padding: 0; margin: 0; margin-left: 15px; font-weight: bold; font-size: 0.9em; }
|
126
|
+
|
127
|
+
.tags .overload .overload_item { list-style: none; margin-bottom: 25px; }
|
128
|
+
.tags .overload .overload_item .signature {
|
129
|
+
padding: 2px 8px;
|
130
|
+
background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px;
|
131
|
+
}
|
132
|
+
.tags .overload .signature { margin-left: -15px; font-family: monospace; display: block; font-size: 1.1em; }
|
133
|
+
.tags .overload .docstring { margin-top: 15px; }
|
134
|
+
|
135
|
+
.defines { display: none; }
|
136
|
+
|
137
|
+
#method_missing_details .notice.this { position: relative; top: -8px; color: #888; padding: 0; margin: 0; }
|
138
|
+
|
139
|
+
.showSource { font-size: 0.9em; }
|
140
|
+
.showSource a:link, .showSource a:visited { text-decoration: none; color: #666; }
|
141
|
+
|
142
|
+
#content a:link, #content a:visited { text-decoration: none; color: #05a; }
|
143
|
+
#content a:hover { background: #ffffa5; }
|
144
|
+
.docstring { margin-right: 6em; }
|
145
|
+
|
146
|
+
ul.summary {
|
147
|
+
list-style: none;
|
148
|
+
font-family: monospace;
|
149
|
+
font-size: 1em;
|
150
|
+
line-height: 1.5em;
|
151
|
+
}
|
152
|
+
ul.summary a:link, ul.summary a:visited {
|
153
|
+
text-decoration: none; font-size: 1.1em;
|
154
|
+
}
|
155
|
+
ul.summary li { margin-bottom: 5px; }
|
156
|
+
.summary .summary_signature {
|
157
|
+
padding: 1px 10px;
|
158
|
+
background: #eaeaff; border: 1px solid #dfdfe5;
|
159
|
+
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
160
|
+
}
|
161
|
+
.summary_signature:hover { background: #eeeeff; cursor: pointer; }
|
162
|
+
#content .summary_signature:hover a:link,
|
163
|
+
#content .summary_signature:hover a:visited {
|
164
|
+
background: transparent;
|
165
|
+
color: #48f;
|
166
|
+
}
|
167
|
+
|
168
|
+
p.inherited a { font-family: monospace; font-size: 0.9em; }
|
169
|
+
p.inherited { word-spacing: 5px; font-size: 1.2em; }
|
170
|
+
|
171
|
+
p.children { font-size: 1.2em; }
|
172
|
+
p.children a { font-size: 0.9em; }
|
173
|
+
p.children strong { font-size: 0.8em; }
|
174
|
+
p.children strong.modules { padding-left: 5px; }
|
175
|
+
|
176
|
+
ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; }
|
177
|
+
ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; }
|
178
|
+
ul.fullTree li { text-align: center; }
|
179
|
+
ul.fullTree li.next:before { font-size: 1.2em; content: '\2B06'; color: #bbb; display: block; margin-top: 3px; }
|
180
|
+
|
181
|
+
#search { position: absolute; right: 14px; top: 0px; }
|
182
|
+
#search a:link, #search a:visited {
|
183
|
+
display: block; float: left; margin-right: 4px;
|
184
|
+
padding: 8px 10px; text-decoration: none; color: #05a; background: #eaeaff;
|
185
|
+
border: 1px solid #d8d8e5;
|
186
|
+
-moz-border-radius-bottomleft: 3px; -moz-border-radius-bottomright: 3px;
|
187
|
+
-webkit-border-bottom-left-radius: 3px; -webkit-border-bottom-right-radius: 3px;
|
188
|
+
}
|
189
|
+
#search a:hover { background: #eef; color: #06b; }
|
190
|
+
#search a.active {
|
191
|
+
background: #568; padding-bottom: 20px; color: #fff; border: 1px solid #457;
|
192
|
+
-moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px;
|
193
|
+
-webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px;
|
194
|
+
}
|
195
|
+
#search a.inactive { color: #999; }
|
196
|
+
.frames #search { display: none; }
|
197
|
+
.inheritanceTree, .toggleDefines { float: right; }
|
198
|
+
|
199
|
+
#menu { font-size: 1.3em; color: #bbb; top: -5px; position: relative; }
|
200
|
+
#menu .title, #menu a { font-size: 0.7em; }
|
201
|
+
#menu .title a { font-size: 1em; }
|
202
|
+
#menu .title { color: #555; }
|
203
|
+
#menu a:link, #menu a:visited { color: #333; text-decoration: none; border-bottom: 1px dotted #bbd; }
|
204
|
+
#menu a:hover { color: #05a; }
|
205
|
+
#menu .noframes { display: none; }
|
206
|
+
.frames #menu .noframes { display: inline; float: right; }
|
207
|
+
|
208
|
+
#footer { margin-top: 15px; border-top: 1px solid #ccc; text-align: center; padding: 7px 0; color: #999; }
|
209
|
+
#footer a:link, #footer a:visited { color: #444; text-decoration: none; border-bottom: 1px dotted #bbd; }
|
210
|
+
#footer a:hover { color: #05a; }
|
211
|
+
|
212
|
+
#listing ul.alpha { font-size: 1.1em; }
|
213
|
+
#listing ul.alpha { margin: 0; padding: 0; padding-bottom: 10px; list-style: none; }
|
214
|
+
#listing ul.alpha li.letter { font-size: 1.4em; padding-bottom: 10px; }
|
215
|
+
#listing ul.alpha ul { margin: 0; padding-left: 15px; }
|
216
|
+
#listing ul small { color: #666; font-size: 0.7em; }
|
217
|
+
|
218
|
+
li.r1 { background: #f0f0f0; }
|
219
|
+
li.r2 { background: #fafafa; }
|
220
|
+
|
221
|
+
#search_frame {
|
222
|
+
background: #fff;
|
223
|
+
display: none;
|
224
|
+
position: absolute;
|
225
|
+
top: 36px;
|
226
|
+
right: 18px;
|
227
|
+
width: 500px;
|
228
|
+
height: 80%;
|
229
|
+
overflow-y: scroll;
|
230
|
+
border: 1px solid #999;
|
231
|
+
border-collapse: collapse;
|
232
|
+
-webkit-box-shadow: -2px 5px 25px #aaa;
|
233
|
+
-moz-box-shadow: -2px 5px 25px #aaa;
|
234
|
+
-moz-border-radius: 2px;
|
235
|
+
-webkit-border-radius: 2px;
|
236
|
+
}
|
237
|
+
|
238
|
+
#content ul.summary li.deprecated a:link,
|
239
|
+
#content ul.summary li.deprecated a:visited { text-decoration: line-through; font-style: italic; }
|
240
|
+
|
241
|
+
/* syntax highlighting */
|
242
|
+
.source_code { display: none; padding: 3px 8px; border-left: 8px solid #ddd; margin-top: 5px; }
|
243
|
+
#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; }
|
244
|
+
#filecontents pre.code, .docstring pre.code { display: block; }
|
245
|
+
.source_code .lines { padding-right: 12px; color: #555; text-align: right; }
|
246
|
+
#filecontents pre.code, .docstring pre.code,
|
247
|
+
.tags .example { padding: 5px 12px; margin-top: 4px; border: 1px solid #eef; background: #f5f5ff; }
|
248
|
+
pre.code { color: #000; }
|
249
|
+
pre.code .info.file { color: #555; }
|
250
|
+
pre.code .val { color: #036A07; }
|
251
|
+
pre.code .tstring_content,
|
252
|
+
pre.code .heredoc_beg, pre.code .heredoc_end,
|
253
|
+
pre.code .qwords_beg, pre.code .qwords_end,
|
254
|
+
pre.code .tstring, pre.code .dstring { color: #036A07; }
|
255
|
+
pre.code .fid, pre.code .id.new, pre.code .id.to_s,
|
256
|
+
pre.code .id.to_sym, pre.code .id.to_f,
|
257
|
+
pre.code .dot + pre.code .id,
|
258
|
+
pre.code .id.to_i pre.code .id.each { color: #0085FF; }
|
259
|
+
pre.code .comment { color: #0066FF; }
|
260
|
+
pre.code .const, pre.code .constant { color: #585CF6; }
|
261
|
+
pre.code .symbol { color: #C5060B; }
|
262
|
+
pre.code .kw,
|
263
|
+
pre.code .label,
|
264
|
+
pre.code .id.require,
|
265
|
+
pre.code .id.extend,
|
266
|
+
pre.code .id.include { color: #0000FF; }
|
267
|
+
pre.code .ivar { color: #318495; }
|
268
|
+
pre.code .gvar,
|
269
|
+
pre.code .id.backref,
|
270
|
+
pre.code .id.nth_ref { color: #6D79DE; }
|
271
|
+
pre.code .regexp, .dregexp { color: #036A07; }
|
272
|
+
pre.code a { border-bottom: 1px dotted #bbf; }
|
273
|
+
|
@@ -0,0 +1,159 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>Documentation by YARD 0.5.4</title>
|
7
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
relpath = '';
|
12
|
+
if (relpath != '') relpath += '/';
|
13
|
+
</script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<script type="text/javascript" charset="utf-8">
|
20
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<div id="header">
|
24
|
+
<div id="menu">
|
25
|
+
|
26
|
+
<a href="_index.html" title="Index">Index</a> »
|
27
|
+
<span class="title">File: README</span>
|
28
|
+
|
29
|
+
|
30
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div id="search">
|
34
|
+
<a id="class_list_link" href="#">Class List</a>
|
35
|
+
<a id="method_list_link" href="#">Method List</a>
|
36
|
+
<a id ="file_list_link" href="#">File List</a>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="clear"></div>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<iframe id="search_frame"></iframe>
|
43
|
+
|
44
|
+
<div id="content"><div id='filecontents'><h1>lifeline</h1>
|
45
|
+
<p>
|
46
|
+
Methods for creating lifeline tasks. This allows you to write cron jobs
|
47
|
+
that restart processes that die while ensuring the code is only executing
|
48
|
+
only once (avoiding the duplication that sometimes happens using the
|
49
|
+
‘daemons’) gem. Both a generic lifeline method is provided as
|
50
|
+
well as methods to create 3 lifeline rake tasks for managing lifelines.
|
51
|
+
</p>
|
52
|
+
<h2>The Lifeline Approach</h2>
|
53
|
+
<p>
|
54
|
+
For all their history, daemons can be problematic. For starters, mechanisms
|
55
|
+
for restarting daemons that have failed often rely on a third-party
|
56
|
+
application like monit which is itself a daemon. In addition, PID-based
|
57
|
+
mechanisms to ensure only one daemon is running at a time fail in both
|
58
|
+
ways, sometimes preventing a daemon from starting up and other times not
|
59
|
+
preventing multiple instances from running.
|
60
|
+
</p>
|
61
|
+
<p>
|
62
|
+
The lifeline pattern (originally presented to me by Matt Todd of Highgroove
|
63
|
+
Studios) is a different approach that uses a cron job that runs every
|
64
|
+
minute as a lifeline to restart the daemon process if it has died. This
|
65
|
+
lifeline calls ps to see if another instance of the same command is already
|
66
|
+
running. If it is, the lifeline exits immediately. Otherwise, it stays
|
67
|
+
running indefinitely (Cron starts all jobs via a fork, so it can run
|
68
|
+
forever without stalling out cron). The trick is figuring out the right
|
69
|
+
invocation to ps to ensure you are only checking for apps with the same
|
70
|
+
name. But the lifeline gem handles all this to you.
|
71
|
+
</p>
|
72
|
+
<p>
|
73
|
+
Although lifelines can work well for processes that run forever, the
|
74
|
+
technique can also be used to safeguard any code you only want to run a
|
75
|
+
single instance of at a time (eg, if you have a cron job that runs every 5
|
76
|
+
minutes and you want to ensure it doesn’t run 2 processes should the
|
77
|
+
first cron job get delayed.)
|
78
|
+
</p>
|
79
|
+
<h2>How a Lifeline Works</h2>
|
80
|
+
<p>
|
81
|
+
More specifically, the lifeline method (and rake task that calls it) does
|
82
|
+
the following steps:
|
83
|
+
</p>
|
84
|
+
<ul>
|
85
|
+
<li>Get a list of all running processes
|
86
|
+
|
87
|
+
</li>
|
88
|
+
<li>Find the name of the current process by looking for the command associated
|
89
|
+
with the current process id (the $$ variable)
|
90
|
+
|
91
|
+
</li>
|
92
|
+
<li>If there is another process with the same command string, return and exit
|
93
|
+
|
94
|
+
</li>
|
95
|
+
<li>Otherwise yield to run the passed block.
|
96
|
+
|
97
|
+
</li>
|
98
|
+
</ul>
|
99
|
+
<p>
|
100
|
+
Note that you do not pass a command name to the lifeline, it uses the
|
101
|
+
command of the process invoking the Lifeline code. This means if you call
|
102
|
+
lifeline code simultaneously from a Rake task and a Rails process, it will
|
103
|
+
be executed in both cases (it’s NOT a mutex or semaphore). Also, this
|
104
|
+
mechanism uses a global namespace. means you will want to give unique names
|
105
|
+
to the processes that ultimately invoke your lifeline code. If app1 and
|
106
|
+
app2 both have a rake task named "lifeline," they will interfere
|
107
|
+
with each other ("app1:lifeline" and "app2:lifeline"
|
108
|
+
are much better).
|
109
|
+
</p>
|
110
|
+
<h2>Examples</h2>
|
111
|
+
<pre class="code">
|
112
|
+
<span class='Lifeline constant id'>Lifeline</span><span class='dot token'>.</span><span class='lifeline identifier id'>lifeline</span> <span class='do do kw'>do</span>
|
113
|
+
<span class='comment val'># some code you want to run in only a single process</span>
|
114
|
+
<span class='end end kw'>end</span>
|
115
|
+
|
116
|
+
<span class='Lifeline constant id'>Lifeline</span><span class='dot token'>.</span><span class='define_lifeline_tasks identifier id'>define_lifeline_tasks</span><span class='lparen token'>(</span><span class='string val'>"appname"</span><span class='rparen token'>)</span> <span class='do do kw'>do</span>
|
117
|
+
<span class='comment val'># some code you want to run in a single lifeline</span>
|
118
|
+
<span class='end end kw'>end</span>
|
119
|
+
|
120
|
+
<span class='gt op'>></span> <span class='rake identifier id'>rake</span> <span class='minus op'>-</span><span class='T constant id'>T</span> <span class='appname identifier id'>appname</span>
|
121
|
+
<span class='rake identifier id'>rake</span> <span class='appname identifier id'>appname</span><span class='symbol val'>:lifeline</span> <span class='comment val'># A lifeline task for executing only one process of twitter:daemon:run at a time</span>
|
122
|
+
<span class='rake identifier id'>rake</span> <span class='appname identifier id'>appname</span><span class='symbol val'>:run</span> <span class='comment val'># Runs the twitter:daemon:run task</span>
|
123
|
+
<span class='rake identifier id'>rake</span> <span class='appname identifier id'>appname</span><span class='symbol val'>:terminate</span> <span class='comment val'># Terminates any running twitter:daemon:lifeline tasks</span>
|
124
|
+
</pre>
|
125
|
+
<h2>Note on Patches/Pull Requests</h2>
|
126
|
+
<ul>
|
127
|
+
<li>Fork the project.
|
128
|
+
|
129
|
+
</li>
|
130
|
+
<li>Make your feature addition or bug fix.
|
131
|
+
|
132
|
+
</li>
|
133
|
+
<li>Add tests for it. This is important so I don’t break it in a future
|
134
|
+
version unintentionally.
|
135
|
+
|
136
|
+
</li>
|
137
|
+
<li>Commit, do not mess with rakefile, version, or history. (if you want to
|
138
|
+
have your own version, that is fine but bump version in a commit by itself
|
139
|
+
I can ignore when I pull)
|
140
|
+
|
141
|
+
</li>
|
142
|
+
<li>Send me a pull request. Bonus points for topic branches.
|
143
|
+
|
144
|
+
</li>
|
145
|
+
</ul>
|
146
|
+
<h2>Copyright</h2>
|
147
|
+
<p>
|
148
|
+
Copyright © 2010 The New York Times. See LICENSE for details.
|
149
|
+
</p>
|
150
|
+
</div></div>
|
151
|
+
|
152
|
+
<div id="footer">
|
153
|
+
Generated on Tue Apr 13 12:07:29 2010 by
|
154
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
155
|
+
0.5.4 (ruby-1.8.7).
|
156
|
+
</div>
|
157
|
+
|
158
|
+
</body>
|
159
|
+
</html>
|