[ANN] uri-relative 0.0.1

M

MenTaLguY

--=-Q9j/ykq4igXLmYTNUeWU
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

So, okay, guys. I'm trying to get better about this release early/often
thing.

Here is what I made today:

=3D=3D WHAT IS IT?

uri-relative is a small gem which embellishes URI::Generic with a few
useful methods: URI::Generic#normalize (and normalize!),
URI::Generic#resolve, and URI::Generic#relativize.

- normalize compresses those /./ and /../ bits in your paths

- resolve uses one URI as reference to convert another URI
from relative to absolute (per RFC 2396)

- relativize will do the reverse, taking a URI from absolute
to relative (per... Java-URI I guess)

Keen Java-ists may note a certain similarity to what's offered by Java's
URI class. It's not entirely accidental. But mainly I just needed to
do some of that same sort of URI manipulation in Ruby and nobody could
point me to any libraries to do it.

All pyramids look alike.

=3D=3D IS IT DONE YET?

Well, I think the coding part is basically done. I just need to
implement URI::Generic#relativize and write documentation.

=3D=3D WHERE DO I GET IT?

I'll have a rubyforge project set up sooner or later. Like, after I
implement URI::Generic#relativize.

In the meantime, there is a tiny embittered stump of a website here:

http://moonbase.rydia.net/software/uri-relative/

But really I would only bother with the gem and/or tarball:

http://moonbase.rydia.net/software/uri-relative/uri-relative-0.0.1.gem

http://moonbase.rydia.net/software/uri-relative/uri-relative-0.0.1.tgz



--=-Q9j/ykq4igXLmYTNUeWU
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBFTZGSSuZBmZzm14ERAuWQAJwMlW/uMeBOW9QUYkudUCPCtG6i/wCghfkK
fIdu10cZPSw26fcTTCqTFIs=
=Zeb7
-----END PGP SIGNATURE-----

--=-Q9j/ykq4igXLmYTNUeWU--
 
M

MenTaLguY

--=-N+R+99xlMPBPWgHW7yhd
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hah! Well, I feel dumb. URI::Generic#merge and URI::Generic#route_to
do precisely the same thing as my own methods. And they're the
practically the only rdoc'd methods in URI::Generic, too. Should have
stuck out like a sore thumb.

So ... that leaves URI::Generic#normalize, I think. Anyone have a use
for it?

-mental

--=-N+R+99xlMPBPWgHW7yhd
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBFTlhsSuZBmZzm14ERAsoxAKCj8h005liGuJRpKfYY8iFMLPLeaQCdFYlU
185gthTuExHPLqB3E0x8lz8=
=gakg
-----END PGP SIGNATURE-----

--=-N+R+99xlMPBPWgHW7yhd--
 
M

MenTaLguY

--=-4agDIVmYNZcgWLB7XCHJ
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Briefly, I've dropped my own resolution and relativization methods in
favor of the existing ones in URI::Generic. So, uri-relative is now
simply a library that adds a Java-esque 'normalize' method and some
aliases to Ruby's URI::Generic.

The project page (such as it is) is here:

http://moonbase.rydia.net/software/uri-generic/

Are there any other useful things which are actually missing? Or have I
also missed some obvious way to do normalization with stock
URI::Generic?

(By the way: here's the funny part: I was actually calling
URI::Generic#merge as part of my URI::Generic#resolve, without realizing
its full functionality! I suppose that at least I can say that
implementing my own resolve and relativize methods was a useful learning
exercise...)

-mental

--=-4agDIVmYNZcgWLB7XCHJ
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBFTl2OSuZBmZzm14ERAtBwAJ44l9JB7dR56Vc6pKTGHi3M+aurdACfbr3N
mNSRsvsCmLcXCBw4IwMgDmQ=
=ErtT
-----END PGP SIGNATURE-----

--=-4agDIVmYNZcgWLB7XCHJ--
 

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


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top