View Single Post
Old 23-04-2008, 17:00   #2 (permalink)
karloff
Junkie[scum]
 
karloff's Avatar
 
Join Date: Oct 2006
Location: location, location
Posts: 1,647
no-one?

basically i'm looking to translate the following php code into some sort of ruby shit
PHP Code:
<?php
    
// Find include and base directory
    
if(DIRECTORY_SEPARATOR == '\\') {
        
$fullpath str_replace("\\""/"__FILE__);
    } else {
        
$fullpath __FILE__;
    }
    
    
$breadcrumb explode("/"$fullpath);
    
$filename end($breadcrumb);
    
$includes substr($fullpath0, (-strlen($filename)));
    
$temp strlen(prev($breadcrumb))+1;
    
$base substr($fullpathstrlen($_SERVER['DOCUMENT_ROOT']), (strlen($filename) - $temp));
    unset(
$temp);
    
    
$directory['base']    = substr($fullpathstrlen($_SERVER['DOCUMENT_ROOT']), (strlen($filename) - $temp));
    
$directory['include'] = substr($fullpath0, (-strlen($filename)));
    
$directory['images']   = $directory['base']."images/";
    
$directory['css']     = $directory['base']."css/";
    
$directory['script']  = $directory['base']."js/";
?>

or do any of you rails cats know a method which is already embedded in the framework?
  Reply With Quote