Module: Ronin::Config
- Extended by:
- DataPaths::Finders
- Includes:
- DataPaths
- Defined in:
- lib/ronin/config.rb
Overview
Configuration information for Ronin.
Constant Summary collapse
- HOME =
The users home directory
Env.home
- PATH =
Ronin home directory
HOME.join('.ronin')
- CONFIG_DIR =
Configuration files directory
PATH.join('config')
- REPOS_DIR =
Directory which repositories are installed into
PATH.join('repos')
- TMP_DIR =
Temporary file directory
PATH.join('tmp')
Class Method Summary collapse
-
.load(name = nil) ⇒ Object
Loads the Ronin configuration file.
-
.tmp_dir(sub_path = nil) ⇒ Pathname
Auto-creates a directory within TMP_DIR.
Class Method Details
.load(name = nil) ⇒ Object
Loads the Ronin configuration file.
67 68 69 70 71 72 73 74 75 |
# File 'lib/ronin/config.rb', line 67 def Config.load(name=nil) path = if name CONFIG_DIR.join("#{name}.rb"). else PATH.join('config.rb') end require path if path.file? end |
.tmp_dir(sub_path = nil) ⇒ Pathname
Auto-creates a directory within TMP_DIR.
88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/ronin/config.rb', line 88 def Config.tmp_dir(sub_path=nil) if sub_path sub_path = File.(File.join('',sub_path)) path = TMP_DIR.join(sub_path) path.mkpath unless path.exist? return path end return TMP_DIR end |