Skip to content
Browse files

Find configuration file in XDG Base Directory

Find configuration file in XDG Base Directory only if `PRYRC` is not
set, and `~/.pryrc` does not exist, therefore not confusing current
users. Note that cache file path is not modified.
  • Loading branch information...
FranklinYu committed May 16, 2017
1 parent baa2904 commit a0be0cc7b2070edff61c0c7f10fa37fce9b730bd
Showing with 12 additions and 1 deletion.
  1. +12 −1 lib/pry/pry_class.rb
@@ -1,7 +1,18 @@
require 'pry/config'
class Pry

HOME_RC_FILE = ENV["PRYRC"] || "~/.pryrc"
if ENV.key?('PRYRC')
elsif File.exist?(File.expand_path('~/.pryrc'))
elsif ENV.key?('XDG_CONFIG_HOME') && ENV['XDG_CONFIG_HOME'] != ''
# See XDG Base Directory Specification at
ENV['XDG_CONFIG_HOME'] + '/pry/pryrc'
LOCAL_RC_FILE = "./.pryrc"

class << self

0 comments on commit a0be0cc

Please sign in to comment.
You can’t perform that action at this time.