Top Level Namespace
Defined Under Namespace
Modules: Pedia
Classes: Article, Downloader, Webserver, Wiki, WikiParser, XMLReader
Instance Method Summary
collapse
Instance Method Details
#bz2_stream(thing, offset = nil, length = nil) ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/wp/wiki.rb', line 8
def bz2_stream(thing, offset=nil, length=nil)
require 'open3'
open(thing, "rb") do |bz2|
Open3.popen2("bunzip2", "-c") do |inp, outp, th|
Thread.new do
IO.copy_stream(bz2, inp, length, offset)
inp.close
end
yield outp
end
end
end
|
#commatize(thing) ⇒ Object
6
7
8
|
# File 'lib/wp.rb', line 6
def commatize(thing)
thing.to_s.reverse.each_slice(3).to_a.join(",").reverse
end
|
#console_viewer(html) ⇒ Object
23
24
25
26
27
28
|
# File 'lib/wp.rb', line 23
def console_viewer(html)
IO.popen("lynx -stdin", "w") do |lynx|
lynx.puts html end
end
|