aboutsummaryrefslogtreecommitdiffstats
path: root/spec/bundler/support/permissions.rb
blob: f5636dd70ada7bed4d1ed0736ab47d39c138e73f (plain)
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true
module Spec
  module Permissions
    def with_umask(new_umask)
      old_umask = File.umask(new_umask)
      yield if block_given?
    ensure
      File.umask(old_umask)
    end
  end
end