Old 16-04-2008, 18:22   #1 (permalink)
Paul
Junkie[scum]
 
Paul's Avatar
 
Join Date: Oct 2006
Location: location, location
Posts: 1,691
set base directory in ruby

I have a site which is a blog and the post go into deeper directory.

how do i set the base directory?
  Reply With Quote
Old 23-04-2008, 17:00   #2 (permalink)
Paul
Junkie[scum]
 
Paul's Avatar
 
Join Date: Oct 2006
Location: location, location
Posts: 1,691
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
Old 23-04-2008, 17:12   #3 (permalink)
Paul
Junkie[scum]
 
Paul's Avatar
 
Join Date: Oct 2006
Location: location, location
Posts: 1,691
nevermind, got it
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8