vendor/bundle/ruby/1.8/gems/Ruby-MemCache-0.0.1/utils.rb
### Given a documentation <tt>catalogFile</tt>, extract the name of the file
### to use as the initally displayed page. If extraction fails, the
### +default+ will be used if it exists. Returns +nil+ if there is no main
### file to be found.
Given a documentation catalogFile, extract the name of the file
to use as the initally displayed page. If extraction fails, the
+default+ will be used if it exists. Returns +nil+ if there is no main
file to be found.
Given a documentation catalogFile extract the name of the file to use as the initally displayed page . If extraction fails the + default + will be used if it exists . Returns + nil + if there is no main file to be found .
def findRdocMain( catalogFile="docs/CATALOG", default="README" )
		main = findCatalogKeyword( 'main', catalogFile )
		if main.nil?
			basedir = File::dirname( __FILE__ )
			basedir = File::dirname( basedir ) if /docs$/ =~ basedir
			if File::exists?( File::join(basedir, default) )
				main = default
			end
		end
		return main
	end
def findRdocMain ( catalogFile = "docs/CATALOG" , default = "README" ) main = findCatalogKeyword ( 'main' , catalogFile ) if main . nil? basedir = File :: dirname ( __FILE__ ) basedir = File :: dirname ( basedir ) if / docs$ / =~ basedir if File :: exists? ( File :: join ( basedir , default ) ) main = default end end return main end
Given a documentation <tt>catalogFile</tt>, extract the name of the file
to use as the initally displayed page.
Given a documentation <tt > catalogFile< / tt > extract the name of the file to use as the initally displayed page .
# Try extracting it from the CATALOG file from a line that looks like: # Main: Foo Bar Module # Try to make some educated guesses if that doesn't work
catalogFile
default