Module: UtilsIO
- Defined in:
- lib/mrpin/core/utils/utils_io.rb
Class Method Summary collapse
Class Method Details
.root_dir ⇒ Object
3 4 5 |
# File 'lib/mrpin/core/utils/utils_io.rb', line 3 def self.root_dir Rails.env.development? ? File.join(Rails.root.to_s, 'public') : "/usr/local/#{AppInfo.instance.server_name}" end |
.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 |