Module: Rad::HTTP

Defined in:
lib/rad/http/http.rb

Class Method Summary collapse

Class Method Details



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rad/http/http.rb', line 6

def ensure_public_symlink symlink_name, plugin_public_folder        
  plugin_public_folder = File.expand_path(plugin_public_folder)
  File.must.exist(plugin_public_folder)
          
  environment.must_be.defined                
  if environment.config.static? and !environment.config.test?        
    symlink_path = "#{config.public_dir!}/#{symlink_name}"
    unless File.exist?(symlink_path) # and File.symlink?(symlink_path)
      # File.delete(symlink_path) if File.symlink?(symlink_path)
      File.symlink(plugin_public_folder, symlink_path)
    end
  end
end