aboutsummaryrefslogtreecommitdiffstats
path: root/spec/bundler/support/permissions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/support/permissions.rb')
-rw-r--r--spec/bundler/support/permissions.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/bundler/support/permissions.rb b/spec/bundler/support/permissions.rb
new file mode 100644
index 0000000000..f5636dd70a
--- /dev/null
+++ b/spec/bundler/support/permissions.rb
@@ -0,0 +1,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