Module: Ronin::Config
- Defined in:
- lib/ronin/config.rb
Overview
Configuration information for Ronin.
Constant Summary collapse
- HOME =
The users home directory
Gem.user_home
- PATH =
Ronin home directory
File.join(HOME,'.ronin')
- CONFIG_DIR =
Configuration files directory
File.join(PATH,'config')
- TMP_DIR =
Temporary file directory
File.join(PATH,'tmp')
- BIN_DIRS =
Directories which contain binaries
ENV.fetch('PATH','').split(File::PATH_SEPARATOR)
Class Method Summary collapse
-
.load(name = nil) ⇒ Object
Loads the Ronin configuration file.
-
.tmp_dir(sub_path = nil) ⇒ String
Auto-creates a directory within TMP_DIR.
Class Method Details
.load(name = nil) ⇒ Object
Loads the Ronin configuration file.
63 64 65 66 67 68 69 70 |
# File 'lib/ronin/config.rb', line 63 def self.load(name=nil) dir, file = if name then [CONFIG_DIR, "#{name}.rb"] else [PATH, 'config.rb'] end path = File.(File.join(dir,file)) require path if File.file?(path) end |
.tmp_dir(sub_path = nil) ⇒ String
Auto-creates a directory within TMP_DIR.
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/ronin/config.rb', line 83 def self.tmp_dir(sub_path=nil) if sub_path sub_path = File.(File.join('',sub_path)) path = File.join(TMP_DIR,sub_path) FileUtils.mkdir_p(path) unless File.directory?(path) return path end return TMP_DIR end |