Sha256: 0aa56d308a1e7d75d6aea1a9a80711436df40cbfddd5414c1c0376eb2b944d98

Contents?: true

Size: 420 Bytes

Versions: 62

Compression:

Stored size: 420 Bytes

Contents

module Spec
  module Sudo
    def self.present?
      @which_sudo ||= (`which sudo`.chomp rescue '')
      !@which_sudo.empty?
    end

    def self.test_sudo?
      present? && ENV['BUNDLER_SUDO_TESTS']
    end

    def sudo(cmd)
      raise "sudo not present" unless Sudo.present?
      sys_exec("sudo #{cmd}")
    end

    def chown_system_gems_to_root
      sudo "chown -R root #{system_gem_path}"
    end
  end
end

Version data entries

62 entries across 62 versions & 5 rubygems

Version Path
bundler-1.0.9 spec/support/sudo.rb
bundler-1.0.7 spec/support/sudo.rb