[Rake] call a task of a namespace from an other task.

Discussion in 'Ruby' started by Stéphane Wirtel, Jun 14, 2007.

  1. Hi all,

    I try to call a task of a namespace from an other task !

    Exemple:

    ReleaseDirectory = File.join( "d:", "release" )

    namespace :release do
    task :create do
    mkdir_p ReleaseDirectory, QUIET
    end
    end

    namespace :kernel do
    task :compile do
    end

    task :release => [ ???? ] do
    end
    end


    "????" What can I put ? I would like to use the task ":create" of the
    namespace ":release". Is there a way to resolve my problem ?

    Thanks

    Stephane Wirtel
    Stéphane Wirtel, Jun 14, 2007
    #1
    1. Advertising

  2. Re: call a task of a namespace from an other task.

    Ok, I found a solution but I don't know if it's a good solution.

    I put the namespace :release in a variable.

    Example:

    releaseNs = namespace :release do
    task :create do
    mkdir_p ReleaseDirectory
    end
    end

    namespace :kernel do
    task :compile do
    end

    task :release => [ releaseNs[:create] ] do
    end
    end


    What do you think of this solution ?
    Stéphane Wirtel, Jun 14, 2007
    #2
    1. Advertising

  3. On 6/14/07, St=E9phane Wirtel <> wrote:
    > Hi all,
    >
    > I try to call a task of a namespace from an other task !


    Well, you're not strictly "calling" the task. You're making it a dependency=
    Bob Showalter, Jun 14, 2007
    #3
  4. Bob Showalter a écrit :
    > On 6/14/07, Stéphane Wirtel <> wrote:
    >> Hi all,
    >>
    >> I try to call a task of a namespace from an other task !

    >
    > Well, you're not strictly "calling" the task. You're making it a dependency

    yes, sorry.

    a dependency.

    Do you think that my previous mail is a good solution ?
    Stephane Wirtel, Jun 15, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peng Yu
    Replies:
    0
    Views:
    639
    Peng Yu
    Sep 14, 2008
  2. Joe Van Dyk
    Replies:
    2
    Views:
    102
    Damphyr
    Jan 31, 2006
  3. peppermonkey
    Replies:
    1
    Views:
    238
    Gregory Brown
    Feb 10, 2007
  4. Adam Anderson
    Replies:
    1
    Views:
    129
    Adam Anderson
    Sep 19, 2007
  5. James Mead
    Replies:
    0
    Views:
    141
    James Mead
    Jan 15, 2008
Loading...

Share This Page