On Feb 4, 2010, at 6:39 AM, Tom Copeland wrote:

> Hi all -
> 
> I saw some discussion of this in the archives, but has anyone done 
> integration between deploy:check and config.gem?  I know there are tricky 
> bits - e.g., config/environments/foo.rb could declare its own dependencies - 
> but maybe just something for the simple case of all dependencies being 
> declared in config/environment.rb?

Maybe (paste this in your in deploy.rb):

===========
class Collecter
  attr_accessor :dependencies
  def initialize
    @dependencies = {}
    File.read("config/environment.rb").split("\n").collect {|line| line.strip 
}.select {|line| line[0] != '#' }.select {|line| line.match(/^config.gem/) 
}.each do |line|
      self.instance_eval(line)
    end
  end
  def gem(name, args)
    @dependencies[name] = args
    args[:version] = ">=0.0.1" unless args.include?(:version)
  end
  def config
    self
  end
end
Collecter.new.dependencies.each do |name, args|
  depend :remote, :gem, name, args[:version]
end
===========

Yours,

Tom

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to