summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel E. Giddins <segiddins@segiddins.me>2015-07-22 17:49:30 -0700
committerSamuel E. Giddins <segiddins@segiddins.me>2015-07-22 17:49:30 -0700
commit411d6f1966f3d72e6b2d0d23df97db7d34058e88 (patch)
tree31e02df7f544dc47f1d2f5b424d280d761625400
parenta6a343dea1ed367ecaa8352217d591924c77474f (diff)
downloadbundler-seg-settings-permission-error.tar.gz
Actually store the permission typeseg-settings-permission-error
-rw-r--r--lib/bundler.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index c5cf1a11dd..5bb35f4d40 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -88,17 +88,18 @@ module Bundler
class PermissionError < BundlerError
def initialize(file, permission_type = :write)
@file = file
+ @permission_type = permission_type
end
def message
- action = case permission_type
+ action = case @permission_type
when :read then "read from"
when :write then "write to"
when :executable then "execute"
- else permission_type.to_s
+ else @permission_type.to_s
end
"There was an error while trying to #{action} `#{File.basename(@file)}`. " \
- "It is likely that you need to grant #{permission_type} permissions for " \
+ "It is likely that you need to grant #{@permission_type} permissions for " \
"the file at path: `#{File.expand_path(@file)}`."
end