[ANN] Net::DICT 0.9.0

N

Nikolai Weibull

(WARNING: This is a lazy-pants announcement. All I=E2=80=99ve done is
:r doc/README and added a couple of headings.)

Net::DICT README
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Introduction
------------

Net::DICT is a library for Ruby that implements the client-side of the
Dictionary Server Protocol (DICT), described in
http://ietf.org/rfc/rfc2229.txt[RFC2229]. Documentation of the project
is provided in RDoc form, and can be generated by running the
`doc`-target of the Rakefile.

Authors
-------

Nikolai Weibull <[email protected]>

News
----

0.9.0
~~~~~

Initial release.

Download
--------

A gem can (temporarily) be found at http://bitwi.se/net-dict-0.9.0.gem
You can also git the source at http://git.bitwi.se/

Examples
--------

A couple of examples follow.

Define a word:

require 'net/dict'

dict =3D Net::DICT.new('dict.org')
dict.client =3D 'Ruby-Net::DICT example'
puts dict.define('ruby', 'foldoc')[0]
dict.disconnect

Define a word using a pipeline (less traffic):

require 'net/dict'

dict =3D Net::DICT.new
definitions, _ =3D dict.pipeline do
dict.connect('dict.org')
dict.client =3D 'Ruby-Net::DICT pipeline example'
dict.define('ruby', 'foldoc')
dict.disconnect
end
puts definitions[0]

Get a list of databases on the server using a session (execute a
pipeline):

require 'net/dict'
=20
dbs, _ =3D Net::DICT.session('Ruby-Net::DICT db example', 'dict.org') d=
o |dict|
dict.databases
end
dbs.each{ |db, description| puts "#{db}: #{description}" }

Net::DICT also integrates with the URI and open-uri libraries:

require 'net/dict'
require 'uri/dict'
require 'open-uri'

open('dict://dict.org/d:word'){ |file| puts file.read }

A dict client using this library is being written, but nothing=E2=80=99s
stopping you from writing your own in the meantime ;-).

nikolai

--=20
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

[ANN] My dependency-injection library 2
[ANN] Sipper 2.0.0 Released 1
[ANN] open4-0.9.0 0
[ANN] Gecode/R 0.9.0 1
[ANN] traits-0.9.0 3
[ANN] httpclient/2.1.6 0
net/http broken? 7
[ANN] dirwatch-0.9.0 4

Members online

Forum statistics

Threads
474,266
Messages
2,571,073
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top