My goal is to copy a set of files specified by a pattern to the target dir. The files in source directory can have subdirs.
I tried:
cp_r(Dir.glob('**/*.html'), @target_dir):
and
cp_r(FileList['**/*.html'], @target_dir):
but neither work.
it only works when I do something like:
cp_r(Dir['.'], @target_dir):
But I need to copy only *.html files not anything else.
I need what
cp --parents
Command does
Any advice using existing Ruby/Rake methods?
UPDATE Looks like thing which is easier to do with Ant, is not possible with Ruby/Rake stack - may be I would need to look into something else. I don't want to write custom code to make it work in Ruby. I just thought about Ruby/Rake as appropriate solution for that.
UPDATE 2 This is how I do it with Ant
<target name="buildeweb" description="Builds web site" depends="clean">
<mkdir dir="${build.dir.web}" />
<copy todir="${build.dir.web}" verbose="true">
<fileset dir="${source.dir.web}">
<include name="**/*.html" />
<include name="**/*.htm" />
</fileset>
</copy>
<chmod perm="a+x">
<fileset dir="${build.dir.web}">
<include name="**/*.html" />
<include name="**/*.htm" />
</fileset>
</chmod>
</target>