wc 0.98.2 → 0.99.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/Gemfile +14 -0
- data/Gemfile.lock +30 -0
- data/README.rdoc +11 -15
- data/Rakefile +34 -49
- data/VERSION +1 -1
- data/doc/String.html +372 -0
- data/doc/Wc.html +93 -0
- data/doc/Wc/Engine.html +289 -0
- data/doc/Wc/Reader.html +253 -0
- data/doc/_index.html +138 -0
- data/doc/class_list.html +36 -0
- data/doc/classes/Wc.html +279 -0
- data/doc/classes/Wc.src/M000001.html +38 -0
- data/doc/classes/Wc.src/M000002.html +26 -0
- data/doc/classes/Wc.src/M000003.html +74 -0
- data/doc/classes/Wc.src/M000004.html +29 -0
- data/doc/classes/Wc.src/M000005.html +25 -0
- data/doc/classes/Wc.src/M000006.html +24 -0
- data/doc/created.rid +1 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +53 -0
- data/doc/css/style.css +318 -0
- data/doc/file.README.html +107 -0
- data/doc/file_list.html +38 -0
- data/doc/files/lib/wc_rb.html +101 -0
- data/doc/fr_class_index.html +27 -0
- data/doc/fr_file_index.html +27 -0
- data/doc/fr_method_index.html +32 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +107 -0
- data/doc/js/app.js +203 -0
- data/doc/js/full_list.js +149 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +99 -0
- data/doc/rdoc-style.css +208 -0
- data/doc/top-level-namespace.html +90 -0
- data/lib/wc.rb +21 -128
- data/lib/wc/engine.rb +18 -0
- data/lib/wc/reader.rb +28 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/wc_spec.rb +10 -0
- data/wc.gemspec +65 -30
- metadata +111 -82
- data/.gitignore +0 -21
- data/test/helper.rb +0 -10
- data/test/test_wc.rb +0 -7
data/doc/_index.html
ADDED
@@ -0,0 +1,138 @@
|
|
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>Documentation by YARD 0.6.8</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
|
+
|
27
|
+
<span class="title"></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"><h1 class="noborder title">Documentation by YARD 0.6.8</h1>
|
45
|
+
<div id="listing">
|
46
|
+
<h1 class="alphaindex">Alphabetic Index</h1>
|
47
|
+
|
48
|
+
<h2>File Listing</h2>
|
49
|
+
<ul id="files">
|
50
|
+
|
51
|
+
|
52
|
+
<li class="r1"><a href="index.html" title="README">README</a></li>
|
53
|
+
|
54
|
+
|
55
|
+
</ul>
|
56
|
+
|
57
|
+
<div class="clear"></div>
|
58
|
+
<h2>Namespace Listing A-Z</h2>
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<table>
|
64
|
+
<tr>
|
65
|
+
<td valign='top' width="33%">
|
66
|
+
|
67
|
+
|
68
|
+
<ul id="alpha_E" class="alpha">
|
69
|
+
<li class="letter">E</li>
|
70
|
+
<ul>
|
71
|
+
|
72
|
+
<li>
|
73
|
+
<span class='object_link'><a href="Wc/Engine.html" title="Wc::Engine (class)">Engine</a></span>
|
74
|
+
|
75
|
+
<small>(Wc)</small>
|
76
|
+
|
77
|
+
</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
</ul>
|
81
|
+
|
82
|
+
|
83
|
+
<ul id="alpha_R" class="alpha">
|
84
|
+
<li class="letter">R</li>
|
85
|
+
<ul>
|
86
|
+
|
87
|
+
<li>
|
88
|
+
<span class='object_link'><a href="Wc/Reader.html" title="Wc::Reader (class)">Reader</a></span>
|
89
|
+
|
90
|
+
<small>(Wc)</small>
|
91
|
+
|
92
|
+
</li>
|
93
|
+
|
94
|
+
</ul>
|
95
|
+
</ul>
|
96
|
+
|
97
|
+
|
98
|
+
<ul id="alpha_S" class="alpha">
|
99
|
+
<li class="letter">S</li>
|
100
|
+
<ul>
|
101
|
+
|
102
|
+
<li>
|
103
|
+
<span class='object_link'><a href="String.html" title="String (class)">String</a></span>
|
104
|
+
|
105
|
+
</li>
|
106
|
+
|
107
|
+
</ul>
|
108
|
+
</ul>
|
109
|
+
|
110
|
+
|
111
|
+
<ul id="alpha_W" class="alpha">
|
112
|
+
<li class="letter">W</li>
|
113
|
+
<ul>
|
114
|
+
|
115
|
+
<li>
|
116
|
+
<span class='object_link'><a href="Wc.html" title="Wc (module)">Wc</a></span>
|
117
|
+
|
118
|
+
</li>
|
119
|
+
|
120
|
+
</ul>
|
121
|
+
</ul>
|
122
|
+
|
123
|
+
</td>
|
124
|
+
</tr>
|
125
|
+
</table>
|
126
|
+
|
127
|
+
</div>
|
128
|
+
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<div id="footer">
|
132
|
+
Generated on Tue Jul 5 09:22:52 2011 by
|
133
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
134
|
+
0.6.8 (ruby-1.9.2).
|
135
|
+
</div>
|
136
|
+
|
137
|
+
</body>
|
138
|
+
</html>
|
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><span class='object_link'><a href="top-level-namespace.html" title=" (root)">Top Level Namespace</a></span></li>
|
30
|
+
<li><span class='object_link'><a href="String.html" title="String (class)">String</a></span> < Object<small class='search_info'>Top Level Namespace</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Wc.html" title="Wc (module)">Wc</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><span class='object_link'><a href="Wc/Engine.html" title="Wc::Engine (class)">Engine</a></span> < Object<small class='search_info'>Wc</small></li><li><span class='object_link'><a href="Wc/Reader.html" title="Wc::Reader (class)">Reader</a></span> < Object<small class='search_info'>Wc</small></li></ul>
|
31
|
+
|
32
|
+
</ul>
|
33
|
+
</div>
|
34
|
+
</body>
|
35
|
+
</html>
|
36
|
+
|
data/doc/classes/Wc.html
ADDED
@@ -0,0 +1,279 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Wc</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Wc</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/wc_rb.html">
|
59
|
+
lib/wc.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000005">feed</a>
|
90
|
+
<a href="#M000006">get</a>
|
91
|
+
<a href="#M000001">new</a>
|
92
|
+
<a href="#M000004">read</a>
|
93
|
+
<a href="#M000003">to_cloud</a>
|
94
|
+
<a href="#M000002">to_text</a>
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
<!-- if includes -->
|
102
|
+
|
103
|
+
<div id="section">
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<div id="attribute-list">
|
110
|
+
<h3 class="section-bar">Attributes</h3>
|
111
|
+
|
112
|
+
<div class="name-list">
|
113
|
+
<table>
|
114
|
+
<tr class="top-aligned-row context-row">
|
115
|
+
<td class="context-item-name">css</td>
|
116
|
+
<td class="context-item-value"> [R] </td>
|
117
|
+
<td class="context-item-desc"></td>
|
118
|
+
</tr>
|
119
|
+
<tr class="top-aligned-row context-row">
|
120
|
+
<td class="context-item-name">css_mode</td>
|
121
|
+
<td class="context-item-value"> [R] </td>
|
122
|
+
<td class="context-item-desc"></td>
|
123
|
+
</tr>
|
124
|
+
<tr class="top-aligned-row context-row">
|
125
|
+
<td class="context-item-name">filename</td>
|
126
|
+
<td class="context-item-value"> [R] </td>
|
127
|
+
<td class="context-item-desc"></td>
|
128
|
+
</tr>
|
129
|
+
<tr class="top-aligned-row context-row">
|
130
|
+
<td class="context-item-name">hide_list</td>
|
131
|
+
<td class="context-item-value"> [RW] </td>
|
132
|
+
<td class="context-item-desc"></td>
|
133
|
+
</tr>
|
134
|
+
<tr class="top-aligned-row context-row">
|
135
|
+
<td class="context-item-name">no_autorun</td>
|
136
|
+
<td class="context-item-value"> [R] </td>
|
137
|
+
<td class="context-item-desc"></td>
|
138
|
+
</tr>
|
139
|
+
<tr class="top-aligned-row context-row">
|
140
|
+
<td class="context-item-name">occurrences</td>
|
141
|
+
<td class="context-item-value"> [R] </td>
|
142
|
+
<td class="context-item-desc"></td>
|
143
|
+
</tr>
|
144
|
+
<tr class="top-aligned-row context-row">
|
145
|
+
<td class="context-item-name">words</td>
|
146
|
+
<td class="context-item-value"> [R] </td>
|
147
|
+
<td class="context-item-desc"></td>
|
148
|
+
</tr>
|
149
|
+
</table>
|
150
|
+
</div>
|
151
|
+
</div>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<!-- if method_list -->
|
156
|
+
<div id="methods">
|
157
|
+
<h3 class="section-bar">Public Class methods</h3>
|
158
|
+
|
159
|
+
<div id="method-M000001" class="method-detail">
|
160
|
+
<a name="M000001"></a>
|
161
|
+
|
162
|
+
<div class="method-heading">
|
163
|
+
<a href="Wc.src/M000001.html" target="Code" class="method-signature"
|
164
|
+
onclick="popupCode('Wc.src/M000001.html');return false;">
|
165
|
+
<span class="method-name">new</span><span class="method-args">(filename=nil, options={})</span>
|
166
|
+
</a>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<div class="method-description">
|
170
|
+
<p>
|
171
|
+
Creates a <a href="Wc.html#M000001">new</a> <a href="Wc.html">Wc</a> object
|
172
|
+
</p>
|
173
|
+
<p>
|
174
|
+
The filename is no mandatory, but if provided it will be used to <a
|
175
|
+
href="Wc.html#M000005">feed</a> thw word counter gem, otherwise standard
|
176
|
+
input is used. Options is an array customizing the gem‘s behavior
|
177
|
+
further.
|
178
|
+
</p>
|
179
|
+
</div>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
183
|
+
|
184
|
+
<div id="method-M000005" class="method-detail">
|
185
|
+
<a name="M000005"></a>
|
186
|
+
|
187
|
+
<div class="method-heading">
|
188
|
+
<a href="Wc.src/M000005.html" target="Code" class="method-signature"
|
189
|
+
onclick="popupCode('Wc.src/M000005.html');return false;">
|
190
|
+
<span class="method-name">feed</span><span class="method-args">(line)</span>
|
191
|
+
</a>
|
192
|
+
</div>
|
193
|
+
|
194
|
+
<div class="method-description">
|
195
|
+
</div>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
<div id="method-M000006" class="method-detail">
|
199
|
+
<a name="M000006"></a>
|
200
|
+
|
201
|
+
<div class="method-heading">
|
202
|
+
<a href="Wc.src/M000006.html" target="Code" class="method-signature"
|
203
|
+
onclick="popupCode('Wc.src/M000006.html');return false;">
|
204
|
+
<span class="method-name">get</span><span class="method-args">()</span>
|
205
|
+
</a>
|
206
|
+
</div>
|
207
|
+
|
208
|
+
<div class="method-description">
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
<div id="method-M000004" class="method-detail">
|
213
|
+
<a name="M000004"></a>
|
214
|
+
|
215
|
+
<div class="method-heading">
|
216
|
+
<a href="Wc.src/M000004.html" target="Code" class="method-signature"
|
217
|
+
onclick="popupCode('Wc.src/M000004.html');return false;">
|
218
|
+
<span class="method-name">read</span><span class="method-args">(filename)</span>
|
219
|
+
</a>
|
220
|
+
</div>
|
221
|
+
|
222
|
+
<div class="method-description">
|
223
|
+
</div>
|
224
|
+
</div>
|
225
|
+
|
226
|
+
<div id="method-M000003" class="method-detail">
|
227
|
+
<a name="M000003"></a>
|
228
|
+
|
229
|
+
<div class="method-heading">
|
230
|
+
<a href="Wc.src/M000003.html" target="Code" class="method-signature"
|
231
|
+
onclick="popupCode('Wc.src/M000003.html');return false;">
|
232
|
+
<span class="method-name">to_cloud</span><span class="method-args">()</span>
|
233
|
+
</a>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
<div class="method-description">
|
237
|
+
<p>
|
238
|
+
def to_json
|
239
|
+
</p>
|
240
|
+
<pre>
|
241
|
+
if @words == -1
|
242
|
+
return @sorted.to_json
|
243
|
+
else
|
244
|
+
return @sorted[0..@words-1].to_json
|
245
|
+
end
|
246
|
+
</pre>
|
247
|
+
<p>
|
248
|
+
end
|
249
|
+
</p>
|
250
|
+
</div>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<div id="method-M000002" class="method-detail">
|
254
|
+
<a name="M000002"></a>
|
255
|
+
|
256
|
+
<div class="method-heading">
|
257
|
+
<a href="Wc.src/M000002.html" target="Code" class="method-signature"
|
258
|
+
onclick="popupCode('Wc.src/M000002.html');return false;">
|
259
|
+
<span class="method-name">to_text</span><span class="method-args">()</span>
|
260
|
+
</a>
|
261
|
+
</div>
|
262
|
+
|
263
|
+
<div class="method-description">
|
264
|
+
</div>
|
265
|
+
</div>
|
266
|
+
|
267
|
+
|
268
|
+
</div>
|
269
|
+
|
270
|
+
|
271
|
+
</div>
|
272
|
+
|
273
|
+
|
274
|
+
<div id="validator-badges">
|
275
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
276
|
+
</div>
|
277
|
+
|
278
|
+
</body>
|
279
|
+
</html>
|