Module: UtilsIO

Defined in:
lib/mrpin/core/utils/utils_io.rb

Class Method Summary collapse

Class Method Details

.to_domain_path(file_path) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/mrpin/core/utils/utils_io.rb', line 8

def self.to_domain_path(file_path)
  root_dir = self.root_dir

  file_path = file_path.gsub(root_dir, '')

  File.join('https://', AppInfo.instance.host, file_path)
end

.to_local_path(url_path) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/mrpin/core/utils/utils_io.rb', line 17

def self.to_local_path(url_path)
  root_dir = self.root_dir

  file_path = url_path
  file_path = file_path.gsub(AppInfo.instance.host, '')
  file_path = file_path.gsub('https://', '')
  file_path = file_path.gsub('http://', '')

  File.join(root_dir, file_path)
end