Hello all,

I have a couple extension libraries that I'd like to make work in both
cap 1.4 and 2.0.  I can't figure out the best way to do this that will
work in both.

Here is a sample recipe file that I would typically require in my
deploy.rb

Capistrano.configuration(:must_exist).load do
    desc "Save the current source code revision to version.rb"
    task :save_version_number, :roles => :app do
      run "echo APP_VERSION='#{source.latest_revision}' >
#{release_path}/lib/version.rb"
    end

    desc "Run the save_version_number task after update_code runs."
    task :after_update_code , :roles => :app do
      save_version_number
    end
end


After conversion to 2.0, I have it looking like this:


Capistrano::Configuration.instance.load do
  namespace :deploy do
    desc "Save the current source code revision to version.rb"
    task :save_version_number, :roles => :app do
      run "echo APP_VERSION='#{source.latest_revision}' >
#{release_path}/lib/version.rb"
    end

    after :update_code, :save_version_number
  end
end

My problem is how to get these two versions to live in the same file,
ideally with less duplication. Any guidance would be greatly
appreciated!

The code's usefulness is arguable, but it is real code from a Rails
plugin http://source.collectiveidea.com/public/rails/plugins/version_number


--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to