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.5 spec/support/sudo.rb
bundler-1.3.0.pre.8 spec/support/sudo.rb
bundler-1.2.4 spec/support/sudo.rb
bundler-1.3.0.pre.7 spec/support/sudo.rb
bundler-1.3.0.pre.6 spec/support/sudo.rb
bundler-1.3.0.pre.5 spec/support/sudo.rb
bundler-1.3.0.pre.4 spec/support/sudo.rb
bundler-1.3.0.pre.3 spec/support/sudo.rb
bundler-1.3.0.pre.2 spec/support/sudo.rb
bundler-1.3.0.pre spec/support/sudo.rb
bundler-1.2.3 spec/support/sudo.rb
bundler-1.2.2 spec/support/sudo.rb
bundler-1.2.1 spec/support/sudo.rb
bundler-1.2.0 spec/support/sudo.rb
bundler-1.2.0.rc.2 spec/support/sudo.rb
bundler-1.2.0.rc spec/support/sudo.rb
bundler-1.1.5 spec/support/sudo.rb
bundler-1.2.0.pre.1 spec/support/sudo.rb
bundler-1.1.4 spec/support/sudo.rb
rkh-bundler-1.2.0.pre spec/support/sudo.rb