Sha256: ead4b37ee84a5a3613b04b21447bd2283792cc237813b66e87b91714dfad8f80

Contents?: true

Size: 1.54 KB

Versions: 7

Compression:

Stored size: 1.54 KB

Contents

#
# Cookbook Name:: rvm
# Library:: Chef::RVM::EnvironmentHelpers
#
# Author:: Fletcher Nichol <fnichol@nichol.ca>
#
# Copyright 2011, Fletcher Nichol
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

class Chef
  module RVM
    module RubyHelpers
      # stub to satisfy EnvironmentHelpers (library load order not guarenteed)
    end

    module GemsetHelpers
      # stub to satisfy EnvironmentHelpers (library load order not guarenteed)
    end

    module EnvironmentHelpers
      include RubyHelpers
      include GemsetHelpers

      ##
      # Determines whether or not and ruby/gemset environment exists
      #
      # @param [String, #to_s] the fully qualified RVM ruby string
      # @return [Boolean] does this environment exist?
      def env_exists?(ruby_string)
        return true if system_ruby?(ruby_string)

        rubie   = select_ruby(ruby_string)
        gemset  = select_gemset(ruby_string)

        if gemset
          gemset_exists?(:ruby => rubie, :gemset => gemset)
        else
          ruby_installed?(rubie)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
from-scratch-0.7.0 cookbooks/rvm/libraries/chef_rvm_environment_helpers.rb
from-scratch-0.6.0 cookbooks/rvm/libraries/chef_rvm_environment_helpers.rb
from-scratch-0.5.0 cookbooks/rvm/libraries/chef_rvm_environment_helpers.rb
from-scratch-0.3.0 cookbooks/rvm/libraries/chef_rvm_environment_helpers.rb
from-scratch-0.2.0 cookbooks/rvm/libraries/chef_rvm_environment_helpers.rb
from-scratch-0.1.1 cookbooks/rvm/libraries/chef_rvm_environment_helpers.rb
from-scratch-0.1.0 cookbooks/rvm/libraries/chef_rvm_environment_helpers.rb