public
Description: Extras for DataMapper, including bridges to DataObjects::Migrations and Merb::DataMapper
Homepage: http://datamapper.org
Clone URL: git://github.com/sam/dm-more.git

Comments for sam's dm-more   feed

mattetti commented on sam/dm-more Mon Jan 26 22:39:27 -0800 2009
Comment in ac19b7b:

This actually causes a major issue for Windows users as bcrypt-ruby doesn’t have a Windows version of the gem.

- Matt

dkubb commented on sam/dm-more Fri Jan 16 09:00:27 -0800 2009
Comment in 6b8eb59:

I would suggest making the part of the spec where you check stuff like “@mj.height.should == 0.0” with “@mj.should be_valid” into a separate “it” block. The state of the attribute is a separate observable fact from the object being valid.

gcampbell commented on sam/dm-more Sun Jan 11 16:58:15 -0800 2009
Comment in e1cb5a2:

I’ve sent a pull request for a commit that cleans this up a bit to avoid the regex match; see http://github.com/gcampbell/dm-more/commit/b7128768cf9649f11b477f7ba1107869b742a800

dkubb commented on sam/dm-more Sun Jan 11 01:28:37 -0800 2009
Comment in e1cb5a2:

@gotfat: duh. sorry it’s late here. I see now what the intention was. I agree with your suggestion.

In general matching on .* seems a bit dangerous. I would suggest using something like your suggestion, perhaps even with ^ or \A at the beginning of the regexp to anchor the match to tbe beginning of the string.

A nicer solution would be to see if nokogiri and libxml can skip producing a prologue. If there’s no supported option now, perhaps it’s something we could request?

godfat commented on sam/dm-more Sat Jan 10 23:39:24 -0800 2009
Comment in e1cb5a2:

I thought it was stripping:

<?xml version=“1.0” encoding=“UTF-8”?>
or friends, but it didn’t really strip it. If it was that case, perhaps:
sub(/<\?.*?\?>/
would be better.

dkubb commented on sam/dm-more Sat Jan 10 23:25:11 -0800 2009
Comment on dm-serializer/lib/dm-serializer/xml_serializers/libxml.rb L28 in e1cb5a2:

If your intention is to strip off all trailing whitespace just use String#rstrip.

dkubb commented on sam/dm-more Sat Jan 10 10:10:13 -0800 2009
Comment in ac19b7b:

Actually, I’m responsible for converting dm-types to use autoload, but as the merb guys have discovered, autoload isn’t thread safe, so I’m not sure if it will remain that way forever.

I suppose it’s good to question the likelihood that two threads will be defining models at the same time, thus requiring thread safety. I’m not sure, but I think it’s worth discussing (perhaps on the mailing list?).

At the same time, with us wanting to target JRuby in a future release, this may cause problems for us. Is there a way to say that bcrypt-ruby should only be a dependency for MRI?

benburkert commented on sam/dm-more Sat Jan 10 09:01:02 -0800 2009
Comment in ac19b7b:

I don’t think bcrypt-ruby should be a dependency b/c it’ got c extensions. It’s protected by an autoload, so if you don’t use an encrypted type, it will never try to require bcrypt.

eclubb commented on sam/dm-more Wed Jan 07 12:12:50 -0800 2009
Comment in 99ac07f:

This spec passes on my system without the pending wrapper. Did it fail on yours? With the wrapper I get a blue F with the following error message:

‘DataMapper::Validate::ValidatesWithBlock should validate via a block on the resource’ FIXED Expected pending ‘Fix error conetxt name’ to fail. No Error was raised.

dkubb commented on sam/dm-more Sun Jan 04 22:19:13 -0800 2009
Comment in 7bacfb5:

If it’s in the repository I’d like to package it into the gem. I don’t want to have any exceptions where someone always has to remember to exclude certain files when they run check_manifest prior to releasing the gem. It’s hard enough keeping track of ~30 gems, nevermind what they might include or exclude.

xaviershay commented on sam/dm-more Sun Jan 04 21:45:08 -0800 2009
Comment in 7bacfb5:

benchmarks are a bit hacky, are they really needed in the gem?

gcampbell commented on sam/dm-more Sat Jan 03 07:39:57 -0800 2009
Comment in 28e28af:

Yes, those benchmarks match what I was seeing as well – that’s why I put LibXML ahead of Nokogiri on the “fallback order” list.

xaviershay commented on sam/dm-more Fri Jan 02 13:35:25 -0800 2009
Comment in 28e28af:

Nokogiri is a fraction slower but they’re the same order of magnitude


REXML
Running the benchmarks 2000 times each...

                               Results |
----------------------------------------
Serialization: Single Resource    2.75 |
                    Collection    3.48 |
----------------------------------------
Nokogiri
Running the benchmarks 2000 times each...

                               Results |
----------------------------------------
Serialization: Single Resource    0.55 |
                    Collection    0.99 |
----------------------------------------
Running the benchmarks 2000 times each...

                               Results |
----------------------------------------
Serialization: Single Resource    0.46 |
                    Collection    0.87 |
----------------------------------------
dkubb commented on sam/dm-more Fri Jan 02 13:24:49 -0800 2009
Comment in 28e28af:

What’s the speed difference between LibXML and Nokogiri?

dkubb commented on sam/dm-more Wed Dec 31 23:46:37 -0800 2008
Comment in 931887a:

Hehe, we should probably rename the module to Timestamps, and alias that back to Timestamp. I wasn’t aware of the naming inconsistency between the module and the gem name.

dkubb commented on sam/dm-more Sun Dec 28 20:22:13 -0800 2008
Comment in 89b179c:

Ahh interesting. I could swear I tested this once and it returns an empty Array. I will fix the code since I don’t like iterating over an Array of nil values like that.

xaviershay commented on sam/dm-more Sun Dec 28 19:09:17 -0800 2008
Comment in 89b179c:
>> [(1 if false), (2 if false)]
=> [nil, nil]

I seem to remember there was a good reason for the rescue, but I can’t recall now. Hoping it wasn’t laziness :(

It’s not a big deal – the code is clear.

dkubb commented on sam/dm-more Sun Dec 28 19:05:17 -0800 2008
Comment in 89b179c:

Since the “if” condition code is wrapped up in parenthesis, if none of the Proxy classes are defined (as in dkubb/dm-core) the Array should be empty, so the each call would never iterate over anything.

I’m not sure why there’s a rescue there though. I think it would probably be better to write it so that it only undefined the method if it existed.

xaviershay commented on sam/dm-more Sun Dec 28 07:51:30 -0800 2008
Comment in 89b179c:

to be “correct” I think the array needs to be compacted, nil.send(:undef_method) just raises (and is caught).

benburkert commented on sam/dm-more Tue Dec 23 17:29:36 -0800 2008
Comment in bfc727c:

+1 for bernerd’s change.