File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -366,10 +366,17 @@ def self.unify tag
366366
367367 def self . pstore_dir
368368 unless defined? @@pstore_dir
369- # This will hopefully work on *NIX and Windows systems
370- home = ENV [ 'HOME' ] || ENV [ 'HOMEDRIVE' ] + ENV [ 'HOMEPATH' ] || ENV [ 'USERPROFILE' ]
371- subdir = @@running_on_windows ? '_mini_exiftool' : '.mini_exiftool'
372- @@pstore_dir = File . join ( home , subdir )
369+ @@pstore_dir =
370+ if env = ENV [ 'MINI_EXIFTOOL_PSTORE_DIR' ]
371+ env
372+ elsif defined? ( Gem . cache_home ) && File . writable? ( Gem . cache_home )
373+ File . join ( Gem . cache_home , 'mini_exiftool' )
374+ else
375+ # This fallback will hopefully work on *NIX and Windows systems
376+ home = ENV [ 'HOME' ] || ENV [ 'HOMEDRIVE' ] + ENV [ 'HOMEPATH' ] || ENV [ 'USERPROFILE' ]
377+ subdir = @@running_on_windows ? '_mini_exiftool' : '.mini_exiftool'
378+ File . join ( home , subdir )
379+ end
373380 end
374381 @@pstore_dir
375382 end
You can’t perform that action at this time.
0 commit comments