------art_43225_24202216.1156977476917
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Brian pointed out that I'd missed the spec and was hypenating two day
runs instead of the minimum run called for.

So, I've updated my solution to fix this, and keeping with the spirit
of options, I added a :min_span option to set the minimum number of
days to coalesce.

I've also made to_s work with the :week_start option as well.

I was going to go ahead and add the ability to specify the :week_start
as a string as well as an integer, but I realized that I really need
to refactor a bit before I do that, so I stopped for now.

---------- Forwarded message ----------
From: Bryan Donovan <brdonovan / gmail.com>
Date: Aug 30, 2006 2:45 PM
Subject: Re: [QUIZ] DayRange(#92) - My solution
To: rick.denatale / gmail.com


Rick,

Wow, a very detailed and extensive solution...

I did notice one thing, and maybe this was intentional, but when you
pass in 1,2,4,5 you should get "Mon, Tue, Thu, Fri", not "Mon-Tue,
Thu-Fri".  However, this is just according to the quiz "rules" and is
not necessarily the best way.  Maybe an option to specify the minimum
number of consecutive days to constitute a "range" would be a good
addition.  I'll probably add that to my own version ...

Regards,
Bryan



On 8/30/06, Rick DeNatale <rick.denatale / gmail.com> wrote:
> I sent this before with a big zipfile attachment including rdoc, and I
> think that the mailing list rejected it due to the size of the
> attachment. So I'm sending it again with just the source files.
>
> After solving the basic problem in a few minutes, doing the "simplest
> thing which could possibly work," I've spent my spare time over the
> last 4 or 5 days letting features, well, creep.
>
> I've noticed that there are two major styles of quiz respondants, some
> go for brief code, others go for well-documented code sometimes with
> lots of new features. I guess I fall into the latter camp.
>
> I really used this as an exercise to explore implementing rails-like
> options parameters.  The code is documented, and I've included the
> html output of rdoc in the attached zip file.  There's also a test
> script.
>
> So here's my solution.  A few goodies I've added.
>
> 1) Rails style options can be used on new, to_s and a few more.
> 2) Option to select when the week starts, the ranges produced in to_s
> will never span over a week boundary.
> I just realized that I really should let you specify the start of the
> week as either a number or a name, but it's time to lay my cards on
> the table, so names will have to wait until the next 'release' <G>.
> 3) Option to select a language.  English and French are built-in.
> 4) Support for ad-hoc languages, and adding new languages via a class
> method, see the rdoc and testcases for examples of how to do this.
> 5) A DayRange is enumerable and should act like an array containing
> the day numbers with the week-start fixed as Monday extension to
> add options are on the 'roadmap' <G>
> 6) Probably some other things I'm overlooking as I type this note.
>
> --
> Rick DeNatale
>
> My blog on Ruby
> http://talklikeaduck.denhaven2.com/
>
>
>



-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

IPMS/USA Region 12 Coordinator
http://ipmsr12.denhaven2.com/

Visit the Project Mercury Wiki Site
http://www.mercuryspacecraft.com/

------art_43225_24202216.1156977476917
Content-Type: application/x-ruby; name="day_range.rb"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="day_range.rb"
X-Attachment-Id: f_eriahuec

IyBUaGlzIGNsYXNzIHdhcyB3cml0dGVuIGFzIGFuIGFuc3dlciB0byBSdWJ5UXVpejkyLgojCiMg
VGhlIERheVJhbmdlLm5ldyBtZXRob2QgdGFrZXMgb25lIG9yIG1vcmUgZGF5IHNwZWNpZmljYXRp
b25zIGFzIGVpdGhlciBpbnRlZ2VycyBvciBuYXR1cmFsIGxhbmd1YWdlCiMgc3RyaW5ncyByZXBy
ZXNlbnRpbmcgZGF5IG5hbWVzLiAgQW4gaW5zdGFuY2Ugd2lsbCByZXNwb25kIHRvIHRvX3Mgd2l0
aCBhIHN0cmluZyByZXByZXNlbnRpbmcKIyB0aGUgbGlzdCBvZiBkYXlzIHdpdGggY29uc2VjdXRp
dmUgZGF5cyBjb2xsYXBzZWQgdG8gYSBmb3JtIGxpa2UgJ01vbi1GcmknCiMKIyBTZXZlcmFsIG1l
dGhvZHMgdGFrZSAiUmFpbHMtc3R5bGUiIG9wdGlvbnMsIG9uZSBvciBtb3JlIGFzc29jaWF0aW9u
cyBhZnRlciBhbnkgbm9ybWFsIHBhcmFtZXRlcnMuCiMgVGhlIGtleXMgb2YgdGhlc2UgYXNzb2Np
YXRpb25zIGNhbiBiZSBTdHJpbmdzIG9yIHN5bWJvbHMgd2hpY2ggd2lsbC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gPSBTdHJpbmdTeW1IYXNoWyA6RW5nbGlzaCA9PiAgeyAKICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgJ01vbmRheScgPT4gMSwgJ01vbicgPT4gMSwgJ1R1ZXNk
YXknID0+IDIsICdUdWUnID0+IDIsCgkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnV2Vk
bmVzZGF5JyA9PiAzLCAnV2VkJyA9PiAzLCAnVGh1cnNkYXknID0+IDQsICdUaHUnID0+IDQsCgkJ
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnRnJpZGF5JyA9PiA1LCAnRnJpJyA9PiA1LCAn
U2F0dXJkYXknID0+IDYsICdTYXQnID0+IDYsCgkJICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAnU3VuZGF5JyA9PiA3LCAnU3VuJyA9PiA3IH0sIAoJCQkJICAgICA6RnJlbmNoID0+IHsgCiAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdMdW5kaScgPT4gMSwg
J0x1bicgPT4gMSwgJ01hcmRpJyA9PiAyLCAnTWFyJyA9PiAyLAoJCSAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgJ01lcmNyZWRpJyA9PiAzLCAnTWVyJyA9PiAzLCAnSmV1ZGknID0+IDQsICdK
ZXUnID0+IDQsCgkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnVmVuZHJlZGknID0+IDUs
ICdWZW4nID0+IDUsICdTYW1lZGknID0+IDYsICdTYW0nID0+IDYsCgkJICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAnRGltYW5jaGUnID0+IDcsICdEaW0nID0+IDcgfSBdCglAQGRheV9uYW1l
cyA9IFN0cmluZ1N5bUhhc2hbCQoJCTpFbmdsaXNoID0+IFtuaWwsICdNb24nLCAnVHVlJywgJ1dl
ZCcsICdUaHUnLCAnRnJpJywgJ1NhdCcsICdTdW4nXSwKCQk6RnJlbmNoID0+IFtuaWwsIC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MsIEBAZGF5X21hcHNbRGF5UmFuZ2UubGFuZ3VhZ2VfZnJv
bV9vcHRpb25zKG9wdGlvbnMpXSkKCWVuZAoKCWRlZiB3ZWVrX3N0YXJ0X2Zyb21fb3B0aW9ucyhv
cHRpb25zLCBkYXlfbWFwKQoJCXdlZWtfc3RhcnQgPSBEYXlSYW5nZS5nZXRfb3B0aW9uKDp3ZWVr
X3N0YXJ0LCBvcHRpb25zLCAxKQoJCXdlZWtfc3RhcnQgPSBkYXlfbWFwW3dlZWtfc3RhcnRdIHx8
IHdlZWtfc3RhcnQKCQlEYXlSYW5nZS5jaGVja19hcmcoKDEuLjcpID09PSB3ZWVrX3N0YXJ0LCI6
d2Vla19zdGFydCBtdXN0IGJlIGluIHRoZSByYW5nZSAoMS4uNykiKQoJCXdlZWtfc3RhcnQKCWVu
ZAoKZW5kCg------art_43225_24202216.1156977476917
Content-Type: application/x-ruby; name="testdayrange.rb"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="testdayrange.rb"
X-Attachment-Id: f_eriai605

cmVxdWlyZSAnZGF5X3JhbmdlLnJiJwpyZXF1aXJlICd0ZXN0L3VuaXQnCgpjbGFzcyBUZXN0RGF5
UmFuZ2UgPCBUZXN0OjpVbml0OjpUZXN0Q2FzZQoKCUVzcGVyYW50b01hcCA9IHsiTHVuZG8iID0+
IDEsICJMdW4iID0+IDEsICJNYXJkbyIgPT4gMiwgIk1hciIgPT4gMiwgIk1lcmtyZWRvIiA9PiAz
LCAiTWVyIiA9PiAzLCAKCQkJIkpoYXVkbyIgPT4gNCwgIkpoYSIgPT4gNCwgIlZlbmRyZWRvIiA9
PiA1LCAiVmVuIiA9PiA1LCAiU2FiYXRvIiA9PiA2LCAiU2FiIiA9PiA2LAoJCQkiRGltYW5jaG8i
ID0+IDcsICJEaW0iID0+IDd9CgoJRXNwZXJhbnRvTmFtZXMgPSBbIkx1biIsICJNYXIiLCAiTWVy
IiwgIkpoYSIsICJWZW4iLCAiU2FiIiwiRGltI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