1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

Merge pull request #305 from kstephens/aprc-once

stat("$HOME/.aprc") only once per process.
This commit is contained in:
James Cox 2017-06-16 17:19:25 -04:00 committed by GitHub
commit 807e5128ed
2 changed files with 10 additions and 1 deletions

View file

@ -1,4 +1,5 @@
## master (unreleased)
- stat("$HOME/.aprc") once [@kstephens] - [#304]
- ActiveRecord: #joins now show the columns #select'ed [@adrianomitre] - [#211]
- Handles NoMethodError for IRB implicit `ai` [@jtnegrotto] - [#212]
- Replaced Fixnum reference with Integer

View file

@ -143,9 +143,17 @@ module AwesomePrint
#---------------------------------------------------------------------------
def load_dotfile
dotfile = File.join(ENV['HOME'], '.aprc')
load dotfile if File.readable?(dotfile)
load dotfile if dotfile_readable?(dotfile)
end
def dotfile_readable? dotfile
if @@dotfile_readable.nil? || @@dotfile != dotfile
@@dotfile_readable = File.readable?(@@dotfile = dotfile)
end
@@dotfile_readable
end
@@dotfile_readable = @@dotfile = nil
# Load ~/.aprc file with custom defaults that override default options.
#---------------------------------------------------------------------------
def merge_custom_defaults!