class Bundler::PermissionError
公共类方法
new(path, permission_type = :write) 点击切换源码
# File bundler/errors.rb, line 99 def initialize(path, permission_type = :write) @path = path @permission_type = permission_type end
公共实例方法
action() 点击切换源码
# File bundler/errors.rb, line 104 def action case @permission_type when :read then "read from" when :write then "write to" when :executable, :exec then "execute" else @permission_type.to_s end end
message() 点击切换源码
# File bundler/errors.rb, line 126 def message "There was an error while trying to #{action} `#{@path}`. " \ "It is likely that you need to grant #{permission_type}." end
parent_folder() 点击切换源码
# File bundler/errors.rb, line 122 def parent_folder File.dirname(@path) end
permission_type() 点击切换源码
# File bundler/errors.rb, line 113 def permission_type case @permission_type when :create "executable permissions for all parent directories and write permissions for `#{parent_folder}`" else "#{@permission_type} permissions for that path" end end