I think I'm going mad. Can anyone help?
I have the folder c:\project\bin I run the following to execute my rake script
cd C:\project
rake
In my rake script I have:
require 'rake/clean'
CLOBBER.include('bin')
task :default => [:compile]
task :compile do
# do nothing
end
It doesn't delete the "bin" folder nor the contents of the "bin" folder. I'm running Ruby in Windows (1.86 or so) and installed rake using, gem install rake.
Have I missed something. I've tried --trace etc.. but get no feedback.
TL;DR: $ rake clobber
As the answer above said, they are not implicilty invoked. Here is an example, as you asked for.
~/deleteme$ cd project
total 8
-rw-r--r--@ 1 josh staff 110 Jun 27 06:04 Rakefile
~/deleteme/project$ cat Rakefile
require 'rake/clean'
CLOBBER.include('bin')
task :default => ["compile"]
task :compile do
mkdir 'bin'
end
~/deleteme/project$ rake
(in /Users/josh/deleteme/project)
mkdir bin
~/deleteme/project$ ls -l
total 8
-rw-r--r--@ 1 josh staff 110 Jun 27 06:04 Rakefile
drwxr-xr-x 2 josh staff 68 Jun 27 06:05 bin
~/deleteme/project$ rake -T
(in /Users/josh/deleteme/project)
rake clean # Remove any temporary products.
rake clobber # Remove any generated file.
~/deleteme/project$ rake clobber
(in /Users/josh/deleteme/project)
rm -r bin
~/deleteme/project$ ls -l
total 8
-rw-r--r--@ 1 josh staff 110 Jun 27 06:04 Rakefile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With