Class: Papa::Helper::Path
- Inherits:
-
Object
- Object
- Papa::Helper::Path
- Defined in:
- lib/papa/helper/path.rb
Constant Summary collapse
- TMP_PATH =
'/tmp/'
- VI_PREFIX =
'papa-vi-'
- SANDBOX_PREFIX =
'papa-sandbox-'
Class Method Summary collapse
- .generate_sandbox_path(type, options = {}) ⇒ Object
- .generate_vi_file_path ⇒ Object
- .uuid_gen ⇒ Object
Class Method Details
.generate_sandbox_path(type, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/papa/helper/path.rb', line 14 def self.generate_sandbox_path(type, = {}) path = if .has_key?('override_path_prefix') [:override_path_prefix] + '-' + type else SANDBOX_PREFIX + type + '-' + uuid_gen end File.join(TMP_PATH, path) end |
.generate_vi_file_path ⇒ Object
10 11 12 |
# File 'lib/papa/helper/path.rb', line 10 def self.generate_vi_file_path File.join(TMP_PATH, VI_PREFIX + uuid_gen + '.txt') end |
.uuid_gen ⇒ Object
24 25 26 |
# File 'lib/papa/helper/path.rb', line 24 def self.uuid_gen SecureRandom.uuid end |