Module: MotherBrain::FileSystem
- Defined in:
- lib/mb/file_system.rb,
lib/mb/file_system/tempfile.rb
Defined Under Namespace
Classes: Tempfile
Class Method Summary collapse
-
.init ⇒ Object
Create the directory structure for motherbrain.
- .logs ⇒ Pathname
- .manifests ⇒ Pathname
- .root ⇒ Pathname
- .templates ⇒ Pathname
- .tmp ⇒ Pathname
-
.tmpdir(prefix = nil) ⇒ String
Create a temporary directory in the tmp directory of the motherbrain file system.
Class Method Details
.init ⇒ Object
Create the directory structure for motherbrain
9 10 11 12 13 14 15 |
# File 'lib/mb/file_system.rb', line 9 def init FileUtils.mkdir_p(logs) FileUtils.mkdir_p(manifests) FileUtils.mkdir_p(root) FileUtils.mkdir_p(templates) FileUtils.mkdir_p(tmp) end |
.manifests ⇒ Pathname
23 24 25 |
# File 'lib/mb/file_system.rb', line 23 def manifests root.join("manifests") end |
.root ⇒ Pathname
28 29 30 |
# File 'lib/mb/file_system.rb', line 28 def root Pathname.new(default_root_path) end |
.templates ⇒ Pathname
38 39 40 |
# File 'lib/mb/file_system.rb', line 38 def templates root.join("templates") end |
.tmpdir(prefix = nil) ⇒ String
Create a temporary directory in the tmp directory of the motherbrain file system
49 50 51 |
# File 'lib/mb/file_system.rb', line 49 def tmpdir(prefix = nil) Dir.mktmpdir(prefix, tmp) end |