Specs Failing on move and copy

3 views
Skip to first unread message

Anthony Eden

unread,
Jan 14, 2009, 8:48:10 PM1/14/09
to couc...@googlegroups.com
I'm trying to run the specs for the latest couchrest code in github
and it's failing for specs that involve move and copy. I looked in the
rest-client and I can't find any references to copy or move. I also
looked in your fork but didn't see it there either. Any suggestions on
how I can get the specs passing?

The reason I want to get the tests passing is because I'm getting a
strange error with ruby 1.8.7 (2008-08-11 patchlevel 72)
[i686-darwin9]:

>> db = CouchRest.database("http://127.0.0.1:5984/account_1-database_1")
=> #<CouchRest::Database:0x2347b94
@streamer=#<CouchRest::Streamer:0x2347b58
@db=#<CouchRest::Database:0x2347b94 ...>>,
@root="127.0.0.1:5984/account_1-database_1", @host="127.0.0.1:5984",
@server=#<CouchRest::Server:0x2347ba8 @uuid_batch_count=1000,
@uri="127.0.0.1:5984">, @name="account_1-database_1">
>> db.get('_design/system')
URI::InvalidURIError: bad URI(is not URI?):
127.0.0.1:5984/account_1-database_1/_design%2Fsystem
from /opt/local/lib/ruby/1.8/uri/common.rb:436:in `split'
from /opt/local/lib/ruby/1.8/uri/common.rb:485:in `parse'
from /Users/aeden/Development/aetrion/ndepth/vendor/gems/rest-client-0.8/lib/rest_client.rb:196:in
`process_result'
from /Users/aeden/Development/aetrion/ndepth/vendor/gems/rest-client-0.8/lib/rest_client.rb:177:in
`transmit'
from /opt/local/lib/ruby/1.8/net/http.rb:543:in `start'
from /Users/aeden/Development/aetrion/ndepth/vendor/gems/rest-client-0.8/lib/rest_client.rb:174:in
`transmit'
from /Users/aeden/Development/aetrion/ndepth/vendor/gems/rest-client-0.8/lib/rest_client.rb:114:in
`execute_inner'
from /Users/aeden/Development/aetrion/ndepth/vendor/gems/rest-client-0.8/lib/rest_client.rb:106:in
`execute'
from /Users/aeden/Development/aetrion/ndepth/vendor/gems/rest-client-0.8/lib/rest_client.rb:93:in
`execute'
from /Users/aeden/Development/aetrion/ndepth/vendor/gems/rest-client-0.8/lib/rest_client.rb:47:in
`get'
from /Users/aeden/Development/aetrion/ndepth/vendor/gems/jchris-couchrest-0.9.12/lib/couchrest.rb:99:in
`get'
from /Users/aeden/Development/aetrion/ndepth/vendor/gems/jchris-couchrest-0.9.12/lib/couchrest/core/database.rb:73:in
`get'
from (irb):5

Any thoughts on either of these issues would be greatly appreciated. Thanks.

Sincerely,
Anthony Eden

--
GMU/IT d- s: a32 C++(++++)$ UL@ P--- L+(++) !E W+++$ !N o? K? w--- !O
M++ V PS+ PE Y PGP t+ !5 X- R tv b++ DI+ D++ G- e++ h---- r+++ y++++**

http://anthony.mp

Chris Anderson

unread,
Jan 14, 2009, 8:54:44 PM1/14/09
to couc...@googlegroups.com
On Wed, Jan 14, 2009 at 5:48 PM, Anthony Eden <antho...@gmail.com> wrote:
>
> I'm trying to run the specs for the latest couchrest code in github
> and it's failing for specs that involve move and copy. I looked in the
> rest-client and I can't find any references to copy or move. I also
> looked in your fork but didn't see it there either. Any suggestions on
> how I can get the specs passing?

I think Matt Lyon has a good RestClient fork. He's also working on a
CouchRest patch to monkeypatch Copy and Move into place.

http://github.com/mattly/rest-client/tree/master

>
> The reason I want to get the tests passing is because I'm getting a
> strange error with ruby 1.8.7 (2008-08-11 patchlevel 72)
> [i686-darwin9]:
>

The Ruby URI class has a dubious relationship with the _ character,
but I thought that was only in hostnames...

Can you reproduce your error by calling URI.parse directly?

It could be some code I added in the last couple of days that ought to
skip encoding the '/' on design docs. Are you on the latest CouchRest?
--
Chris Anderson
http://jchris.mfdz.com

Antony Blakey

unread,
Jan 14, 2009, 8:54:39 PM1/14/09
to couc...@googlegroups.com

On 15/01/2009, at 12:18 PM, Anthony Eden wrote:

>
> I'm trying to run the specs for the latest couchrest code in github
> and it's failing for specs that involve move and copy. I looked in the
> rest-client and I can't find any references to copy or move. I also
> looked in your fork but didn't see it there either. Any suggestions on
> how I can get the specs passing?

There's a comment in this commit:

http://github.com/jchris/couchrest/commit/9faa9daacab151ebd89241cead8cb4261f6b0702

saying that you need a specific version of RestClient that includes
move and copy.

Antony Blakey
-------------
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies.
-- C. A. R. Hoare


Matt Lyon

unread,
Jan 14, 2009, 8:59:07 PM1/14/09
to couc...@googlegroups.com
> I think Matt Lyon has a good RestClient fork. He's also working on a
> CouchRest patch to monkeypatch Copy and Move into place.

the patch will be forthcoming tonight, provided i don't get entangled
in another life-sapping call to zipcar customer service like I did
last night.

fwiw I'm all about things "just working" as much as anyone; i should
have held the patch until I had heard back from adam about
rest-client.

ml

Anthony Eden

unread,
Jan 14, 2009, 9:04:41 PM1/14/09
to couc...@googlegroups.com
On Wed, Jan 14, 2009 at 8:54 PM, Chris Anderson <jch...@apache.org> wrote:
>
> On Wed, Jan 14, 2009 at 5:48 PM, Anthony Eden <antho...@gmail.com> wrote:
>>
>> I'm trying to run the specs for the latest couchrest code in github
>> and it's failing for specs that involve move and copy. I looked in the
>> rest-client and I can't find any references to copy or move. I also
>> looked in your fork but didn't see it there either. Any suggestions on
>> how I can get the specs passing?
>
> I think Matt Lyon has a good RestClient fork. He's also working on a
> CouchRest patch to monkeypatch Copy and Move into place.
>
> http://github.com/mattly/rest-client/tree/master

Thanks, I'll give this rest-client a try.

>>
>> The reason I want to get the tests passing is because I'm getting a
>> strange error with ruby 1.8.7 (2008-08-11 patchlevel 72)
>> [i686-darwin9]:
>>
>
> The Ruby URI class has a dubious relationship with the _ character,
> but I thought that was only in hostnames...
>
> Can you reproduce your error by calling URI.parse directly?

irb(main):004:0>
URI::parse('http://127.0.0.1:5984/account_1-database_1/_design%2Fsystem')
=> #<URI::HTTP:0x596f14
URL:http://127.0.0.1:5984/account_1-database_1/_design%2Fsystem>
irb(main):005:0>
URI::parse('127.0.0.1:5984/account_1-database_1/_design%2Fsystem')
URI::InvalidURIError: bad URI(is not URI?):
127.0.0.1:5984/account_1-database_1/_design%2Fsystem

It looks like the http:// is being stripped from the full URI I
provided when calling CouchRest.database().

>
> It could be some code I added in the last couple of days that ought to
> skip encoding the '/' on design docs. Are you on the latest CouchRest?

I'm on the 0.9.12 release, not on the head.

Chris Anderson

unread,
Jan 14, 2009, 9:17:42 PM1/14/09
to couc...@googlegroups.com
There a new 0.12.something gem out now - it may break a few things,
but hopefully nothing major. You'll want to upgrade Couch alongside
it, also...

It won't be hard to keep up with Couch once we get to 1.0. Now, of
course, we want it to move as fast as possible.

Anthony Eden

unread,
Jan 14, 2009, 9:26:36 PM1/14/09
to couc...@googlegroups.com
On Wed, Jan 14, 2009 at 9:17 PM, Chris Anderson <jch...@apache.org> wrote:
>
> On Wed, Jan 14, 2009 at 6:04 PM, Anthony Eden <antho...@gmail.com> wrote:
>>
>> I'm on the 0.9.12 release, not on the head.
>
> There a new 0.12.something gem out now - it may break a few things,
> but hopefully nothing major. You'll want to upgrade Couch alongside
> it, also...
>
> It won't be hard to keep up with Couch once we get to 1.0. Now, of
> course, we want it to move as fast as possible.

Upgrading to the latest gem solved the issue I was having with the URI, thanks.

Matt Lyon

unread,
Jan 16, 2009, 4:12:12 AM1/16/09
to couc...@googlegroups.com
So since I'm not sure if Adam is going to accept my patch for
copy/move support into rest-client I went ahead and added a
monkeypatch for those http verbs into couchrest. A pull request has
been sent to jchris. I also added move/copy methods to
CouchRest::Document.

Chris Anderson

unread,
Jan 16, 2009, 3:42:37 PM1/16/09
to couc...@googlegroups.com
Merged! Thanks Matt
Reply all
Reply to author
Forward
0 new messages