Class: DirCat::Config
- Inherits:
-
Object
- Object
- DirCat::Config
- Defined in:
- lib/dircat/config.rb
Class Method Summary collapse
-
.user_config_dir ⇒ Object
user config dir normally is ~/.dircat.
Class Method Details
.user_config_dir ⇒ Object
user config dir normally is
~/.dircat
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dircat/config.rb', line 7 def self.user_config_dir # find directory where to store catalog data # depends on OS user_home_dir = ENV['HOME'] || ENV['APPDATA'] if user_home_dir if RUBY_PLATFORM =~ /linux/ config_dir = File.(File.join(user_home_dir, "." + DirCat::NAME)) else config_dir = File.(File.join(user_home_dir, DirCat::NAME)) end Dir.mkdir(config_dir) unless File.directory?(config_dir) config_dir else File.join(home_dir, "config") end end |