passbe/beef-migration-test-3 — Issue #338: Add Command Module Function: Map file to a url
Author: passbe
Created: 2011-12-09 00:28:53+00:00
State: open

Create a function which maps a file to a url in the Command base class (/lib/modules/command.rb). This will enable a derived command module make available arbitrary files over HTTP.

# If no path is specified the function will map the file to a random path.
# If no extension is specified the function will not add an extension.
# The request_count will specify how many times the file can be requested before it is unmapped.
# The default functionality is the map the file to a random path.
# The url path is returned.

def map_file_to_url(file, path=nil, extension=nil, request_count=1)

....

return url_path
end

Google Code Issue: http://code.google.com/p/beef/issues/detail?id=153