Sha256: eb73f1e680cd9d538517f5a4859be8dd3924e63d2cb302e499745ed13e892cda

Contents?: true

Size: 769 Bytes

Versions: 1

Compression:

Stored size: 769 Bytes

Contents

module Rad
  module HTTP
    class << self
      inject environment: :environment, config: :config
      
      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
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rad_core-0.0.13 lib/rad/http/http.rb