# Rake Namespaces - How to keep them separate?

**URL:** <https://www.ruby-forum.com/t/rake-namespaces-how-to-keep-them-separate/104284>\
**Category:** Rails\
**Created:** [May 16, 2007, 11:22am UTC](https://www.ruby-forum.com/t/rake-namespaces-how-to-keep-them-separate/104284 "2007-05-16T11:22:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [May 16, 2007, 11:22am UTC](https://www.ruby-forum.com/t/rake-namespaces-how-to-keep-them-separate/104284/1 "2007-05-16T11:22:57Z")

</div>

Good morning,

In our app we have a number of custom Rake tasks living in lib/tasks.

Each has a different namespace, but if I do this (yes, I know, global  
variables bad):

namespace :spider\_uk\_foo do  
@ss = Scraper.new  
@ss.set\_name

task :perform do  
end  
end

Then @ss.set\_name is run when running any other rake file, though each  
has a different namespace.

@ss would also appear to be available to other rake files, again in  
different namespaces, where it is not even defined.

Any ideas, please?

Any advice, or pointing out of something obvious that I’ve missed,  
gratefully received.

Thank you,

Dave
