[Mongrel] [ANN] Finally! Mongrel 0.3.13.4 Official (for Unix)

Neil Wilson neil at aldur.co.uk
Mon Sep 18 15:55:23 EDT 2006


On 18/09/06, Charles Brian Quinn <me at seebq.com> wrote:
>
> on separate versioning:
> The flip-side to separate versioning is that you can write a script to
> automagically install everything for a new rails setup and not be
> prompted for the version of mongrel in the middle of your massive,
> long-running install script....  I believe.


Or alternatively via Capistrano. (This is a def that is part of a Gem
plugin).

  # Auto selects a gem from a list and installs it.
  #
  # *gem* has no mechanism on the command line of disambiguating builds for
  # different platforms, and instead asks the user. This method has the
necessary
  # conversation to select the +version+ relevant to +platform+ (or the one
nearest
  # the top of the list if you don't specify +version+).
  def select(package, version=nil, platform='ruby')
    selections={}
    cmd="#{GEM_INSTALL} #{if version then '-v '+version.to_s end}
#{package}"
    sudo cmd do |channel, stream, data|
      data.each_line do | line |
        case line
        when /\s(\d+).*\(#{platform}\)/
          if selections[channel[:host]].nil?
            selections[channel[:host]]=$1.dup+"\n"
            logger.info "Selecting #$&", "#{stream} :: #{channel[:host]}"
          end
        when /\s\d+\./
          # Discard other selections from data stream
        when /^>/
          channel.send_data selections[channel[:host]]
          logger.debug line, "#{stream} :: #{channel[:host]}"
        else
          logger.info line, "#{stream} :: #{channel[:host]}"
        end
      end
    end
  end

-- 
Neil Wilson (neil at aldur.co.uk)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060918/b86f65b5/attachment.html 


More information about the Mongrel-users mailing list