[Rake-devel] including .specification files (or other "dot" files) in Rake Package on Linux/Mac OS X

Assaf Arkin assaf at labnotes.org
Wed Nov 18 03:34:41 EST 2009


On Nov 17, 2009, at 8:07 PM, Nathan Beyer wrote:

> On Tue, Nov 17, 2009 at 12:16 AM, Assaf Arkin <assaf at labnotes.org> wrote:
>> On Mon, Nov 16, 2009 at 8:10 PM, Nathan Beyer <nbeyer at gmail.com> wrote:
>>> 
>>> I've found that my instantiation of the Rake Package task for
>>> packaging up a Rails app isn't including the '.specification' files in
>>> the '/vendor/gems/**/*' pattern. I've recreated this on Linux and Mac
>>> OS X.
>>> 
>>> It seems the issue is that the files, which are copied from their
>>> origin to the target folder, are missing the files. I'm guessing this
>>> is because of the underlying copy commands, but haven't dug into it
>>> yet.
>> 
>> FileList (also Dir.glob, File.fnmatch) does not match dot files when you use
>> the pattern "*".  That's by design, dot files are hidden, so the default
>> behavior is to not match them.  You can use the option File::FNM_DOTMATCH,
>> or change the pattern to match "{.*,*}".
> 
> I assumed it was default behavior, i just didn't know how to get it
> changed in this case.
> 
> Is the use of curly braces in the FileList [] method documented
> somewhere, I haven't seen that before? Is "{.*,*}" the same as two
> separate patterns ".*" and "*" in the same FileList[]?

FileList uses Dir.glob to find files (to include and exclude), and so supports all the same patterns:
http://ruby-doc.org/core/classes/Dir.html#M002322

Assaf

> 
> Thanks for the help.
> -Nathan
> 
>> Assaf Arkin
>> Blogging at labnotes.org
>> 
>>> 
>>> Has anyone else run into this? Is there anyway to get Rake to pickup
>>> '.specification' or any other "dot" files?
>>> _______________________________________________
>>> Rake-devel mailing list
>>> Rake-devel at rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/rake-devel
>> 
>> 
>> _______________________________________________
>> Rake-devel mailing list
>> Rake-devel at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rake-devel
>> 
> _______________________________________________
> Rake-devel mailing list
> Rake-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rake-devel



More information about the Rake-devel mailing list