libraries/chef_rvm_passenger_recipe_helpers.rb
##
# Sets the version attribute to the most current RubyGems release,
# unless set
Sets the version attribute to the most current RubyGems release,
unless set
Sets the version attribute to the most current RubyGems release unless set
def determine_gem_version_if_not_given
        if node[:rvm_passenger][:version].nil?
          require 'rubygems'
          require 'rubygems/dependency_installer'
          spec = Gem::DependencyInstaller.new.find_gems_with_sources(
            Gem::Dependency.new("passenger", '>= 0')).last
          if spec.nil?
            raise Chef::RVMPassenger::GemVersionNotFound,
              "Cannot find any suitable gem version of ruby Passenger. " +
              "Please specify node['rvm_passenger']['version'] or check if " +
              "there are any connection problem with the gem sources."
          end
          node.set[:rvm_passenger][:version] = spec[0].version.to_s
          Chef::Log.debug(%{Setting node['rvm_passenger']['version'] = } +
            %{"#{node['rvm_passenger']['version']}"})
        end
      end
def determine_gem_version_if_not_given if node [ :rvm_passenger ] [ :version ] . nil? require 'rubygems' require 'rubygems/dependency_installer' spec = Gem :: DependencyInstaller . new . find_gems_with_sources ( Gem :: Dependency . new ( "passenger" , '>= 0' ) ) . last if spec . nil? raise Chef :: RVMPassenger :: GemVersionNotFound , "Cannot find any suitable gem version of ruby Passenger. " + "Please specify node['rvm_passenger']['version'] or check if " + "there are any connection problem with the gem sources." end node . set [ :rvm_passenger ] [ :version ] = spec [ 0 ] . version . to_s Chef :: Log . debug ( %{Setting node['rvm_passenger']['version'] = } + %{"#{node['rvm_passenger']['version']}"} ) end end
Sets the version attribute to the most current RubyGems release,
unless set
Sets the version attribute to the most current RubyGems release unless set