Module: Ronin::Exploits::Mixins::BuildDir
- Defined in:
- lib/ronin/exploits/mixins/build_dir.rb
Overview
Sets up a temporary build directory for the exploit.
Instance Attribute Summary collapse
-
#build_dir ⇒ String?
readonly
The build directory for the exploit.
Instance Method Summary collapse
-
#perform_build ⇒ Object
Sets #build_dir and then builds the exploit.
-
#perform_cleanup ⇒ Object
Cleans up the exploit and deletes the #build_dir.
Instance Attribute Details
#build_dir ⇒ String? (readonly)
The build directory for the exploit.
37 38 39 |
# File 'lib/ronin/exploits/mixins/build_dir.rb', line 37 def build_dir @build_dir end |
Instance Method Details
#perform_build ⇒ Object
Sets #build_dir and then builds the exploit.
42 43 44 45 46 47 |
# File 'lib/ronin/exploits/mixins/build_dir.rb', line 42 def perform_build exploit_name = self.class.id.tr('/','-') @build_dir = Dir.mktmpdir("ronin-exploit-#{exploit_name}-") super end |
#perform_cleanup ⇒ Object
Cleans up the exploit and deletes the #build_dir.
52 53 54 55 56 57 |
# File 'lib/ronin/exploits/mixins/build_dir.rb', line 52 def perform_cleanup super FileUtils.rm_r(@build_dir) @build_dir = nil end |