0

I have this code for a Rake file

Dir.chdir("WebApp/test/selenium") do
    FileList.new("**/*Test*.rb").exclude(/.*Base.*.rb/).exclude(/.*exclude.*.rb/).each do |file| 
        status = Process.spawn_w2("ruby #{file}")
        raise "At least one selenium component test failed to pass" if status != 0
    end 
end

I want to turn it into a Gruntfile (I have been trying with grunt-exec) but I have no idea how to pass a Fileset that includes a pattern but excludes others.

How could I do it?

Enrique Moreno Tent
  • 24,127
  • 34
  • 104
  • 189
  • In general you use the `!` in front of the pattern to exclude things in Grunt. Take a look at this answer: http://stackoverflow.com/questions/15199092/configure-grunt-copy-task-to-exclude-files-folders – Jordan Kasper Jan 17 '14 at 18:23
  • That is fine with plugins that take the `files` parameter, but when I am passing a whole command to grunt-exec, does that still work? – Enrique Moreno Tent Jan 17 '14 at 18:24
  • You'll need a custom grunt task, but yes you can. The Grunt [documentation on "Inside Tasks"](http://gruntjs.com/api/inside-tasks#this.files) (meaning custom tasks) talks about this a bit. And you can [read about custom tasks](http://gruntjs.com/creating-tasks#basic-tasks) themselves on the same site if you need more info there. – Jordan Kasper Jan 17 '14 at 18:29

0 Answers0