[rspec-users] cucumber rake file question

Tom Cloyd tomcloyd at comcast.net
Sun Jan 18 20:40:18 EST 2009


David Chelimsky wrote:
> On Thu, Jan 15, 2009 at 9:16 AM, Pat Maddox <pergesu at gmail.com> wrote:
>   
>> On Thu, Jan 15, 2009 at 4:07 AM, Tom Cloyd <tomcloyd at comcast.net> wrote:
>>     
>>> Real beginner question here. I don't really know rake, so I'm stumbling.
>>>
>>> As I set a dir to hold my feature files, etc., I'm simply copying the files
>>> structure I see in
>>> /usr/lib/ruby/gems/1.8/gems/cucumber-0.1.13/examples/i18n/en/
>>>
>>> I know we need a Rake file ME little dir tree, but I don't think I can just
>>> copy the one in the examples tree - or rather, I think I have to alter the
>>> first line:
>>>
>>> $:.unshift(File.dirname(__FILE__) + '/../../../lib')
>>>
>>> I don't know if this is bash or some ruby thing I haven't figured out, but
>>> mostly I don't know what to do with the '/../../../lib') part.
>>>       
>
> That line is there because these examples are in the cucumber
> directory tree, and that ensures that the features are run with the
> code in that tree (and not an installed cucumber gem). So you should
> be able to blow that line away.
>
> HTH,
> David
>
>
>   
>>> It looks like
>>> its trying to locate the source dir, but if so, why not just specify +
>>> 'lib'...? After staring at it a bit, I have to admit I don't grasp what's
>>> going on.
>>>
>>> Can someone clue me in?
>>>       
>> It has to find the source dir relative to that file.  '/../../../lib'
>> means to go back up the dir structure three levels and then look for
>> lib there.
>>
>> Pat
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>>
>>     
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
>   
Thanks to all for the generosity of response to my query, which I only 
just now noticed.

I did figure out all the details in that "$:" line, when I finally had a 
chance to study it.

I did NOT know that the line was optional, though. It's not documented 
anywhere that I've seen, although I suppose that to those more 
knowledgeable than I that fact may be obvious.

Thanks again!

t.

-- 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc at tomcloyd.com >> (email)
<< TomCloyd.com >> (website) 
<< sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the rspec-users mailing list