Module: ScmWeb::FileUri

Included in:
Base, Tracker::Trac::TracProject
Defined in:
lib/scm_web/file_uri.rb

Instance Method Summary collapse

Instance Method Details

#file_uri(path = "", options = {:type=>"overview"}) ⇒ Object

TODO: rename to file_uri to avoid the clash that is currently in Trac Returns the URI for the file at path. Options are:

:type (can be one of :overview, :raw or :html)
:revision (the revision of the file. must be specified when :type is :raw or :html)


8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/scm_web/file_uri.rb', line 8

def file_uri(path="", options={:type=>"overview"})
  type = options[:type]
  raise "No :type specified" unless type
  uri_spec = uri_specs[type]
  raise "No uri_spec for #{type}" unless uri_spec

  project_unix_name = @project_unix_name
  path_prefix = options[:path_prefix]
  revision = options[:revision]
  previous_revision = options[:previous_revision]
  eval("\"#{uri_spec}\"", binding)
end