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.2.0.pre spec/support/sudo.rb
bundler-1.1.3 spec/support/sudo.rb
bundler-1.1.2 spec/support/sudo.rb
bundler-1.1.1 spec/support/sudo.rb
bundler-1.1.0 spec/support/sudo.rb
bundler-1.1.rc.8 spec/support/sudo.rb
bundler-1.0.22 spec/support/sudo.rb
bundler-1.1.rc.7 spec/support/sudo.rb
bundler-1.1.rc.6 spec/support/sudo.rb
bundler-1.1.rc.5 spec/support/sudo.rb
bundler-1.1.rc.3 spec/support/sudo.rb
bundler-1.1.rc.2 spec/support/sudo.rb
mpapis-bundler-1.0.21.1 spec/support/sudo.rb
mpapis-bundler-1.0.21 spec/support/sudo.rb
bundler-maglev--1.0.21 spec/support/sudo.rb
bundler-1.1.rc spec/support/sudo.rb
bundler-1.0.21 spec/support/sudo.rb
bundler-1.0.21.rc spec/support/sudo.rb
bundler-1.0.20 spec/support/sudo.rb
bundler-1.1.pre.10 spec/support/sudo.rb