mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
stat("$HOME/.aprc") only once per process.
This commit is contained in:
parent
551bb9cd30
commit
113534e761
2 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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!
|
||||
|
|
Loading…
Reference in a new issue