ttycoke 0.2.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.
Files changed (75) hide show
  1. data/.gitignore +16 -0
  2. data/.togglerc +10 -0
  3. data/.tork.rb +2 -0
  4. data/.travis.yml +6 -0
  5. data/LICENSE +21 -0
  6. data/README.md +150 -0
  7. data/Rakefile +25 -0
  8. data/bin/ttycoke +10 -0
  9. data/config/config.yaml +5 -0
  10. data/config/ttycoke.d/id.yaml +4 -0
  11. data/config/ttycoke.d/lsmod.yaml +3 -0
  12. data/config/ttycoke.d/tail_focus.yaml +14 -0
  13. data/config/ttycoke.d/tail_tork_logs.yaml +26 -0
  14. data/config/ttycoke.d/top.yaml +8 -0
  15. data/doc/TTYCoke/ANSI.html +598 -0
  16. data/doc/TTYCoke/ANSIColor.html +586 -0
  17. data/doc/TTYCoke/CLI.html +242 -0
  18. data/doc/TTYCoke/Config/Configuration.html +210 -0
  19. data/doc/TTYCoke/Config.html +347 -0
  20. data/doc/TTYCoke/Errors/CustomizationFailed.html +135 -0
  21. data/doc/TTYCoke/Errors/FallbackError.html +216 -0
  22. data/doc/TTYCoke/Errors/ProgramNotFoundError.html +216 -0
  23. data/doc/TTYCoke/Errors/TTYCokeError.html +206 -0
  24. data/doc/TTYCoke/Errors/TTYCokeTypeError.html +216 -0
  25. data/doc/TTYCoke/Errors/YamlSyntaxError.html +216 -0
  26. data/doc/TTYCoke/Errors.html +106 -0
  27. data/doc/TTYCoke/LineParser.html +210 -0
  28. data/doc/TTYCoke/Log.html +391 -0
  29. data/doc/TTYCoke/Parser.html +210 -0
  30. data/doc/TTYCoke/Platform.html +398 -0
  31. data/doc/TTYCoke/Run.html +198 -0
  32. data/doc/TTYCoke/TTYCokeLogFormat.html +204 -0
  33. data/doc/TTYCoke/Version.html +136 -0
  34. data/doc/TTYCoke.html +110 -0
  35. data/doc/_index.html +279 -0
  36. data/doc/class_list.html +47 -0
  37. data/doc/css/common.css +1 -0
  38. data/doc/css/full_list.css +55 -0
  39. data/doc/css/style.css +322 -0
  40. data/doc/file.README.html +153 -0
  41. data/doc/file_list.html +49 -0
  42. data/doc/frames.html +13 -0
  43. data/doc/index.html +153 -0
  44. data/doc/js/app.js +205 -0
  45. data/doc/js/full_list.js +167 -0
  46. data/doc/js/jquery.js +16 -0
  47. data/doc/method_list.html +238 -0
  48. data/doc/top-level-namespace.html +130 -0
  49. data/lib/ttycoke/ansi.rb +127 -0
  50. data/lib/ttycoke/cli.rb +33 -0
  51. data/lib/ttycoke/config.rb +39 -0
  52. data/lib/ttycoke/errors.rb +40 -0
  53. data/lib/ttycoke/import.rb +72 -0
  54. data/lib/ttycoke/log.rb +84 -0
  55. data/lib/ttycoke/parser.rb +59 -0
  56. data/lib/ttycoke/platform.rb +33 -0
  57. data/lib/ttycoke/run.rb +59 -0
  58. data/lib/ttycoke/version.rb +10 -0
  59. data/lib/ttycoke.rb +15 -0
  60. data/test/data/ansi_lines.yaml +12 -0
  61. data/test/data/config.yaml +4 -0
  62. data/test/data/syntax_error_config.yaml +6 -0
  63. data/test/data/ttycoke.d/id.yaml +4 -0
  64. data/test/data/ttycoke.d/lsmod.yaml +3 -0
  65. data/test/data/ttycoke.d/tail_focus.yaml +14 -0
  66. data/test/data/ttycoke.d/tail_tork_logs.yaml +26 -0
  67. data/test/data/ttycoke.d/top.yaml +8 -0
  68. data/test/test_helper.rb +14 -0
  69. data/test/ttycoke/test_ansi.rb +89 -0
  70. data/test/ttycoke/test_cli.rb +8 -0
  71. data/test/ttycoke/test_config.rb +23 -0
  72. data/test/ttycoke/test_log.rb +22 -0
  73. data/test/ttycoke/test_parser.rb +24 -0
  74. data/ttycoke.gemspec +16 -0
  75. metadata +120 -0
@@ -0,0 +1,347 @@
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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: TTYCoke::Config
8
+
9
+ &mdash; TTYCoke Documentation
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '..';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="../_index.html">Index (C)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../TTYCoke.html" title="TTYCoke (module)">TTYCoke</a></span></span>
38
+ &raquo;
39
+ <span class="title">Config</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Class: TTYCoke::Config
60
+
61
+
62
+
63
+ </h1>
64
+
65
+ <dl class="box">
66
+
67
+ <dt class="r1">Inherits:</dt>
68
+ <dd class="r1">
69
+ <span class="inheritName">Object</span>
70
+
71
+ <ul class="fullTree">
72
+ <li>Object</li>
73
+
74
+ <li class="next">TTYCoke::Config</li>
75
+
76
+ </ul>
77
+ <a href="#" class="inheritanceTree">show all</a>
78
+
79
+ </dd>
80
+
81
+
82
+
83
+
84
+
85
+
86
+ <dt class="r2">Includes:</dt>
87
+ <dd class="r2"><span class='object_link'><a href="Log.html" title="TTYCoke::Log (module)">Log</a></span></dd>
88
+
89
+
90
+
91
+
92
+
93
+ <dt class="r1 last">Defined in:</dt>
94
+ <dd class="r1 last">lib/ttycoke/config.rb</dd>
95
+
96
+ </dl>
97
+ <div class="clear"></div>
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+ <h2>
113
+ Instance Method Summary
114
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
115
+ </h2>
116
+
117
+ <ul class="summary">
118
+
119
+ <li class="public ">
120
+ <span class="summary_signature">
121
+
122
+ <a href="#file-instance_method" title="#file (instance method)">- (Object) <strong>file</strong> </a>
123
+
124
+
125
+
126
+ </span>
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+ <span class="summary_desc"><div class='inline'></div></span>
136
+
137
+ </li>
138
+
139
+
140
+ <li class="public ">
141
+ <span class="summary_signature">
142
+
143
+ <a href="#find_program-instance_method" title="#find_program (instance method)">- (Object) <strong>find_program</strong>(prgm) </a>
144
+
145
+
146
+
147
+ </span>
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+ <span class="summary_desc"><div class='inline'></div></span>
157
+
158
+ </li>
159
+
160
+
161
+ <li class="public ">
162
+ <span class="summary_signature">
163
+
164
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Config) <strong>initialize</strong>(config_file = ENV['HOME'] + &quot;/.ttycokerc&quot;) </a>
165
+
166
+
167
+
168
+ </span>
169
+
170
+ <span class="note title constructor">constructor</span>
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+ <span class="summary_desc"><div class='inline'>
180
+ <p>A new instance of Config.</p>
181
+ </div></span>
182
+
183
+ </li>
184
+
185
+
186
+ </ul>
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Log.html" title="TTYCoke::Log (module)">Log</a></span></h3>
198
+ <p class="inherited"><span class='object_link'><a href="Log.html#log_check_child_exit_status-instance_method" title="TTYCoke::Log#log_check_child_exit_status (method)">#log_check_child_exit_status</a></span>, <span class='object_link'><a href="Log.html#log_debug-instance_method" title="TTYCoke::Log#log_debug (method)">#log_debug</a></span>, <span class='object_link'><a href="Log.html#log_error-instance_method" title="TTYCoke::Log#log_error (method)">#log_error</a></span>, <span class='object_link'><a href="Log.html#log_rescue-instance_method" title="TTYCoke::Log#log_rescue (method)">#log_rescue</a></span></p>
199
+ <div id="constructor_details" class="method_details_list">
200
+ <h2>Constructor Details</h2>
201
+
202
+ <div class="method_details first">
203
+ <p class="signature first" id="initialize-instance_method">
204
+
205
+ - (<tt><span class='object_link'><a href="" title="TTYCoke::Config (class)">Config</a></span></tt>) <strong>initialize</strong>(config_file = ENV['HOME'] + &quot;/.ttycokerc&quot;)
206
+
207
+
208
+
209
+ </p><div class="docstring">
210
+ <div class="discussion">
211
+
212
+ <p>A new instance of Config</p>
213
+
214
+
215
+ </div>
216
+ </div>
217
+ <div class="tags">
218
+
219
+
220
+ </div><table class="source_code">
221
+ <tr>
222
+ <td>
223
+ <pre class="lines">
224
+
225
+
226
+ 8
227
+ 9
228
+ 10
229
+ 11
230
+ 12
231
+ 13
232
+ 14
233
+ 15
234
+ 16</pre>
235
+ </td>
236
+ <td>
237
+ <pre class="code"><span class="info file"># File 'lib/ttycoke/config.rb', line 8</span>
238
+
239
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_config_file'>config_file</span><span class='op'>=</span><span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>HOME</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/.ttycokerc</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
240
+ <span class='id identifier rubyid_log_rescue'>log_rescue</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid___method__'>__method__</span><span class='comma'>,</span> <span class='id identifier rubyid_caller'>caller</span><span class='comma'>,</span> <span class='const'>TTYCoke</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>YamlSyntaxError</span><span class='rparen'>)</span> <span class='lbrace'>{</span>
241
+ <span class='ivar'>@files</span> <span class='op'>=</span> <span class='lbrace'>{</span>
242
+ <span class='label'>init:</span> <span class='id identifier rubyid_config_file'>config_file</span><span class='comma'>,</span>
243
+ <span class='label'>tty_coke:</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span><span class='kw'>__FILE__</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/../../config/config.yaml</span><span class='tstring_end'>'</span></span>
244
+ <span class='rbrace'>}</span>
245
+ <span class='ivar'>@config</span> <span class='op'>=</span> <span class='const'>YAML</span><span class='op'>::</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rparen'>)</span>
246
+ <span class='rbrace'>}</span>
247
+ <span class='kw'>end</span></pre>
248
+ </td>
249
+ </tr>
250
+ </table>
251
+ </div>
252
+
253
+ </div>
254
+
255
+
256
+ <div id="instance_method_details" class="method_details_list">
257
+ <h2>Instance Method Details</h2>
258
+
259
+
260
+ <div class="method_details first">
261
+ <p class="signature first" id="file-instance_method">
262
+
263
+ - (<tt>Object</tt>) <strong>file</strong>
264
+
265
+
266
+
267
+ </p><table class="source_code">
268
+ <tr>
269
+ <td>
270
+ <pre class="lines">
271
+
272
+
273
+ 26
274
+ 27
275
+ 28
276
+ 29
277
+ 30
278
+ 31
279
+ 32
280
+ 33
281
+ 34</pre>
282
+ </td>
283
+ <td>
284
+ <pre class="code"><span class="info file"># File 'lib/ttycoke/config.rb', line 26</span>
285
+
286
+ <span class='kw'>def</span> <span class='id identifier rubyid_file'>file</span>
287
+ <span class='id identifier rubyid_log_rescue'>log_rescue</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid___method__'>__method__</span><span class='comma'>,</span> <span class='id identifier rubyid_caller'>caller</span><span class='rparen'>)</span> <span class='lbrace'>{</span>
288
+ <span class='kw'>if</span> <span class='const'>FileTest</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='ivar'>@files</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:init</span><span class='rparen'>)</span><span class='rparen'>)</span>
289
+ <span class='ivar'>@files</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:init</span><span class='rparen'>)</span>
290
+ <span class='kw'>else</span>
291
+ <span class='ivar'>@files</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:tty_coke</span><span class='rparen'>)</span>
292
+ <span class='kw'>end</span>
293
+ <span class='rbrace'>}</span>
294
+ <span class='kw'>end</span></pre>
295
+ </td>
296
+ </tr>
297
+ </table>
298
+ </div>
299
+
300
+ <div class="method_details ">
301
+ <p class="signature " id="find_program-instance_method">
302
+
303
+ - (<tt>Object</tt>) <strong>find_program</strong>(prgm)
304
+
305
+
306
+
307
+ </p><table class="source_code">
308
+ <tr>
309
+ <td>
310
+ <pre class="lines">
311
+
312
+
313
+ 18
314
+ 19
315
+ 20
316
+ 21
317
+ 22
318
+ 23
319
+ 24</pre>
320
+ </td>
321
+ <td>
322
+ <pre class="code"><span class="info file"># File 'lib/ttycoke/config.rb', line 18</span>
323
+
324
+ <span class='kw'>def</span> <span class='id identifier rubyid_find_program'>find_program</span> <span class='id identifier rubyid_prgm'>prgm</span>
325
+ <span class='kw'>if</span> <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_prgm'>prgm</span><span class='rparen'>)</span>
326
+ <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_prgm'>prgm</span><span class='rparen'>)</span>
327
+ <span class='kw'>else</span>
328
+ <span class='kw'>false</span>
329
+ <span class='kw'>end</span>
330
+ <span class='kw'>end</span></pre>
331
+ </td>
332
+ </tr>
333
+ </table>
334
+ </div>
335
+
336
+ </div>
337
+
338
+ </div>
339
+
340
+ <div id="footer">
341
+ Generated on Mon Jan 30 03:06:13 2012 by
342
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
343
+ 0.7.4 (ruby-1.9.3).
344
+ </div>
345
+
346
+ </body>
347
+ </html>
@@ -0,0 +1,135 @@
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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Exception: TTYCoke::Errors::CustomizationFailed
8
+
9
+ &mdash; Active Paypal Adaptive Payment Documentation
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '../..';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="../../_index.html">Index (C)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../../TTYCoke.html" title="TTYCoke (module)">TTYCoke</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Errors.html" title="TTYCoke::Errors (module)">Errors</a></span></span>
38
+ &raquo;
39
+ <span class="title">CustomizationFailed</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Exception: TTYCoke::Errors::CustomizationFailed
60
+
61
+
62
+
63
+ </h1>
64
+
65
+ <dl class="box">
66
+
67
+ <dt class="r1">Inherits:</dt>
68
+ <dd class="r1">
69
+ <span class="inheritName"><span class='object_link'><a href="TTYCokeError.html" title="TTYCoke::Errors::TTYCokeError (class)">TTYCokeError</a></span></span>
70
+
71
+ <ul class="fullTree">
72
+ <li>Object</li>
73
+
74
+ <li class="next">StandardError</li>
75
+
76
+ <li class="next"><span class='object_link'><a href="TTYCokeError.html" title="TTYCoke::Errors::TTYCokeError (class)">TTYCokeError</a></span></li>
77
+
78
+ <li class="next">TTYCoke::Errors::CustomizationFailed</li>
79
+
80
+ </ul>
81
+ <a href="#" class="inheritanceTree">show all</a>
82
+
83
+ </dd>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+ <dt class="r2 last">Defined in:</dt>
94
+ <dd class="r2 last">lib/ttycoke/errors.rb</dd>
95
+
96
+ </dl>
97
+ <div class="clear"></div>
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+ <h2>Method Summary</h2>
120
+
121
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="TTYCokeError.html" title="TTYCoke::Errors::TTYCokeError (class)">TTYCokeError</a></span></h3>
122
+ <p class="inherited"><span class='object_link'><a href="TTYCokeError.html#status_code-class_method" title="TTYCoke::Errors::TTYCokeError.status_code (method)">status_code</a></span></p>
123
+
124
+
125
+
126
+ </div>
127
+
128
+ <div id="footer">
129
+ Generated on Tue Jan 24 03:45:04 2012 by
130
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
131
+ 0.7.4 (ruby-1.9.3).
132
+ </div>
133
+
134
+ </body>
135
+ </html>