wc 0.98.2 → 0.99.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "rspec", "~> 2.3.0"
10
+ gem "yard", "~> 0.6.0"
11
+ gem "bundler", "~> 1.0.0"
12
+ gem "jeweler", "~> 1.6.2"
13
+ gem "rcov", ">= 0"
14
+ end
@@ -0,0 +1,30 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.1.2)
5
+ git (1.2.5)
6
+ jeweler (1.6.2)
7
+ bundler (~> 1.0)
8
+ git (>= 1.2.5)
9
+ rake
10
+ rake (0.9.2)
11
+ rcov (0.9.9)
12
+ rspec (2.3.0)
13
+ rspec-core (~> 2.3.0)
14
+ rspec-expectations (~> 2.3.0)
15
+ rspec-mocks (~> 2.3.0)
16
+ rspec-core (2.3.1)
17
+ rspec-expectations (2.3.0)
18
+ diff-lcs (~> 1.1.2)
19
+ rspec-mocks (2.3.0)
20
+ yard (0.6.8)
21
+
22
+ PLATFORMS
23
+ ruby
24
+
25
+ DEPENDENCIES
26
+ bundler (~> 1.0.0)
27
+ jeweler (~> 1.6.2)
28
+ rcov
29
+ rspec (~> 2.3.0)
30
+ yard (~> 0.6.0)
@@ -1,25 +1,21 @@
1
1
  = wc
2
2
 
3
- wc gem is a very simple word counter. It takes a file in input and prints the words occurences.
3
+ wc is a rubygem to count word occurrences in a given text.
4
4
 
5
- == Usage
5
+ *NEWS*
6
+ This is a major rewrite since version 0.98.2 and the API is completely rewritten from scratch.
7
+ The expected behavior is to let wc gem to extend a plain ruby String object and use it to retrieve tag cloud.
8
+ Please note that reading words from a file will be removed in further releases.
6
9
 
7
- $ bin/wc filename
8
-
9
- This is the very basic wc usage. It reads filename and it prints out a sorted
10
- array for the word occurrences they have been found.
11
10
 
12
- $ bin/wc --json filename
13
- The same as the example above, except for the results that are printed in json notation.
11
+ == Usage
14
12
 
15
- $bin/wc -w x filename
16
- It prints out only the first x words that appear with highest rate in filename
13
+ Using wc is easy. Just require the gem and use the to_tag_cloud method to the
14
+ string containing the text you want to transform in a tag cloud
17
15
 
18
- $bin/wc --cloud filename
19
- It prints out the result using definition list HTML tag. This can be used to generate tag clouds
16
+ require 'wc'
20
17
 
21
- $bin/wc -H filename
22
- It prints out the result excluding some very common English idioms such as ('and', 'of', 'the', ...)
18
+ "A text longer is here".to_tag_cloud ~> "<ul id=\"cloud\"><li><a href=\"#\" class=\"tag0\">text</a></li><li><a href=\"#\" class=\"tag0\">longer</a></li><li><a href=\"#\" class=\"tag0\">here</a></li></ul>"
23
19
 
24
20
  == Note on Patches/Pull Requests
25
21
 
@@ -33,4 +29,4 @@ wc gem is a very simple word counter. It takes a file in input and prints the wo
33
29
 
34
30
  == Copyright
35
31
 
36
- Copyright (c) 2010 Paolo Perego. See LICENSE for details.
32
+ Copyright (c) 2011 Paolo Perego. See LICENSE for details.
data/Rakefile CHANGED
@@ -1,59 +1,44 @@
1
- require 'rubygems'
2
- require 'rake'
1
+ # encoding: utf-8
3
2
 
3
+ require 'rubygems'
4
+ require 'bundler'
4
5
  begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "wc"
8
- gem.summary = "your ruby word counter experience"
9
- gem.description = "your ruby word counter experience"
10
- gem.email = "thesp0nge@gmail.com"
11
- gem.homepage = "http://github.com/thesp0nge/wc"
12
- gem.authors = ["Paolo Perego"]
13
- gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
14
- # gem.add_development_dependency "getoptlong", ">=0"
15
- gem.add_development_dependency "builder", ">=2.1.2"
16
- gem.add_development_dependency "json_pure", ">=1.4.3"
17
-
18
- # gem.add_dependency "json_pure", ">=1.4.3"
19
-
20
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
21
- end
22
- Jeweler::GemcutterTasks.new
23
- rescue LoadError
24
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
25
11
  end
12
+ require 'rake'
26
13
 
27
- require 'rake/testtask'
28
- Rake::TestTask.new(:test) do |test|
29
- test.libs << 'lib' << 'test'
30
- test.pattern = 'test/**/test_*.rb'
31
- test.verbose = true
32
- end
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "wc"
18
+ gem.summary = "your ruby word counter experience"
19
+ gem.description = "your ruby word counter experience"
20
+ gem.email = "thesp0nge@gmail.com"
21
+ gem.homepage = "http://github.com/thesp0nge/wc"
22
+ gem.authors = ["Paolo Perego"]
33
23
 
34
- begin
35
- require 'rcov/rcovtask'
36
- Rcov::RcovTask.new do |test|
37
- test.libs << 'test'
38
- test.pattern = 'test/**/test_*.rb'
39
- test.verbose = true
40
- end
41
- rescue LoadError
42
- task :rcov do
43
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
44
- end
24
+ gem.license = "new BSD License"
25
+ gem.email = "thesp0nge@gmail.com"
26
+ # dependencies defined in Gemfile
45
27
  end
28
+ Jeweler::RubygemsDotOrgTasks.new
46
29
 
47
- task :test => :check_dependencies
30
+ require 'rspec/core'
31
+ require 'rspec/core/rake_task'
32
+ RSpec::Core::RakeTask.new(:spec) do |spec|
33
+ spec.pattern = FileList['spec/**/*_spec.rb']
34
+ end
48
35
 
49
- task :default => :test
36
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
37
+ spec.pattern = 'spec/**/*_spec.rb'
38
+ spec.rcov = true
39
+ end
50
40
 
51
- require 'rake/rdoctask'
52
- Rake::RDocTask.new do |rdoc|
53
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
41
+ task :default => :spec
54
42
 
55
- rdoc.rdoc_dir = 'rdoc'
56
- rdoc.title = "wc #{version}"
57
- rdoc.rdoc_files.include('README*')
58
- rdoc.rdoc_files.include('lib/**/*.rb')
59
- end
43
+ require 'yard'
44
+ YARD::Rake::YardocTask.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.98.2
1
+ 0.99.0
@@ -0,0 +1,372 @@
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>Class: String</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">Index (S)</a> &raquo;
27
+
28
+
29
+ <span class="title">String</span>
30
+
31
+
32
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
33
+ </div>
34
+
35
+ <div id="search">
36
+ <a id="class_list_link" href="#">Class List</a>
37
+ <a id="method_list_link" href="#">Method List</a>
38
+ <a id ="file_list_link" href="#">File List</a>
39
+ </div>
40
+
41
+ <div class="clear"></div>
42
+ </div>
43
+
44
+ <iframe id="search_frame"></iframe>
45
+
46
+ <div id="content"><h1>Class: String
47
+
48
+
49
+
50
+ </h1>
51
+
52
+ <dl class="box">
53
+
54
+ <dt class="r1">Inherits:</dt>
55
+ <dd class="r1">
56
+ <span class="inheritName">Object</span>
57
+
58
+ <ul class="fullTree">
59
+ <li>Object</li>
60
+
61
+ <li class="next">String</li>
62
+
63
+ </ul>
64
+ <a href="#" class="inheritanceTree">show all</a>
65
+
66
+ </dd>
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+ <dt class="r2 last">Defined in:</dt>
77
+ <dd class="r2 last">lib/wc.rb</dd>
78
+
79
+ </dl>
80
+ <div class="clear"></div>
81
+
82
+
83
+
84
+
85
+
86
+ <h2>
87
+ Instance Method Summary
88
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
89
+ </h2>
90
+
91
+ <ul class="summary">
92
+
93
+ <li class="public ">
94
+ <span class="summary_signature">
95
+
96
+ <a href="#occurrences-instance_method" title="#occurrences (instance method)">- (Object) <strong>occurrences</strong> </a>
97
+
98
+
99
+
100
+ </span>
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+ <span class="summary_desc"><div class='inline'></div></span>
110
+
111
+ </li>
112
+
113
+
114
+ <li class="public ">
115
+ <span class="summary_signature">
116
+
117
+ <a href="#to_tag_cloud-instance_method" title="#to_tag_cloud (instance method)">- (Object) <strong>to_tag_cloud</strong>(max_words = nil) </a>
118
+
119
+
120
+
121
+ </span>
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+ <span class="summary_desc"><div class='inline'></div></span>
131
+
132
+ </li>
133
+
134
+
135
+ <li class="public ">
136
+ <span class="summary_signature">
137
+
138
+ <a href="#wc-instance_method" title="#wc (instance method)">- (Object) <strong>wc</strong> </a>
139
+
140
+
141
+
142
+ </span>
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+ <span class="summary_desc"><div class='inline'></div></span>
152
+
153
+ </li>
154
+
155
+
156
+ </ul>
157
+
158
+
159
+
160
+
161
+ <div id="instance_method_details" class="method_details_list">
162
+ <h2>Instance Method Details</h2>
163
+
164
+
165
+ <div class="method_details first">
166
+ <p class="signature first" id="occurrences-instance_method">
167
+
168
+ - (<tt>Object</tt>) <strong>occurrences</strong>
169
+
170
+
171
+
172
+ </p><table class="source_code">
173
+ <tr>
174
+ <td>
175
+ <pre class="lines">
176
+
177
+
178
+ 9
179
+ 10
180
+ 11</pre>
181
+ </td>
182
+ <td>
183
+ <pre class="code"><span class="info file"># File 'lib/wc.rb', line 9</span>
184
+
185
+ <span class='kw'>def</span> <span class='id occurrences'>occurrences</span>
186
+ <span class='const'>Wc</span><span class='op'>::</span><span class='const'>Engine</span><span class='period'>.</span><span class='id read_inline'>read_inline</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
187
+ <span class='kw'>end</span></pre>
188
+ </td>
189
+ </tr>
190
+ </table>
191
+ </div>
192
+
193
+ <div class="method_details ">
194
+ <p class="signature " id="to_tag_cloud-instance_method">
195
+
196
+ - (<tt>Object</tt>) <strong>to_tag_cloud</strong>(max_words = nil)
197
+
198
+
199
+
200
+ </p><table class="source_code">
201
+ <tr>
202
+ <td>
203
+ <pre class="lines">
204
+
205
+
206
+ 13
207
+ 14
208
+ 15
209
+ 16
210
+ 17
211
+ 18
212
+ 19
213
+ 20
214
+ 21
215
+ 22
216
+ 23
217
+ 24
218
+ 25
219
+ 26
220
+ 27
221
+ 28
222
+ 29
223
+ 30
224
+ 31
225
+ 32
226
+ 33
227
+ 34
228
+ 35
229
+ 36
230
+ 37
231
+ 38
232
+ 39
233
+ 40
234
+ 41
235
+ 42
236
+ 43
237
+ 44
238
+ 45
239
+ 46
240
+ 47
241
+ 48
242
+ 49
243
+ 50
244
+ 51
245
+ 52
246
+ 53
247
+ 54
248
+ 55
249
+ 56
250
+ 57
251
+ 58
252
+ 59
253
+ 60
254
+ 61
255
+ 62
256
+ 63
257
+ 64
258
+ 65
259
+ 66
260
+ 67
261
+ 68
262
+ 69
263
+ 70
264
+ 71</pre>
265
+ </td>
266
+ <td>
267
+ <pre class="code"><span class="info file"># File 'lib/wc.rb', line 13</span>
268
+
269
+ <span class='kw'>def</span> <span class='id to_tag_cloud'>to_tag_cloud</span><span class='lparen'>(</span><span class='id max_words'>max_words</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
270
+
271
+ <span class='id sorted'>sorted</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id occurrences'>occurrences</span>
272
+
273
+ <span class='kw'>if</span> <span class='id max_words'>max_words</span><span class='period'>.</span><span class='id nil?'>nil?</span>
274
+ <span class='id cloud_items'>cloud_items</span> <span class='op'>=</span> <span class='id sorted'>sorted</span>
275
+ <span class='kw'>else</span>
276
+ <span class='id cloud_items'>cloud_items</span> <span class='op'>=</span> <span class='id sorted'>sorted</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='id max_words'>max_words</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span>
277
+ <span class='kw'>end</span>
278
+
279
+ <span class='id max'>max</span> <span class='op'>=</span> <span class='id sorted'>sorted</span><span class='period'>.</span><span class='id first'>first</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
280
+ <span class='id min'>min</span> <span class='op'>=</span> <span class='id sorted'>sorted</span><span class='period'>.</span><span class='id last'>last</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
281
+
282
+ <span class='id range'>range</span> <span class='op'>=</span> <span class='id max'>max</span> <span class='op'>-</span> <span class='id min'>min</span>
283
+ <span class='id interval'>interval</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='float'>1.0</span> <span class='op'>*</span> <span class='id range'>range</span><span class='rparen'>)</span><span class='op'>/</span><span class='int'>10</span>
284
+
285
+ <span class='id r0'>r0</span><span class='op'>=</span><span class='id min'>min</span><span class='op'>+</span><span class='id interval'>interval</span>
286
+ <span class='id r1'>r1</span><span class='op'>=</span><span class='id r0'>r0</span><span class='op'>+</span><span class='id interval'>interval</span>
287
+ <span class='id r2'>r2</span><span class='op'>=</span><span class='id r1'>r1</span><span class='op'>+</span><span class='id interval'>interval</span>
288
+ <span class='id r3'>r3</span><span class='op'>=</span><span class='id r2'>r2</span><span class='op'>+</span><span class='id interval'>interval</span>
289
+ <span class='id r4'>r4</span><span class='op'>=</span><span class='id r3'>r3</span><span class='op'>+</span><span class='id interval'>interval</span>
290
+ <span class='id r5'>r5</span><span class='op'>=</span><span class='id r4'>r4</span><span class='op'>+</span><span class='id interval'>interval</span>
291
+ <span class='id r6'>r6</span><span class='op'>=</span><span class='id r5'>r5</span><span class='op'>+</span><span class='id interval'>interval</span>
292
+ <span class='id r7'>r7</span><span class='op'>=</span><span class='id r6'>r6</span><span class='op'>+</span><span class='id interval'>interval</span>
293
+ <span class='id r8'>r8</span><span class='op'>=</span><span class='id r7'>r7</span><span class='op'>+</span><span class='id interval'>interval</span>
294
+ <span class='id r9'>r9</span><span class='op'>=</span><span class='id r8'>r8</span><span class='op'>+</span><span class='id interval'>interval</span>
295
+ <span class='id r10'>r10</span><span class='op'>=</span><span class='id r9'>r9</span><span class='op'>+</span><span class='id interval'>interval</span>
296
+
297
+ <span class='id ret'>ret</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;ul id=\&quot;cloud\&quot;&gt;</span><span class='tstring_end'>&quot;</span></span>
298
+
299
+ <span class='id cloud_items'>cloud_items</span><span class='period'>.</span><span class='id each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id elem'>elem</span><span class='op'>|</span>
300
+ <span class='kw'>if</span> <span class='lparen'>(</span><span class='id elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='op'>&gt;</span><span class='id r10'>r10</span><span class='rparen'>)</span>
301
+ <span class='id c'>c</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>tag9</span><span class='tstring_end'>&quot;</span></span>
302
+ <span class='kw'>elsif</span> <span class='lparen'>(</span><span class='id elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>&gt;</span> <span class='id r9'>r9</span><span class='rparen'>)</span>
303
+ <span class='id c'>c</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>tag8</span><span class='tstring_end'>&quot;</span></span>
304
+ <span class='kw'>elsif</span> <span class='lparen'>(</span><span class='id elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>&gt;</span> <span class='id r8'>r8</span><span class='rparen'>)</span>
305
+ <span class='id c'>c</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>tag7</span><span class='tstring_end'>&quot;</span></span>
306
+ <span class='kw'>elsif</span> <span class='lparen'>(</span><span class='id elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>&gt;</span> <span class='id r7'>r7</span><span class='rparen'>)</span>
307
+ <span class='id c'>c</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>tag6</span><span class='tstring_end'>&quot;</span></span>
308
+ <span class='kw'>elsif</span> <span class='lparen'>(</span><span class='id elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>&gt;</span> <span class='id r6'>r6</span><span class='rparen'>)</span>
309
+ <span class='id c'>c</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>tag5</span><span class='tstring_end'>&quot;</span></span>
310
+ <span class='kw'>elsif</span> <span class='lparen'>(</span><span class='id elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>&gt;</span> <span class='id r5'>r5</span><span class='rparen'>)</span>
311
+ <span class='id c'>c</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>tag4</span><span class='tstring_end'>&quot;</span></span>
312
+ <span class='kw'>elsif</span> <span class='lparen'>(</span><span class='id elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>&gt;</span> <span class='id r4'>r4</span><span class='rparen'>)</span>
313
+ <span class='id c'>c</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>tag3</span><span class='tstring_end'>&quot;</span></span>
314
+ <span class='kw'>elsif</span> <span class='lparen'>(</span><span class='id elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>&gt;</span> <span class='id r3'>r3</span><span class='rparen'>)</span>
315
+ <span class='id c'>c</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>tag2</span><span class='tstring_end'>&quot;</span></span>
316
+ <span class='kw'>elsif</span> <span class='lparen'>(</span><span class='id elem'>elem</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>&gt;</span> <span class='id r2'>r2</span><span class='rparen'>)</span>
317
+ <span class='id c'>c</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>tag1</span><span class='tstring_end'>&quot;</span></span>
318
+ <span class='kw'>else</span>
319
+ <span class='id c'>c</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>tag0</span><span class='tstring_end'>&quot;</span></span>
320
+ <span class='kw'>end</span>
321
+
322
+ <span class='id ret'>ret</span><span class='op'>+=</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;li&gt;&lt;a href=\&quot;#\&quot; class=\&quot;</span><span class='tstring_end'>&quot;</span></span><span class='op'>+</span><span class='id c'>c</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\&quot;&gt;</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='id elem'>elem</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>+</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;/a&gt;&lt;/li&gt;</span><span class='tstring_end'>&quot;</span></span>
323
+
324
+ <span class='rbrace'>}</span>
325
+ <span class='id ret'>ret</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;/ul&gt;</span><span class='tstring_end'>&quot;</span></span>
326
+ <span class='id ret'>ret</span>
327
+ <span class='kw'>end</span></pre>
328
+ </td>
329
+ </tr>
330
+ </table>
331
+ </div>
332
+
333
+ <div class="method_details ">
334
+ <p class="signature " id="wc-instance_method">
335
+
336
+ - (<tt>Object</tt>) <strong>wc</strong>
337
+
338
+
339
+
340
+ </p><table class="source_code">
341
+ <tr>
342
+ <td>
343
+ <pre class="lines">
344
+
345
+
346
+ 5
347
+ 6
348
+ 7</pre>
349
+ </td>
350
+ <td>
351
+ <pre class="code"><span class="info file"># File 'lib/wc.rb', line 5</span>
352
+
353
+ <span class='kw'>def</span> <span class='id wc'>wc</span>
354
+ <span class='kw'>self</span><span class='period'>.</span><span class='id occurrences'>occurrences</span><span class='period'>.</span><span class='id size'>size</span>
355
+ <span class='kw'>end</span></pre>
356
+ </td>
357
+ </tr>
358
+ </table>
359
+ </div>
360
+
361
+ </div>
362
+
363
+ </div>
364
+
365
+ <div id="footer">
366
+ Generated on Tue Jul 5 09:22:52 2011 by
367
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
368
+ 0.6.8 (ruby-1.9.2).
369
+ </div>
370
+
371
+ </body>
372
+ </html>