clojure-clutch / clutch

A Clojure library for Apache CouchDB.
Other
224 stars 37 forks source link

clutch.utils/url default port not 5984 anymore #67

Closed dehubbed closed 11 years ago

dehubbed commented 12 years ago

apart from issue #64 the move to cemerick.url broke clutch.utils/url even more: previously the default port when not given was 5984, now this has to be explicitly specified

p.s. what's that with people's names in namespace names, that's seriously uncool

cemerick commented 11 years ago

Looks good to me?

=> (str (com.ashafa.clutch.utils/url "database_name"))
"http://localhost:5984/database_name"

BTW, "Ashafa" is someone's name, just like "cemerick" is (sorta). It's just a maven groupId / Clojure namespace.

dehubbed commented 11 years ago

It works for localhost but not other hosts.

cemerick commented 11 years ago

So you want (str (com.ashafa.clutch.utils/url "http://hostname/database_name")) => "http://hostname:5984/database_name"?

dehubbed commented 11 years ago

P.S. in the clojure community I know no other groupIds/namespaces (other than ashafa and cemerick) that have people's names in it.

dehubbed commented 11 years ago

yes that's what it did in clutch before. I'm cool with the change but the ideas is to not break existing code normally.

cemerick commented 11 years ago

As long as the rev is < 1.0.0, breakage is possible (and generally noted here). In this case, the new behaviour is preferable IMO; if you're providing a base URL, then I think you should be trusted to be providing a full base URL. Especially if the URL is https, then bashing in 5984 when a port isn't specified is not helpful.

There are other names-as-groupIds, in the Clojure world and elsewhere. It's convenient, and IMO better than antipatterns like ring/ring, etc.

dehubbed commented 11 years ago

ok